{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

BME513_HW_2

# BME513_HW_2 - BME 513 HW#2 Group 21 Su Zhe Valu Kaushal...

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

BME 513 HW#2 Group 21: Su, Zhe; Valu, Kaushal; Zhang, Xiabing; 2. For 6.1_1a and 6.1_2, plot the Fourier series approximation using the first 5, 10 and 15 harmonics in MATLAB. -8 -6 -4 -2 0 2 4 6 8 -1.5 -1 -0.5 0 0.5 1 1.5 Fourier series approximation using first 5 harmonics -8 -6 -4 -2 0 2 4 6 8 -1.5 -1 -0.5 0 0.5 1 1.5 Fourier series approximation using first 10 harmonics

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

View Full Document
BME 513 HW#2 Group 21: Su, Zhe; Valu, Kaushal; Zhang, Xiabing; Matlab code: N_harmonics = 5; %number of harmonics t = -9:.001:9; %set time interval and sampling x = zeros(size(t)); %initialize approximation %perform loop summation for k=1:N_harmonics x = x+(4/pi)*[((-1)^(k-1))/(2*k-1)]*cos((2*k-1)*0.5*pi*t); end figure; plot(t,x); axis([-9 9 -1.5 1.5]); title( 'Fourier series approximation using first 5 harmonics' ); -8 -6 -4 -2 0 2 4 6 8 -1.5 -1 -0.5 0 0.5 1 1.5 Fourier series approximation using first 15 harmonics