Library / Signal processing and digital filters / DSP-08
Signal processing and digital filters
Mean square from two-sided DFT coefficients
Mean-square value of the record from the magnitudes of all N unnormalised DFT bins, with DC retained.
- Ref
- DSP-08
- Rev
- v1
- Field
- Signal processing and digital filters
- Result
- ms [V²]
Parseval’s theorem for the unnormalised DFT states that Σ|x[n]|² = (1/N)Σ|X[k]|², so the mean square of the record is Σ|X[k]|²/N². Only the bin magnitudes matter. Keep the DC bin to include the mean, and use all N bins, including those above N/2.
Mean-square value of the record from the magnitudes of all N unnormalised DFT bins, with DC retained. This is Parseval’s theorem for this convention, and it has no sample-interval factor. Only the bin magnitudes matter.
Calculator
- RMS value, √(mean square)0.7071 V
- Power in the DC bin, |X₀|²/N²0 V²
- Power excluding the mean (variance)0.5 V²
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- The record has a mean square of 0.5 V², an RMS value of 0.7071 V.
- 0 % of the power is in the DC bin; the rest is the variance of the fluctuating part.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing (V²) | Local step | Change in result |
|---|---|---|---|---|---|---|
| |X0 Magnitude of bin 0 | 0 to 100 V | 0.5 | 625.5 | 625 | +10% | 0 % |
| |X1 Magnitude of bin 1 | 0 to 100 V | 0.25 | 625.3 | 625 | +10% | +10.5 % |
| |X2 Magnitude of bin 2 | 0 to 100 V | 0.5 | 625.5 | 625 | +10% | 0 % |
| |X3 Magnitude of bin 3 | 0 to 100 V | 0.25 | 625.3 | 625 | +10% | +10.5 % |
| N Number of bins | 1 to 8 | 0 | 1 | 1 | +1 | −36 % |
| |X4 Magnitude of bin 4 | 0 to 100 V | 0.5 | 0.5 | 0 | +10% | 0 % |
| |X5 Magnitude of bin 5 | 0 to 100 V | 0.5 | 0.5 | 0 | +10% | 0 % |
| |X6 Magnitude of bin 6 | 0 to 100 V | 0.5 | 0.5 | 0 | +10% | 0 % |
| |X7 Magnitude of bin 7 | 0 to 100 V | 0.5 | 0.5 | 0 | +10% | 0 % |
Sweep of Magnitude of bin 1
| Magnitude of bin 1 (V) | Mean square (V²) |
|---|---|
| 0 | 0.25 |
| 12.5 | 10.02 |
| 25 | 39.31 |
| 37.5 | 88.14 |
| 50 | 156.5 |
| 62.5 | 244.4 |
| 75 | 351.8 |
| 87.5 | 478.8 |
| 100 | 625.3 |
Sweep one variable
Variables and how each one contributes
Mean square
What the equation gives you. Everything else feeds it.
Number of bins
The number of bins, up to 8. Divides the squared sum by N², so more bins for the same magnitudes means a lower mean square. Raising it by 10 % (to 4.4) moves the result by +0 %, from 0.5 to 0.5 V².
Magnitude of bin 0
The magnitude of bin 0, in V. Adds its square to the total. Raising it by 10 % (to 0) moves the result by +0 %, from 0.5 to 0.5 V².
Magnitude of bin 1
The magnitude of bin 1, in V. Adds its square to the total. Raising it by 10 % (to 2.2) moves the result by +10.5 %, from 0.5 to 0.5525 V².
Magnitude of bin 2
The magnitude of bin 2, in V. Adds its square to the total. Raising it by 10 % (to 0) moves the result by +0 %, from 0.5 to 0.5 V².
Magnitude of bin 3
The magnitude of bin 3, in V. Adds its square to the total. Raising it by 10 % (to 2.2) moves the result by +10.5 %, from 0.5 to 0.5525 V².
Magnitude of bin 4
The magnitude of bin 4, in V. Adds its square to the total. Raising it by 10 % (to 0) moves the result by +0 %, from 0.5 to 0.5 V².
Magnitude of bin 5
The magnitude of bin 5, in V. Adds its square to the total. Raising it by 10 % (to 0) moves the result by +0 %, from 0.5 to 0.5 V².
Magnitude of bin 6
The magnitude of bin 6, in V. Adds its square to the total. Raising it by 10 % (to 0) moves the result by +0 %, from 0.5 to 0.5 V².
Magnitude of bin 7
The magnitude of bin 7, in V. Adds its square to the total. Raising it by 10 % (to 0) moves the result by +0 %, from 0.5 to 0.5 V².
Worked example with the values above
- Sum of squared magnitudes: 0² + 2² + 0² + 2² = 8 V².
- N² = 16.
- Mean square = 8 / 16 = 0.5 V².
Assumptions and limits
- Forward transform with a negative exponent and no scale factor; inverse transform divides by N.
- A record that is treated as one period of a periodic sequence, indexed from zero.
Common mistakes
- Mixing the forward and inverse sign conventions or the 1/N factor.
- Forgetting that DFT bins above N/2 stand for negative frequencies.
- Reading phase without noting the time origin of the record.
Statistics and uncertainty
The DFT relations here are exact for the stated conventions, so the only uncertainty is in the data. In floating point, results match direct summation to about 1e−15 relative for short records, and the main risk is a sign or scale-convention mismatch with another tool.
Where it is used
- Checking FFT output by direct summation on a short record.
- Understanding shifts, scaling and power conservation in the frequency domain.
Maths you need
- Complex exponential: e^{iθ} = cos θ + i sin θ
- DFT pair: forward without a scale factor, inverse divides by N
- Periodic extension: the DFT treats a record as repeating forever