About FFT of sine wave

125 vues (au cours des 30 derniers jours)
Roberto Zanaboni
Roberto Zanaboni le 2 Nov 2012
Dear Forum
i just do the FFt of a sine wave :
t=0:0.01:1; A=sin(2*pi*10*t);
The FFt is:
U=fft(A,200); plot(abs(U));
Question is why the amplitude of fft is 50 and not 1 (convolution betwen sine wave spectrum and rect spectrum 1*1*sincf
Many thanks
Roberto

Réponses (2)

Wayne King
Wayne King le 2 Nov 2012
Modifié(e) : Wayne King le 2 Nov 2012
It is because you have 101 points in your signal. Therefore the magnitude of the DFT at the frequency is going to be approximately N/2 where N is the number of points. If your sine wave had an amplitude other than 1, you would see NA/2
To make this exact, let's create your sine wave with 100 points so that the frequency of 10-Hz falls directly in a DFT bin
t = 0:0.01:1-0.01;
x = cos(2*pi*10*t);
xdft = fft(x);
plot(abs(xdft))
Now you see the magnitude at -100 and 100 Hz is 100/2=50
Change the amplitude of the sine wave:
x = 3*cos(2*pi*10*t);
xdft = fft(x);
plot(abs(xdft))
Now the magnitude at -100 and 100 Hz is (3N)/2=150
This dependence on N comes from the fact that the DFT sums all the element-by-element products of your signal and complex exponentials with frequencies of (kFs)/N where Fs is the sampling frequency and N is the length of the signal and k=0,1,2,3, N-1
When your signal matches the frequency of one of those complex exponentials exactly, as is the case above, you get the coherent sum that results in N times the amplitude. Since your input is a cosine remember that results in TWO complex exponentials each with amplitude 1/2 the amplitude of the cosine.

Merve Karabakla
Merve Karabakla le 5 Juin 2021
x = sin(2*pi*n*0.01) ( 0 n 200 )
What is its Fourier transform? Obtain and plot its magnitude spectrum

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by