Parseval’s theorem, also known as Plancherel’s theorem or Rayleigh’s energy theorem, is a fundamental result in Fourier analysis and signal processing. It relates the energy (or power) of a function (or signal) to the energy (or power) of its Fourier transform. In essence, it states that the total energy remains the same whether you calculate it in the time domain or in the frequency domain.
Basic definitions
Time domain & frequency domain
A discrete-time signal is represented in time domain as a function of time, denoted as \(x(t)\). In the frequency domain, the signal is represented as a function of frequency, obtained by taking the Discrete-Time Fourier transform (DTFT) of the time-domain signal, denoted as \(X[e^{j \omega}]\).
Energy of a signal
For discrete-time signals, the energy is defined as:
Interpretation of Parseval’s theorem for discrete-time signals
For a discrete-time signal \(x[n]\) and its Discrete-Time Fourier Transform (DTFT) \(X(e^{j \omega})\) , Parseval’s theorem states:
Parseval’s theorem implies that the total energy of a signal calculated in the time domain is equal to the total energy calculated in the frequency domain (up to a scaling factor). The scaling factor \(\frac{1}{2 \pi}\) arises due to the definition of the Fourier transform and the units of frequency.
Discrete Fourier Transform (DFT) Version
Suppose if the \(x[n]\) is a discrete-time sequence of complex numbers of length N : \(x_n = \{x_0, x_1, \cdots, x_{N-1}\}\), its N-point discrete Fourier transform (DFT) 1: \(X_k = \{x_0, x_1, x_{N-1}\}\) is given by
The inverse discrete Fourier transform is given by
Suppose if \(x[n]\) and \(y[n]\) are two such sequences that follows the above definitions, the Parseval’s theorem is written as
where, \(\ast\) indicates conjugate operation.
Deriving Parseval’s theorem
If \(x[n] = y[n]\), then
Time-domain and frequency domain representations are equivalent manifestations of the same signal. Therefore, the energy of the signal computed from time domain samples must be equal to the total energy computed from frequency domain representation.
Python code
Let’s verify Parseval’s Theorem with a simple discrete-time signal example. Here, a basic signal and its DFT are considered and it is shown that the energy calculated in both domains is the same (up to the scaling factor).
import numpy as np
x = np.array([1, 2, 1, 0])
# Time Domain Energy
energy_time = np.sum(np.abs(x)**2)
print(f"Energy in time domain: {energy_time}")
# DFT
X = np.fft.fft(x)
# Frequency Domain Energy
energy_frequency = (1/len(x)) * np.sum(np.abs(X)**2)
print(f"Energy in frequency domain: {energy_frequency}")
Code output
Energy in time domain: 6.0
Energy in frequency domain: 6.0
This example clearly shows how Parseval’s Theorem holds true. The total “energy” of the signal remains the same whether you calculate it from the original signal values or from its frequency components.