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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/01/2008 for the course ECE 2704 taught by Professor Djstilwell during the Fall '08 term at Virginia Tech.

Page1 / 3

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online