Difference Between Power Spectrum and Power Spectral Density

Science

Do you know the differences between the absolute values of the Discrete Fourier Transform (DFT) results \(|c_k|\), the power spectrum (PS), and the power spectral density (PSD)? In this article, we aim to help you understand the distinctions among these three and how to appropriately use them.

スポンサーリンク

Conclusion:When analyzing stationary signals, use DFT results or the PS. For analyzing stochastic processes, create plots of the PSD.

To illustrate the differences, we will compute and compare the absolute values of the Fourier series, power spectrum, and power spectral density for the following two time series over different durations \(T_1=10 \, \mathrm{s}, T_2=100 \, \mathrm{s}\)

\[x_1 = 2\sin(2\pi t)\]

\[x_2 = 2\sin(2\pi t) + \zeta,\]

where \(\zeta\) is a random number following a normal distribution with mean 0 and variance 1.

The time series are sampled at 100 Hz, meaning that for \(T=10 \, \mathrm{s}\), we have \(N=1000\) data points.

スポンサーリンク

Definition of the Discrete Fourier Transform

First, we define the DFT used in this article (consistent with the definition used in MATLAB’s fft function):

\[X(k) = \sum_{n=1}^N x(n) \exp(-\frac{2\pi i}{N}(n-1)(k-1))\]

Here, \(n\) represents discrete time steps, and \(k\) represents discrete frequencies, with the relationships \(t = n \Delta t\) and \(f = k \Delta f\).

From this definition, it is evident that \(X(k)\) grows larger as the length \(N\) of the time series increases. To account for the effect of \(N\), it is better to normalize by \(N\) and use the complex Fourier coefficients \(c_k = X(k)/N\) for plotting. Hence, we will use \(c_k\)​ in the visualizations in this article.

Differences Between the Absolute Values of \(c_k\)​, PS, and PSD

The Meaning of Each Value (Y-axis)

For a sine wave with an amplitude of 2 m and frequency of 1 Hz \(x_1)\), we computed the FFT and plotted \(|c_k|\), PS, and PSD. As shown in the figures, all three exhibit a peak at \(
10^0 = 1 \, \mathrm{Hz}\). However, their peak heights differ:

  • \(∣ck​∣\) corresponds to the absolute value of the Fourier coefficients and directly reflects the signal’s amplitude. In this case, the peak is \(2 \, \mathrm{m}\).
  • The power spectrum (PS) is given by \(|c_k|^2\), so the peak value becomes \(2^2 = 4 \, \mathrm{m^2}\).
  • The power spectral density (PSD) is defined as \(|c_k|^2 / \Delta f\), where \(\Delta f = 1/T\) is the frequency resolution determined by the time series length \(T\).

Supplementary Explanation (Optional Reading)Using \(X(k)\), PSD can also be written as:

\[
\frac{|c_k|^2}{\Delta f} = \frac{|X(k)/N|^2}{\Delta f} = \frac{|X(k)|^2}{N^2 \Delta f} = \Delta t^2 \frac{|X(k)|^2}{T}
\]

Here, \(\Delta t = T/N\) and \(\Delta f = 1/T\). This formulation highlights the difference in normalization conventions for \(X(k)\). For instance, the <i>Spectral Analysis Handbook</i> (p.28) defines \(X(k)\) with a \(\Delta t\) factor, written as \(X'(k) = \Delta t X(k)\), leading to PSD being expressed as \(|X'(k)|^2 / T\).


Why Calculate PSD Instead of PS?

While PS or \(|c_k|\) seems easier to understand, PSD serves a distinct purpose: analyzing signals that derive meaning from their values over a range of frequencies (e.g., white noise). When Fourier transforming white noise, all frequency components exhibit equal power. Thus, the PSD characterizes the frequency-domain properties of such stochastic processes.

For instance, we add white Gaussian noise to the sine wave and examine how \(|c_k|\), PS, and PSD are affected.

Effects of Noise

Adding noise introduces power across frequencies other than the sine wave’s fundamental frequency of 1 Hz, consistent with the nature of white noise. However, the baseline heights for \(|c_k|\), PS, and PSD differ, with PS appearing smaller. Importantly, only PSD remains unaffected by changes in the time series length \(T\), as shown below.

Effects of Time Series Length

For the noisy signal, we calculated \(|c_k|\), PS, and PSD for \(T=10 \, \mathrm{s}\) (black line) and \(T=100 \, \mathrm{s}\) (red line). While the baselines for \(|c_k|\) and PS change with \(T\), the PSD remains consistent. This implies that PS requires knowledge of \(T\) to interpret results, while PSD does not.

Conversely, for the 1 Hz peak, \(|c_k|\) and PS are invariant with respect to \(T\), but PSD increases with longer \(T\). Therefore, PSD alone cannot directly indicate the sine wave’s amplitude.

Summary: Use PS for Stationary Signals, PSD for Stochastic Processes

For example, in the case of the signal below, plot PS when discussing the sine wave (stationary signal) and PSD when focusing on the noise characteristics (stochastic process).

Update History

  • 2021/03/08: Updated content for accuracy based on reader feedback.
  • 2022/09/06: Added supplementary explanation regarding the PSD formula.

コメント

Copied title and URL