Parseval’s relation
The energy of a signal is the same whether computed in time or in frequency. From that equality come harmonic distortion, noise calculation and the idea that makes JPEG and MP3 possible.
01Energy does not depend on where you look at it
A signal has a certain energy. That energy can be computed by summing its square over time, or by summing the square of its spectrum over frequency, and the result is the same. That is Parseval’s relation:
And for periodic signals, where what makes sense is the average power, the version is even more convenient because the integral becomes a sum:
The absence of cross terms is a direct consequence of orthogonality: when you square the sum of harmonics, the products between different harmonics average to zero and only the squares survive. It is the same Pythagorean theorem, in infinitely many dimensions.
02How much energy each harmonic contributes
The practical use of Parseval is not to verify an equality: it is to be able to distribute the energy among the frequencies and ask how many are needed. The lab computes the two integrals, compares them, and shows the accumulation harmonic by harmonic.
The signal on top; below, the power of each harmonic and the cumulative total. See how many harmonics are needed to gather 99 %, and how that changes with the waveform.
03Harmonic distortion comes from here
If the total power is the sum of the powers of the harmonics, then you can ask what fraction is not in the fundamental. That is the total harmonic distortion:
A perfect amplifier delivers a pure sinusoid: all the power is in the fundamental and the THD is zero. Any nonlinearity distributes energy to the harmonics, and that percentage is what a distortion analyzer measures.
| Signal | THD | Comment |
|---|---|---|
| Ideal sinusoid | 0 % | All the power in the fundamental |
| Decent audio amplifier | < 0.1 % | The harmonics are 60 dB down |
| Triangular wave | 12 % | Its harmonics fall off as \( 1/n^2 \) |
| Square wave | 48.3 % | They fall off as \( 1/n \): there is a great deal outside |
The last row gives a number worth remembering because it serves as a reference: a square wave has a THD of 48.3 %, among the highest found in practice. If a distortion analyzer reads something close to that, the signal is completely clipped.
04Where else it is used
| Problem | How Parseval solves it |
|---|---|
| Noise at the output of a filter | The spectral density is integrated times \( |H(j\omega)|^2 \) instead of simulating in time |
| Occupied bandwidth | You look for the band that contains 99 % of the power |
| Choosing how many harmonics to compute | You stop when the cumulative total reaches the target |
| Signal-to-noise ratio | It is a ratio between two energies, and it can be measured in either of the two domains |
| Audio and image compression | The coefficients that contribute little energy are discarded |
The last row is a simple idea with enormous consequences. If most of the energy of a signal is in a few coefficients, storing only those preserves almost the entire signal. That is, in essence, what JPEG and MP3 do: transform, keep what has energy and throw away the rest.
How much you can trim depends on how the harmonics fall off. Those of a triangular wave fall off as \( 1/n^2 \), so their powers fall off as \( 1/n^4 \) and with three or four terms you already gather almost everything. Those of a square wave fall off as \( 1/n \), with powers as \( 1/n^2 \), and many more are needed. And a narrow pulse spreads the energy over a multitude of harmonics: that is why it occupies so much bandwidth.
05In the lab
For a square wave of amplitude 1, compute the power in time —which is 1— and sum \( \sum (4/n\pi)^2/2 \) for the first ten odd harmonics. Check that the sum approaches 1 and estimate how much is missing.
Using the spectrum analyzer, measure the amplitude of the first five harmonics at the output of an amplifier, compute the THD and compare it with the one indicated by the distortion analyzer. Repeat while raising the signal until it clips.
For a 1 μs pulse train at 10 kHz, determine how many harmonics are needed to gather 99 % of the power and what bandwidth they represent. Contrast with the rule \( B \approx 1/t_r \).
06Common mistakes
- Adding amplitudes instead of powers. Parseval sums squares; amplitudes are not added.
- Forgetting the \( 1/2\pi \) in the integral version, or carrying it along when working in hertz.
- Counting only one half of the spectrum. In the two-sided version the negative frequencies are included.
- Computing THD with a signal clipped by the instrument itself. You end up measuring the instrument.
- Assuming that a few harmonics are always enough. It depends on how quickly they fall off.
07Self-assessment
What does Parseval say, in one line?
That the energy computed in time and the energy computed in frequency are the same.
Why are there no cross terms between harmonics?
Because of orthogonality: the average of the product of two different harmonics is zero.
What is the THD of a square wave?
48.3 %. It is the reference value for a completely clipped signal.
Why does a triangular wave need fewer harmonics than a square wave?
Because its amplitudes fall off as \( 1/n^2 \) and its powers as \( 1/n^4 \): the cumulative total reaches 99 % much sooner.
How is the noise at the output of a filter calculated?
By integrating the noise spectral density multiplied by \( |H(j\omega)|^2 \) over the whole band.
How is Parseval related to JPEG?
It makes it possible to know which coefficients contribute little energy, so they can be discarded without it being too noticeable.
08Further reading
- Alan V. Oppenheim and Alan S. Willsky. Signals and Systems. 2nd ed. (Spanish edition, “Señales y sistemas”), Prentice Hall, 1997. Parseval in both versions, with the derivation from orthogonality.
- C. D. Motchenbacher and J. A. Connelly. Low-Noise Electronic System Design. Wiley, 1993. The calculation of total noise by integrating spectral density, which is Parseval applied every day.
- Adel S. Sedra and Kenneth C. Smith. Microelectronic Circuits. 7th ed. (Spanish edition, “Circuitos microelectrónicos”), Oxford University Press, 2015. Harmonic distortion in amplifiers, with its measurement and its causes.