Using MATLAB, synthesize the periodic waveform for which the Fourier trigonometric Fourier series is

⎟ ⎠ ⎞⎜⎝ ⎛ ⋅⋅⋅+++−=

t t t t f

5cos2513cos91cos421)(

2

π

Chapter 17, Solution 2.

The function f(t) has a DC offset and is even. We use the following MATLAB code to plot f(t). The plot is shown below. If more terms are taken, the curve is clearly indicatinga triangular wave shape which is easily represented with just the DC component andthree, cosinusoidal terms of the expansion.for n=1:100tn(n)=n/10;t=n/10;y1=cos(t);y2=(1/9)*cos(3*t);y3=(1/25)*cos(5*t);factor=4/(pi*pi);y(n)=0.5- factor*(y1+y2+y3);end plot(tn,y)