# 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=3$ and $N=16$. This signal has the following samples:

$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/2$ samples (from $N/2$ to $N-1$) are the same as the samples from $-N/2$ to $-1$. These are actually $N/2$ samples to the left of zero.
• In this kind of setup, the signal above is simply a right shift of the sequence below:

$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:

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

## Phase plot

The phase plot of $x_0[n]$ above should be $0$ due to symmetry around zero. However, $x_1[n]$ is a right circular shift by $1$ of $x_0[n]$. Therefore, the phase at each bin for a shift of $n_0$ should become:

$\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=16$ and $n_0=1$, the phase at bin $k=1$ should be:

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

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

Get hands-on with 1200+ tech skills courses.