FFT / DFT
Symbols
name |
alt |
symbol |
unit |
---|---|---|---|
sample rate |
sample frequency |
fs |
Hz or 1/s |
discretization quantity |
bin size |
Δt = 1/fs |
s |
samples |
N |
(no dimension) |
|
window length |
pts |
wl = T = N * Δt |
s |
N corresponds to time measured/recorded or used; for a sampling rate of 1024 Hz and different window length you get a corresponding time:
2048 pts @1024Hz = 2s = N/fs
1024 pts @1024Hz = 1s
1024 pts @0.0625 (16s) = 16384s
Definitions
time Domain |
symbol |
frequency domain |
symbol |
---|---|---|---|
sampling rate |
fs = 1/Δt |
(sampling) bandwidth |
bw = fs /2 |
samples |
N |
spectral lines |
N/2 + 1 (+1 == DC part) |
window length |
wl = T = N * Δt |
frequency resolution [Hz] (bandwith) |
\(Δf = \frac{bw}{N/2} = \frac{ f_s }{N}\) |
Warning
Almost everywhere the DC part (or N+1) is not included.
The FFTW returns the DC part as 1st element.
You need the DC part only for the inverse transform.
For MT and noise analysis you detrend the data (DC part is removed). And here only
you have the symmetry of (for example) 1024 real input and 512 (511 + real) complex output
The FFTW returns the Nyquist frequency (which is a real number) as last element. You
can not use the Nyquist frequency in your analysis.
Note
In the real world by selecting N samples = wl you already have a window length of T
The Nyquist frequency is \(f_s /2\) where a sine wave would be described with two points.
Additionally some digitizers or loggers use an anti alias filter at 80% of the Nyquist frequency.
So at 1024 Hz sample rate the cut off could be 0.8 * 512 = 410 Hz.
As a good choice for data interpretation a limit of \(f_s / 4\) can be used
weiter
Power Spectral Density (PSD)
When you change the bandwidth the amplitude also changes.
For a sample rate of 1024 we use 1024 samples and 4096 samples, according to 1 s and 4 s data.
The bin size in the frequency domain has changed now \(Δf = \frac{bw}{N/2}\) == 1 Hz and 0.25 Hz
frequency resolution, respectively bin sizes. So each bin or bucket of the 4096 window contain 4 times less data.
On https://community.sw.siemens.com/s/article/what-is-a-power-spectral-density-psd you find a genius picture for that:
Warning
Almost everywhere people are playing with sine waves.
In MT we have broad band noise and must scale the FFT. You want to process data with different window length but get the same amplitudes independently from the window length.