Description of the problem
This article addresses how to calculate the Root Mean Square (RMS) value within the Fast Fourier Transform (FFT) module, specifically during Power Spectral Density (PSD) calculations. It outlines the algorithm used for determining the RMS value.
Description of the solution
- We calculate RMS as the sum of the squares of the amplitude spectrum:
sqrt(sum(X(f)^2))
Where X(f) is the spectrum of the signal.
- PSD is calculated as
S = X(f)^2/ ΔF
If the formula is converted to the integral to the
sum sqrt(sum(S * ΔF))
since we are dealing with discrete signals, this ΔF is truncated and you get exactly the same thing.
We calculate according to this formula, with a small difference which we have omitted for simplicity: in both our formulas (PDS and RMS) there is a correction factor due to the window.