amplitude of (signal) after FFT operation?
Afficher commentaires plus anciens
I have this code, I am suppose sin of amplitude 10 with frequency 200hz and sampling frequency 20000 hz and do FFT on this signal,
why the Amplitude after FFT is 1000?? where the amplitude must be stay 10
Fs = 20000;
t = 0:1/Fs:0.01;
fc1=200;
x = 10*sin(pi*fc1*t)
x=x';
xFFT = abs(fft(x));
xDFT_psd = abs(fft(x).^2);
1 commentaire
Ait m'barek Soufiane
le 2 Août 2017
Hi.. I have the same qst, did you find the answer?
Réponse acceptée
Plus de réponses (3)
You also have to be careful about how you design your frequency space sampling. In your current code, the frequency sampling interval is Fs/length(t)=99.5025 Hz. But the frequency you are trying to sample is at 100 Hz, so your Fourier Space sampling will never hit this. And, because the spectrum is sharply peaked, you can get significant errors with this deviation.
6 commentaires
Mary Jon
le 16 Nov 2014
The signal you've shown is 100 Hz. A 200 Hz sinewave would have fc1=400.
But I'm not sure you caught my point. The amplitude of the FFT result will depend not only on the sampling frequency Fs, but also the number of samples length(x). Below, for example, we see that the peak amplitude of xFFT is not really exactly 1000 until you drop one sample:
>> max( abs( fft(x) ) )
ans =
1.0023e+03
>> max( abs( fft(x(1:end-1)) ) )
ans =
1000
Mary Jon
le 26 Nov 2014
632541
le 21 Avr 2021
Hi Matt J,
That's true if the FFT is being used to compute Fourier Series coefficients. If the idea is to approximate a continuous Fourier Transform integral, the FFT needs to be scaled by the time sampling interval 1/Fs. If the idea is to preserve signal energy (Pareseval's theorem), the FFT needs to be normalized by 1/sqrt(N).
How do I decide which one to use ?
Frantz Bouchereau
le 29 Juil 2021
1 vote
There are various ways in which you can compute and plot true power spectrum or power spectral density in MATLAB (when I say 'true power spectrum' I mean that the output values correspond to actual power values).
1) If you want to compute the power spectrum without having to specify many parameters and want the function to choose the best parameters for you, you can use pspectrum. Calling the function without outputs will give you a plot with the computed power spectrum.
2) If you want to compute power spectrum or power spectral density and want full control over the window size, window overlap, window type, and number of FFT points, you can use the Welch periodogram pwelch function. Calling the function without outputs will give you a plot with the computed power spectrum.
3) If you want to just visualize the power spectrum, you can use the Signal Analyzer app. The app let's you visualize your signals simultaneously in the time, frequency, and time-frequency domains. You can zoom into signal regions of interest and analyze the spectra at those zoomed regions.
4) If you have split your signals into multiple signal frames you can use the Spectrum Analyzer scope.
Finally, here is a popular MATLAB doc page that explains the relationship between FFT and true power spectra: Power Spectral Density Estimates Using FFT.
Brince Babu
le 13 Nov 2020
0 votes
I need to sample a analog real time signal first like a sin wave and then how to do fft in real time such that I can get the magnitude and phase angle of each of the sample
1 commentaire
Guanjiang Chen
le 11 Mai 2021
this may be helpful.
Catégories
En savoir plus sur Digital Filter Analysis dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!