{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Chap3_Fseries_sol

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

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

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

View Full Document
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

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

View Full Document

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

View Full Document
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') will give first plots shown below. To check your answer, you can plot the truncated series and see if it converges correctly.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

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
Ask a homework question - tutors are online