# The DFT shifting theorem

## Contents

# 6.2. The DFT shifting theorem#

We’ve seen that for signals \(x\) which are pure sinusoids at an analysis frequency of index \(\red{m}\), the corresponding DFT component \(\darkblue{X[m]}\) encodes the signal’s amplitude and phase as a single complex number.

But what can we say about phase for more general signals? In particular, if we have an arbitrary signal \(\blue{x}\) (not necessarily a sinusoid), what happens if we delay it?

Before we continue down this line of thought, we must first establish what it means to delay a signal under our periodicity assumption.
This leads us to the notion of a **circular shift**.

(Circular shifting)

Let \(\blue{x[n]}\) be a signal of \(N\) samples with DFT series \(\darkblue{X[m]}\), and define

to be the **circular shift** of \(\blue{x}\) by \(\red{d}\) samples.

When it is clear from context that shifting is circular, we may drop the “\(\mod N\)” notation and simply write \(\purple{y[n] = x[n-d]}\).

Circular shifting can seem like a strange thing to do: taking samples from the end of the signal and putting them at the beginning?

However, it is a natural consequence of combining our periodicity assumption with the definition of delay.

Indeed, it can lead to some strange behaviors if \(x[n]\) is discontinuous at the repetition boundaries.

Given this definition of shifting (delay), we can say the following about its effect on the DFT spectrum of a signal.

(DFT shifting)

Let \(\blue{x[n]}\) be a signal with DFT spectrum \(\darkblue{X[m]}\), and let \(\purple{y[n] = x[n-d]}\) be the circular shift of \(\blue{x}\) by \(\red{d}\) samples.

The DFT spectrum of \(\purple{y[n]}\) is given by:

This says that no matter what delay we use, it’s always possible to exactly predict the spectrum of the delayed signal from the spectrum of the input signal.

The proof of the shifting theorem is purely algebraic, and relies on the periodicity assumption of \(\blue{x}\) to allow a change of variables in the similarity calculation.

Proof. If we have an index \(n\), we will introduce a new variable \(k=n-d\), and equivalently, \(n=k+d\). In this case, \(n=0\) corresponds to \(k=-d\), and \(n=N-1\) corresponds to \(k=N-1-d\). Then we can calculate the DFT spectrum as follows

The last step follows because even though the summation ranges from \(k=-d\) to \(k=N-1-d\), it still computes the full DFT of \(x\), just in a different order.

## 6.2.1. What does this do?#

It’s worth taking some time to understand the shifting theorem. Not only does it say exactly how the spectrum changes, as a signal shifts in time, but the change itself is also interesting.

Note that the argument of the exponential is a purely imaginary number:

This means that multiplication implements a **rotation** of \(\darkblue{X[m]}\) in the complex plane.
Its phase can change, but the magnitude must be the same.

Of course, this is exactly what we would hope should happen: delay only changes the horizontal (time) position of a signal, not its amplitude.

A slightly more subtle point is that each DFT component \(\darkblue{X[m]}\) changes **by a different amount**: the rotation depends on both \(\red{m}\) and \(\red{d}\).

We can visualize the shifting theorem by examining what happens to each DFT component \(X[m]\) as a test signal is circularly shifted by different amounts.

Fig. 6.3 illustrates several key features of circular shifting.
First, observe that the different DFT components rotate at different *speeds* when the delay \(\red{d}\) changes.
For example, for each full cycle of the \(\red{m=1}\) component, the \(\red{m=2}\) component makes two cycles.
In each case, we can see that the magnitude of \(\darkblue{X[m]}\) is preserved, as the distance between \(\darkblue{X[m]}\) and the origin never changes.

Note also that the motion of each \(\darkblue{X[m]}\) is equal and opposite to that of \(\darkblue{X[N-m]}\) (eg, \(m=1\) and \(m=15\), \(m=2\) and \(m=14\), etc).
Relatedly, the components \(X[0]\) (the *DC component*) and \(X[N/2]\) (\(m=8\), the Nyquist component for \(N=16\)) do not seem to rotate at all.
In the first case, this is because the rotation is proportional to \(m=0\), so no rotation occurs.
In the second case, we see that it oscillates between positive and negative real values.
These observations are all instances of a general property of conjugate symmetry that we will investigate thoroughly in the next section.

## 6.2.2. What does this not do?#

The shifting theorem implies that if a signal is circularly shifted, its magnitude spectrum is unchanged:

However, the converse is **not true**: two signals with the same magnitude spectrum may not be related by a circular shift of one another.

Let \(\blue{x[n] = 1, 0, 0, 0, 0, \dots}\) denote an impulse with \(N\) samples, and let \(\purple{y = -x}\) denote its negation. As shown in the previous chapter, an impulse signal has spectrum \(\darkblue{X[m] = 1}\) for all \(m\). By DFT linearity, we also know that \(\purple{y= -x}\) implies \(\magenta{Y[m]} = \darkblue{-X[m]}\). As a result, we have that

so the two signals have the same magnitude spectrum. However, there is no delay \(\red{d}\) that turns \(\blue{x}\) into \(\purple{y}\).

Tip

Phase is important. Having the same magnitude spectrum is not enough to ensure that two signals are the same except for a phase shift.