Plancherel and Energy
The Fourier transform preserves energy: the total energy of a signal equals the total energy of its spectrum. This is Plancherel's theorem (Parseval's identity for transforms). It means is an energy density over frequency, which is how bandwidth, filters and noise are measured.
The theorem
More generally the transform preserves inner products, : it is a unitary operator, the continuous analogue of an orthogonal change of basis.
import numpy as np
dt = 0.001
t = np.arange(-30, 30, dt)
s = np.arange(-30, 30, 0.01)
def ft(f, freqs):
return np.array([np.sum(f * np.exp(-2j * np.pi * fr * t)) * dt for fr in freqs])
f = np.where(t >= 0, np.exp(-2 * np.clip(t, 0, None)), 0.0) # one-sided exponential, a = 2
E_time = np.sum(np.abs(f) ** 2) * dt
F = 1 / (2 + 2j * np.pi * s) # its known transform
E_freq = np.sum(np.abs(F) ** 2) * 0.01
print(f"energy in time: {E_time:.5f} (exact 1/(2a) = 0.25)")
print(f"energy in frequency: {E_freq:.5f}")energy in time: 0.25050 (exact 1/(2a) = 0.25)
energy in frequency: 0.24831
The frequency integral misses a little energy in the tails beyond , since this spectrum decays only like , and the time sum is slightly above 0.25 because the rectangle rule counts the jump at with its full height.
A surprising integral
Plancherel turns hard integrals into easy ones. Since and :
import numpy as np
for L in (10, 100, 1000):
s = np.linspace(-L, L, 400 * L + 1)
val = np.sum(np.sinc(s) ** 2) * (s[1] - s[0])
print(f"integral of sinc^2 over [-{L}, {L}]: {val:.6f}")integral of sinc^2 over [-10, 10]: 0.989873
integral of sinc^2 over [-100, 100]: 0.998987
integral of sinc^2 over [-1000, 1000]: 0.999899
The integral approaches 1; the tails beyond hold about .
Bandwidth as an energy fraction
A useful definition of bandwidth is the frequency range holding, say, 99 % of the energy. For a rectangular pulse of width 1, the main lobe holds about 90 %:
import numpy as np
s = np.linspace(-500, 500, 2_000_001)
ds = s[1] - s[0]
density = np.sinc(s) ** 2
total = np.sum(density) * ds
for B in (0.5, 1, 2, 10):
frac = np.sum(density[np.abs(s) < B]) * ds / total
print(f"|s| < {B:4}: {100 * frac:.2f} % of the energy")|s| < 0.5: 77.36 % of the energy
|s| < 1: 90.30 % of the energy
|s| < 2: 95.01 % of the energy
|s| < 10: 99.01 % of the energy
Sharp edges make the energy spread far: even misses about 1 %. Smooth pulses, such as Gaussians or raised cosines, concentrate their energy much better, which is why communication systems shape their pulses.
In software
- Power spectral densities (Power Spectra and Noise) are Plancherel applied to random signals;
scipy.signal.welchestimates them. - Energy conservation is a standard unit test for FFT code (with the right normalization,
norm="ortho").
Exercises
Exercise 1: Energy of a Gaussian
Compute (the energy of ) and check it with Plancherel.
Answer
.
Solution
(a Gaussian integral). The spectrum has the same energy, , as Plancherel demands.
Exercise 2: Energy of a filtered signal
A filter multiplies the spectrum by with . Can the output have more energy than the input?
Answer
No.
Solution
The output energy is , the input energy. A filter that never amplifies any frequency can only remove energy.
Exercise 3: Triangle energy (code)
Verify Plancherel for the triangle : compute and .
Answer
Both equal .
Solution
import numpy as np
t = np.linspace(-1, 1, 200001)
print(round(np.sum(np.clip(1 - np.abs(t), 0, None) ** 2) * (t[1] - t[0]), 6))
s = np.linspace(-200, 200, 4000001)
print(round(np.sum(np.sinc(s) ** 4) * (s[1] - s[0]), 6))0.666667
0.666667
Test yourself
Plancherel's theorem says the Fourier transform preserves…
- the maximum value
- energy (and inner products)
- the number of zeros
- the sign
is interpreted as…
- the phase
- an energy density over frequency
- the signal's derivative
- its average
Why does a rectangular pulse need a wide bandwidth for 99 % of its energy?
- it is too long
- its sharp edges make the spectrum decay slowly, like in energy
- it has no energy
- it is periodic