Lab Report Template 7
Lab Report Template 7
Task 1 : Draw the Fourier series of square wave with the help of
x(t) =1/2 + 2/Π [ cos (w0t) – 1/3 cos(3w0t) +1/5 cos(5w0t) -1/7 cos (7w0t) +
1/9 cos (9w0 t) + ....]
Code:
t=0:.01:10;
f=0.25;
w0=2*pi*f;
x=(1/2)+(2/pi)*(square(w0*t)-(1/3)*square(3*w0*t)+(1/5)*square(5*w0*t)-
(1/7)*square(7*w0*t)+(1/9)*square(9*w0*t));
plot(t,x)
Graph:
Graph: