Consider the following triangle wave:
f(x) = {
0 x < -1
1 - |x| |x| ≤ 1
0 1 < x
}
Compute the Fourier series by hand for the domain -2 ≤ x < 2. In Matlab, plot the mode coefficients an and bn for the first 100 cosine and sine modes (i.e. for the first n = 1 to n = 100). Also, plot the approximation using n = 10 modes on top of the true triangle wave.
In a few sentences, explain the difference between the Fourier transform and the Fourier series.