DFT Phase

Discover how the phase plot of a DFT is generated.

We'll cover the following

The magnitude plot is drawn by taking the absolute values of the complex DFT output. It might seem that the phase plot is not very useful. This is not true.

  • The magnitude plot tells us about the level of contribution in the signal from each participating sinusoid.
  • The phase plot tells us about the alignment of those sinusoids with respect to the origin.

Time shift

Let’s consider a rectangular signal in which L=3L=3 and N=16N=16. This signal has the following samples:

x1[n]={1index 0.1.1.0.0.0.0.0.0.0.0.0.0.0.0.0.}x_1[n]=\{\underbrace{1}_{\text{index}~0}. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.\}

Now recall the following two facts:

  • Due to DFT periodicity in both the input and output, the last N/2N/2 samples (from N/2N/2 to N1N-1) are the same as the samples from N/2-N/2 to 1-1. These are actually N/2N/2 samples to the left of zero.
  • In this kind of setup, the signal above is simply a right shift of the sequence below:

x0[n]={1index 0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.1.}x_0[n]=\{\underbrace{1}_{\text{index}~0}. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1.\}

From the two expressions above, we can write the following:

x1[n]=x0[(n1) mod 16]x_1[n]=x_0[(n-1)~\text{mod}~ 16]

Phase plot

The phase plot of x0[n]x_0[n] above should be 00 due to symmetry around zero. However, x1[n]x_1[n] is a right circular shift by 11 of x0[n]x_0[n]. Therefore, the phase at each bin for a shift of n0n_0 should become:

ϕk=2πkNn0\phi_k = -2\pi \frac{k}{N}n_0

We will derive this property of the DFT in the next chapter.

For the example above, where N=16N=16 and n0=1n_0=1, the phase at bin k=1k=1 should be:

ϕ1=2π116(1)180π=22.5\phi_1 = -2\pi \frac{1}{16}(1)\cdot \frac{180^\circ}{\pi}=-22.5^\circ

This is visible in the phase plot of x1[n]x_1[n] below. The second subplot is a zoomed-in version of the first.

Get hands-on with 1200+ tech skills courses.