Sampling frequency and FFT output ?
11 次查看(过去 30 天)
显示 更早的评论
What is the relationship between the fs (sampling frequency) and the amplitude of the FFT-function output in matlab? As the amplitude of the FFT output changes as the sampling frequency is changed.
0 个评论
采纳的回答
更多回答(2 个)
Wayne King
2012-10-12
编辑:Wayne King
2012-10-12
There is a relationship between length of the input signal and the FFT output, not the sampling rate.
Fs = 1000;
t1 = 0:0.001:1-0.001; % 1000 samples
t2 = 0:0.001:0.1-0.001; % 100 samples
x1 = cos(2*pi*100*t1);
x2 = cos(2*pi*100*t2);
xdft1 = fft(x1);
xdft2 = fft(x2);
subplot(211)
plot(abs(xdft1))
subplot(212)
plot(abs(xdft2))
However, if you compute the power spectral density, using something like periodogram(), then the sampling frequency will come into play in scaling the PSD estimate.
Of course, depending on how you sampled the signal (the length and sampling frequency), you may have situations where the frequency does not fall directly on a DFT bin, and the can affect the amplitude.
3 个评论
Matt J
2012-10-12
Fs is not used in Wayne's code apart from the first line, so if you only changed the first line, it's understandable that you would see no effect.
However, changing the amplitude of the input signles x1 and x2 can/will obviously affect the amplitude of the output because of the linearity of the FFT.
Wayne King
2012-10-12
编辑:Wayne King
2012-10-12
Obviously the amplitude depends on the amplitude. If you have a sine wave with amplitude A, then in the magnitude plot for the DFT (fft), you are going to get two lines with magnitude (N*A)/2 where N is the number of samples, and A is the amplitude.
t2 = 0:0.001:0.1-0.001;
x2 = 10*cos(2*pi*100*t2);
xdft2 = fft(x2);
% amplitude at -100 and 100 Hz will be (length(x2)*10)/2
plot(abs(xdft2))
The length of x2 is 100, the amplitude is 10, so the magnitude is predictably (10*100)/2. Again, that is not depending at all on the sampling frequency, it is only depending on the length and of course the amplitude.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!