Chap3_Fseries_sol

Chap3_Fseries_sol - Some of the work can be done using...

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

View Full Document Right Arrow Icon
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Some of the work can be done using MATLAB: » n=1:15; » cn=-4*j./n/pi.*sin(pi*n/6).*sin(n*pi/2).*exp(-j*n*pi/3); » n=-15:-1; » c_n=-4*j./n/pi.*sin(pi*n/6).*sin(n*pi/2).*exp(-j*n*pi/3); » cn=[c_n 0 cn]; » n=-15:15; » subplot(221),stem(n,abs(cn)) » title('|c_n|') » subplot(222),stem(n,angle(cn)) » title('angle(c_n) in rad') To plot the Fourier series to check your answers: T=6; w0 = 2*pi/T; t = -1.5*T:T/1000:1.5*T; N = input( ’Number of harmonics ’ ); c0 = 0; x = c0*ones(1,length(t)); % dc component for n=1:N, cn = -4*j/n/pi*sin(pi*n/6)*sin(n*pi/2)*exp(-j*n*pi/3); c_n = conj(cn); x = x + cn*exp(j*n*w0*t) + c_n*exp(-j*n*w0*t); end plot(t,x) title([ ’ N = ’ ,num2str(N)]) -20 -10 0 10 20 0 0.2 0.4 0.6 0.8 |c n | -20 -10 0 10 20 -4 -2 0 2 4 angle(c n ) in rad -10 -5 0 5 10 -4 -2 0 2 4 N = 50
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

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

View Full DocumentRight Arrow Icon
Some of the work can be done using MATLAB: » n=-10:10; » cn=cos(pi/2*n*w0)/5./(1-(n*w0).^2); » subplot(221),stem(n,abs(cn)) » title('|c_n|') » subplot(222),stem(n,angle(cn)) » title('angle(c_n) in rad')
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 10/24/2010.

Page1 / 13

Chap3_Fseries_sol - Some of the work can be done using...

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

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