Search for probability and statistics terms on Statlect
StatLect

Discrete Fourier transform - Spectra

by , PhD

The Discrete Fourier Transform of a vector (or signal) can be used to compute the so-called spectra, which help us to visualize the frequency components of the signal.

In this lecture we define and explain the amplitude, power and phase spectra.

Table of Contents

The transform

Let[eq1]

Remember that the Discrete Fourier Transform (DFT) of an $N	imes 1$ vector x is another $N	imes 1$ vector X whose entries satisfy[eq2]where i is the imaginary unit.

We can use the DFT to write the vector x as a linear combination of samples of periodic functions having different frequencies: [eq3]

The coefficients of the linear combination are the entries of the DFT divided by $N$.

The linear combination is called the frequency-domain representation of x.

Amplitude spectrum

The amplitude spectrum is a simple transformation of the DFT.

It is an $N	imes 1$ vector A whose entries are calculated as[eq4]

In other words, the amplitude spectrum is the vector that contains the absolute values (or moduli) of the coefficients of the frequency-domain representation of x.

It shows which frequencies contribute more to the magnitude of x.

As explained in the lecture on the DFT or real signals, if x is real, then the amplitude spectrum is symmetric around the Nyquist frequency $N/2$.

Example of amplitude spectrum

Here is an example of an amplitude spectrum.

Let $N=20$ and the entries of the vector x be defined by[eq5]

As it is customary for spectra, we display the amplitude spectrum of x as a stem plot.

Plot of the ampliude spectrum of a real signal with two frequencies.

As you can see, the spectrum is equal to zero everywhere, except at the frequencies:

The amplitudes are the absolute values of the coefficients of the frequency components ($-0.5$, 1, -$2$), but the latter two are halved because of the symmetry.

Power spectrum

The power spectrum $P$ is another $N	imes 1$ vector obtained from the DFT.

Its entries are equal to the squares of the entries of the amplitude spectrum:[eq8]

Phase spectrum

The phase spectrum shows the phases of the frequency components of x.

It is an $N	imes 1$ vector $arphi $ whose entries are calculated as[eq9]where [eq10] and [eq11] are the real and imaginary parts of $X_{k}$.

The function $QTR{rm}{atan2}$ is the 2-argument arctangent, which returns a value between $-pi $ and $pi $.

It is the same as the argument of a complex number, that is,[eq12]

Remember that[eq13]provided that [eq14] and $r>0$.

When [eq11] and [eq10] are both equal to zero (or, equivalently, $r=0$), the value of $QTR{rm}{atan2}$ (equivalently, of $rg $) is undefined. It can be set equal to 0, as we will do below, to make the phase spectrum easier to read.

Why is the phase spectrum defined in this way?

To understand why the phase spectrum is defined in this manner, consider a cosine wave:[eq17]where:

We assume that [eq14].

The Discrete Fourier Transform of x is[eq19]

This implies that the phase spectrum is[eq20]

Proof

We can write[eq21]The latter expression is the frequency-domain representation of $x_{j+1}$ as a linear combination of the DFT basis functions. Therefore, the coefficients of the linear combination inside the square brackets are the values of the discrete Fourier transform. All the coefficients are equal to 0, except those corresponding to the frequencies $l$ and $N-l$, which are equal to [eq22] and [eq23] respectively. Therefore, we have[eq24]and[eq25]

Example of phase spectrum

Here is an example of a phase spectrum.

Let $N=20$ and the entries of the vector x be defined by[eq26]

Plot of the phase spectrum of a real signal with two frequencies and non-zero phase shifts.

The phase spectrum is zero everywhere, except at the following frequencies:

How to cite

Please cite as:

Taboga, Marco (2021). "Discrete Fourier transform - Spectra", Lectures on matrix algebra. https://www.statlect.com/matrix-algebra/discrete-Fourier-transform-amplitude-power-phase-spectrum.

The books

Most of the learning materials found on this website are now available in a traditional textbook format.