I am extracting Heart Rate Variable (HRV) frequency domain features, e.g. LF, HF, using FFT. Currently, I have found out that LF and HF values in longer sequence length, e.g. 3 minutes, will be larger than shorter sequence length, e.g. 30 seconds. I wonder if this is a common observation or there are some bugs in my execution codes? Thanks in advance
3 Answers
Yes, the frequency in each bin depends on N
, the sequence length.
See this related answer: https://stackoverflow.com/a/4371627/119527

- 1
- 1

- 132,704
- 33
- 254
- 328
An FFT by itself is a dimensionless basis transform. But if you know the sample rate (Fs) of the input data and the length (N) of the FFT, then the center frequency represented by each FFT result element or result bin is bin_index * (Fs/N).
Normally (with baseband sampling) the resulting range is from 0 (DC) up to Fs/2 (for strictly real input the rest of the FFT results are just a complex conjugate mirroring of the first half).
Added: Also many forward FFT implementations (but not all) are energy preserving. Since a longer signal of the same amplitude input into a longer FFT contains more total energy, the FFT result energy will also be greater by the same proportion, either by bin magnitude for sufficiently narrow-band components, and/or by distribution into more bins.

- 70,107
- 14
- 90
- 153
What you are observing is to be expected, at least with most common FFT implementations. Typically there is a scale factor of N
in the forward direction and 1
in the reverse direction, so you need to scale the output of the FFT bins by a factor of 1/N
if you are interested in calculating spectral energy (or power).
Note however that these scale factor are just a convention, e.g. some implementations have a sqrt(N)
scale factor in both forward and reverse directions, so you need to check the documentation for your FFT library to be absolutely certain.

- 208,748
- 37
- 389
- 560