Sawtooth wave, using complex fourier transform find first 7 harmonic

There is a sawtooth wave with period T=1s and equation x(t)=t in the interval 0<=t<=T . Using the complex form of fourier transform , define the real amplitudes of the first 7 harmonic, without finding the phases. Could anyone help me do this in matlab ?

 Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 29 Mai 2017
Bearbeitet: Andrei Bobrov am 29 Mai 2017
N = 512;
u = linspace(0,1,N+1);
U = fft(u(1:end-1))'/N;
U_0_7 = U(1:8);
U_0_7(2:end) = U_0_7(2:end)*2;
U_0_7 = [abs(U_0_7), angle(U_0_7)];

1 Kommentar

I am pretty bad at matlab. Where exactly do i put the code. I got this scheme for sawtooth waves

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by