FFT magnitude as a function of frequency resolution
8 views (last 30 days)
My learning research on FFTs has identified that (for example) with a FFT frequency resolution of 8 Hz, the scalar magnitude of the FFT spectral lines (computed as the abs() value of the complex numbers returned by the FFT function) should be higher than if a FFT frequency resolution of 4 Hz is used (twice the number of samples per FFT) on the same (IQ) sample data. I see evidence of this when using a Spectrum Analyser receiving broadcast FM signals and also in SDR software when doing the same (both when changing the RBW). But, when using the MatLab FFT function (on broadcast FM IQ data) the opposite is what I see - i.e the higher the FFT frequency resolution (lower number of samples per FFT), the lower the scalar magnitude of the FFT complex values. What I am I doing wrong / not understanding?
I discovered this when adding to my MatLab scripts to compute PSD - which, according to on-line sources, should be the FFT abs() value squared and DIVIDED by the FFT frequency resolution. However, I've found empirically that MULTIPLYING by the FFT frequency resolution is required to make the magnitudes similar for different FFT frequency resolutions. In generating this question,
Paul on 27 Mar 2022
Edited: Paul on 27 Mar 2022
Hi @Rob H,
For a question like this, it would be immensely helpful to provide some example data/code that illustrates the issue. Absent that, I'll provide an example and go from there.
Define a continuous-time function
syms t real
s = matlabFunction(triangularPulse(0,1,2,t));
Sample that signal over its non-zero interval with a sampling period of T1 = 0.2 and take the DFT
t1 = linspace(0,2,11); N1 = 11; n1 = 0:10; T1 = 0.2; F1 = 1/T1;
x1 = s(t1);
X1 = fft(x1);
Now do the same with a sampling period of T2 = 0.1.
t2 = linspace(0,2,21); N2 = 21; n2 = 0:20; T2 = 0.1; F2 = 1/T2;
x2 = s(t2);
X2 = fft(x2);
Plot the results
At 0 rad/sample, X2 = 2*X1 as expected. Other than that, I'm not sure how we an say there is any direct relatiionship between X1 and X2 wrt their sampling periods or sampling frequencies, the DFT samples don't even line up at the same frequencies.
However, such scaling by the sampling period (or equivalently by the inverse of the sampling frequency) would come into play if we want to use the DFT samples to estimate the CTFT of the original signal
syms w f real
S(w) = fourier(triangularPulse(0,1,2,t),t,w);
S(f) = S(2*sym(pi)*f);