Jag1972
- 40
- 0
Hello,
I have a problem synthesising the complex Fourier series using Matlab. The time domain periodic function is:
-1, -1.0 ≤ t < -0.5
1 , -0.5≤ t <0.5
-1, 0.5 ≤ t < 1
The single non zero coefficient is: Cn = \frac{2}{\pi n}, Co is 0 (average is 0).
f(t)= \sum Cn e^{jnwt} (limits are -∞ to ∞, could not find the latex symbol)
This makes:
f(t) = (\frac{2}{\pi} e^{jwt} - \frac{2}{\pi*3} e^{j3wt} + \frac{2}{\pi*5} e^{j5wt} -... \frac{2}{\pi*∞} e^{j∞wt}) + (\frac{2}{\pi} e^{-jwt} - \frac{2}{\pi*3} e^{-j3wt} + \frac{2}{\pi*5} e^{-j5wt} -... \frac{2}{\pi*∞} e^{j-∞wt})
In order to enter this in Matlab I have combined the exponential terms to obtain cosine waves.
For example when n=1 and n=-1.
\frac{2}{\pi} e^{jwt} + \frac{2}{\pi} e^{-jwt}
\frac{2}{\pi}( e^{jwt} + e^{-jwt})
\frac{4}{\pi}( \frac{e^{jwt}+e^{-jwt}}{2})
\frac{4}{\pi}( cos wt)
when n=2 and n=-2.
\frac{-4}{\pi*3}( cos 3wt)
So I end up with cosine terms which only exist for odd multiples of 'n' and the '+' and '-' sign alternates.
When I enter this in Matlab I can not recreate my time domain signal. Could someone please offer me some advice on where I have gone wrong.
Jag.
I have a problem synthesising the complex Fourier series using Matlab. The time domain periodic function is:
-1, -1.0 ≤ t < -0.5
1 , -0.5≤ t <0.5
-1, 0.5 ≤ t < 1
The single non zero coefficient is: Cn = \frac{2}{\pi n}, Co is 0 (average is 0).
f(t)= \sum Cn e^{jnwt} (limits are -∞ to ∞, could not find the latex symbol)
This makes:
f(t) = (\frac{2}{\pi} e^{jwt} - \frac{2}{\pi*3} e^{j3wt} + \frac{2}{\pi*5} e^{j5wt} -... \frac{2}{\pi*∞} e^{j∞wt}) + (\frac{2}{\pi} e^{-jwt} - \frac{2}{\pi*3} e^{-j3wt} + \frac{2}{\pi*5} e^{-j5wt} -... \frac{2}{\pi*∞} e^{j-∞wt})
In order to enter this in Matlab I have combined the exponential terms to obtain cosine waves.
For example when n=1 and n=-1.
\frac{2}{\pi} e^{jwt} + \frac{2}{\pi} e^{-jwt}
\frac{2}{\pi}( e^{jwt} + e^{-jwt})
\frac{4}{\pi}( \frac{e^{jwt}+e^{-jwt}}{2})
\frac{4}{\pi}( cos wt)
when n=2 and n=-2.
\frac{-4}{\pi*3}( cos 3wt)
So I end up with cosine terms which only exist for odd multiples of 'n' and the '+' and '-' sign alternates.
When I enter this in Matlab I can not recreate my time domain signal. Could someone please offer me some advice on where I have gone wrong.
Jag.