# HW 10 - Christopher Belcastro ECE 2704 Homework#10 Problem...

• Notes
• 3

This preview shows pages 1–2. Sign up to view the full content.

Christopher Belcastro ECE 2704 Homework #10 November 21, 2006 Problem 1 - MATLAB CODE: a) clear % Define the signal parameters T0 = 2; % period of the signal ep = .5; % pulse width, less than T0 t0 = 0; % offset A = 1; % amplitude w0 = 2*pi/T0; % fundamental frequency % Number of terms in the Fourier series nterm = 25; % Calculate coefficients of exponential Fourier series X0 = 1/4; % m= 0 term for kk = 1:nterm % m=1,2,..,10 terms X(kk) = (0.5*exp(-j*kk*pi)*(1/(kk*pi)^2-1/(j*kk*pi))-0.5*(1/(kk*pi)^2)); end % Calculate coefficients of cosine Fourier series Am = 2*abs(X); qm = angle(X); % Calculate the partial sums of the Fourier series t = linspace(-2.5*T0+ep/2,2*T0-ep/2,400); % time vector x = X0*ones(size(t)); % constant term for jj = 1:nterm x = x + Am(jj)*cos(jj*w0*t+qm(jj)); end % Calculate two-sided amplitude and phase spectrum Xt = abs(X); Xp = angle(X); Amp = [fliplr(Xt),X0,Xt]; % Amplitude spectrum Phs = [-fliplr(Xp),angle(X0),Xp]; % Phase spectrum % Calculate frequencies of Fourier series terms w = [-nterm:nterm]*w0; % Plot amplitude spectrum figure(2) plot(w,Amp, 'o' ); %axis([-nterm*w0-1,nterm*w0+1,0,0.8]) title( 'Two-Sided Amplitude Spectrum' ) xlabel(

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.
• Spring '08
• DJStilwell
• Fourier Series, Christopher A. Belcastro, Two-Sided Amplitude Spectrum, Two-Sided Phase Spectrum

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern