About FFT of sine wave
131 views (last 30 days)
Show older comments
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
0 Comments
Answers (2)
Wayne King
on 2 Nov 2012
Edited: Wayne King
on 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.
0 Comments
Merve Karabakla
on 5 Jun 2021
x = sin(2*pi*n*0.01) ( 0 ≤ n ≤ 200 )
What is its Fourier transform? Obtain and plot its magnitude spectrum
0 Comments
See Also
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!