Skip to content

Properties of the DFT

Shift a sequence round a ring and watch each DFT bin turn without changing size; mirror it to conjugate the DFT; meet circular convolution.

Before this13.2 · 5 more
Chapter 13 · Lesson 3 of 6

First, the picture

Eight samples shifted round a ring, one dial per DFT bin. Guess first: if no sample is lost, what happens to each bin’s size?

Shift the repetition, turn every bin

N = 8, x = 5, 4, 3, 2, 1, 0, 0, 0. The faint copies are 13.1's repetition.

No shift. Every dial points right: nothing turned yet.

shift n₀
0
bin 1 turned by
0°
0.00 / 14.00 s
Describe this picture

Two panels for N=8N=8 and x=5,4,3,2,1,0,0,0x=5,4,3,2,1,0,0,0. The first plots xx against the sample nn as stems with filled-dot heads, inside a shaded box labelled “one period, n = 0 to 7”; the faint open circles outside the box are 13.1’s repetition. The second holds eight small dials, labelled “k = 0” to “k = 7”, showing the turn of each bin, with the size ∣X[k]∣\lvert X[k]\rvert under each dial. The readouts are the shift n0n_0 and how far bin 1 has turned.

The clip plays once, over 14 s. It starts with no shift and every dial pointing right. Then the repetition slides one place at a time and holds at n0=1n_0=1, 2 and 4, while the caption says how far each dial has turned. The readout for bin 1 reads 0°, −45°, −90° and −180° at the four holds, and the sizes under the dials never change. Once the clip has finished, dragging the stems sideways, or the arrow keys, chooses n0n_0 from 0 to 7, through a control named “Shift n₀”; at n0=3n_0=3 the caption reads “n₀ = 3: bin 1 has turned −135°; bin k turns by −45° × k × n₀.”

Shifting on a ring

The DFT (13.2) gave me NN numbers X[k]X[k] for NN samples x[n]x[n]. The reason those numbers describe a repetition is in Sampling the spectrum (13.1): sampling the spectrum at Ωk=2πk/N\Omega_k=2\pi k/N repeats the signal every NN samples. So every operation in time happens to that repetition, and I read the result on n=0n=0 to N−1N-1. This page asks what each operation does to the bins.

I need one new piece of notation. The expression n mod Nn\bmod N is the remainder after dividing nn by NN, so it always lands in 00 to N−1N-1. For N=8N=8, 9 mod 8=19\bmod 8=1 and (−1) mod 8=7(-1)\bmod 8=7. Walking off one end of the sequence brings you back in at the other end, which is why I call the NN positions a ring.

Circular shift by n0n_0 is x[(n−n0) mod N]x[(n-n_0)\bmod N]. It is 13.1’s repetition moved n0n_0 places later and read on 00 to N−1N-1. Samples that leave at n=N−1n=N-1 come back in at n=0n=0. The word “later” is as in Shifting, reversing and scaling time (2.1): a delay.

The picture at the top of the page shifts x=5,4,3,2,1,0,0,0x=5,4,3,2,1,0,0,0 this way, with N=8N=8. At n0=1n_0=1 every sample moves one place later, and the last one (a 0) comes round to n=0n=0. Dial 1 has turned −45° and dial 2 −90°: bin kk turns by −45° × kk, so dial kk turns kk times as fast as dial 1.

At n0=2n_0=2 dial 1 is at −90° and dial 2 at −180°, and the sizes under the dials have not changed. At n0=4n_0=4 the 1 that sat at n=4n=4 has wrapped round to n=0n=0. Dial 1 has turned half a turn, and dial kk kk half turns. A circular shift turns bin kk by −2πkn0/N-2\pi kn_0/N and leaves its size alone.

When the clip ends, you can drag the stems sideways to choose n0n_0 from 0 to 7. At n0=3n_0=3 bin 1 has turned −135°, which is −45° × kk × n0n_0. Try n0=3n_0=3 and then n0=7n_0=7, and watch the sizes under the dials stay put.

Why the sizes stay and the bins turn

The proof takes three lines. The DFT of the shifted sequence is

∑n=0N−1x[(n−n0) mod N] e−j2πkn/N.\sum_{n=0}^{N-1}x[(n-n_0)\bmod N]\,e^{-j2\pi kn/N}.

Write m=(n−n0) mod Nm=(n-n_0)\bmod N. Then nn and m+n0m+n_0 differ by a multiple of NN, and e−j2πkn/Ne^{-j2\pi kn/N} repeats every NN in nn, so I can replace nn by m+n0m+n_0. As nn runs over 00 to N−1N-1, so does mm, and the sum becomes

e−j2πkn0/N∑m=0N−1x[m] e−j2πkm/N=e−j2πkn0/N X[k].\begin{aligned} &e^{-j2\pi kn_0/N}\sum_{m=0}^{N-1}x[m]\,e^{-j2\pi km/N}\\ &\quad=e^{-j2\pi kn_0/N}\,X[k]. \end{aligned}

This is Properties of the DTFT (12.3) with the delay rule e−jΩn0e^{-j\Omega n_0} read at Ωk=2πk/N\Omega_k=2\pi k/N. The factor has size 1, so ∣X[k]∣\lvert X[k]\rvert is unchanged, and it turns bin kk by −2πkn0/N-2\pi kn_0/N. For N=8N=8 that is −45° × kk × n0n_0, which is what the dials showed.

Circular reversal is x[(−n) mod N]x[(-n)\bmod N]. The sample x[0]x[0] stays, x[1]x[1] and x[N−1]x[N-1] swap, x[2]x[2] and x[N−2]x[N-2] swap, and so on. For N=8N=8 and x=4,3,2,1,0,0,0,0x=4,3,2,1,0,0,0,0, the reversed sequence is 4,0,0,0,0,1,2,34,0,0,0,0,1,2,3. The same substitution as above, with m=(−n) mod Nm=(-n)\bmod N, shows that the DFT of the reversed sequence is X[(−k) mod N]X[(-k)\bmod N]. For a real sequence, bin N−kN-k is the conjugate of bin kk (The DFT, 13.2), so this is X∗[k]X^*[k].

Mirror on the ring

Reversal turns X[k]X[k] into its conjugate when xx is real. A conjugate keeps the real part and flips the sign of the imaginary part (Complex numbers for signals, 3.3). Now think about a sequence that equals its own reversal. Its DFT would have to equal its own conjugate. What kind of number does that? Watch the hatched bars, the imaginary parts, as the clip ends.

Mirror on the ring

Circular reversal x[(−n) mod 8] keeps x[0] and mirrors the rest. Bars: real and imaginary parts of X[k].

x = 4, 3, 2, 1, 0, 0, 0, 0 and its DFT: real parts solid, imaginary parts hatched.

showing
x
largest |Im X[k]|
4.83
0.00 / 13.00 s
Describe this picture

Three stacked panels and no control. The first plots the sequence against the sample nn as stems with dot heads. The second plots the real parts Re X[k]\mathrm{Re}\,X[k] against the bin kk as solid bars, and the third the imaginary parts Im X[k]\mathrm{Im}\,X[k] as hatched bars. The readouts say which sequence is showing and the largest ∣Im X[k]∣\lvert\mathrm{Im}\,X[k]\rvert.

The clip starts on x=4,3,2,1,0,0,0,0x=4,3,2,1,0,0,0,0, whose largest imaginary bar is 4.83 tall. Small arcs swap the samples at nn and 8−n8-n, and the imaginary bars flip to their negatives; the readout says “x reversed”, and the largest imaginary bar is still 4.83. Then the sequence morphs into the average of xx and its reversal, and the clip ends with the readout “circular-even part” and the largest imaginary bar at 0.00. The caption is blank while the picture moves.

Reversed on the ring, 4 stays at n=0n=0, and 3, 2, 1 now sit at n=7n=7, 6, 5. The real parts are unchanged and the imaginary parts flip sign: X[k]X[k] becomes X∗[k]X^*[k]. Then the average of xx and its mirror equals its own reversal, and all its imaginary parts are 0. A real sequence that equals its own reversal has a real DFT.

A sequence with x[(−n) mod N]=x[n]x[(-n)\bmod N]=x[n] is circular-even. One with x[(−n) mod N]=−x[n]x[(-n)\bmod N]=-x[n] is circular-odd. The mirror is about n=0n=0, so x[0]x[0] is its own partner, and for even NN so is x[N/2]x[N/2]. Any real sequence splits into the two, as in Decomposing signals (2.3): xe=12(x+xrev)x_e=\tfrac12(x+x_\text{rev}) and xo=12(x−xrev)x_o=\tfrac12(x-x_\text{rev}). Their DFTs are 12(X+X∗)=Re X[k]\tfrac12(X+X^*)=\mathrm{Re}\,X[k] and 12(X−X∗)=j Im X[k]\tfrac12(X-X^*)=j\,\mathrm{Im}\,X[k]. The clip showed the first. Its odd partner is 0,1.5,1,0.5,0,−0.5,−1,−1.50,1.5,1,0.5,0,-0.5,-1,-1.5, and its DFT is the imaginary part.

even x[n]Re X[k]0401601234567sample n01234567bin kodd x[n]Im X[k]03−309.66−9.6601234567sample n01234567bin k
Fig. Circular-even (x[(−n) mod 8] = x[n]) gives a real DFT; circular-odd (x[(−n) mod 8] = −x[n]) gives an imaginary one. The mirror is about n = 0 on the ring, so x[0] and x[4] are their own partners.

The figure uses N=8N=8 and shows both cases at full size. The even sequence 4,3,2,1,0,1,2,34,3,2,1,0,1,2,3 has the DFT 1616, 6.836.83, 00, 1.171.17, 00, 1.171.17, 00, 6.836.83, with no imaginary part. The odd sequence 0,3,2,1,0,−1,−2,−30,3,2,1,0,-1,-2,-3 has an imaginary DFT, 00, −9.66j-9.66j, −4j-4j, −1.66j-1.66j, 00, 1.66j1.66j, 4j4j, 9.66j9.66j, with no real part.

Circular convolution

Convolution in Discrete convolution (5.2) flipped one sequence and slid it along the other. On a ring I do the same, but positions wrap. The circular convolution of two sequences of length NN is

(x⊛Nh)[n]=∑m=0N−1x[m] h[(n−m) mod N].(x\circledast_N h)[n]=\sum_{m=0}^{N-1}x[m]\,h[(n-m)\bmod N].

Its rule is the one I wanted from the start:

x⊛Nh ⟷ X[k] H[k].x\circledast_N h\ \longleftrightarrow\ X[k]\,H[k].

The proof uses the shift rule. Multiply X[k]X[k] by H[k]H[k] term by term:

X[k]H[k]=∑m=0N−1x[m] (e−j2πkm/NH[k]).X[k]H[k]=\sum_{m=0}^{N-1}x[m]\,\bigl(e^{-j2\pi km/N}H[k]\bigr).

The bracket is the DFT of hh shifted circularly by mm. So the sum is the DFT of ∑mx[m] h[(n−m) mod N]\sum_m x[m]\,h[(n-m)\bmod N], which is the circular convolution. Inverting gives the rule in the other direction. Circular vs linear convolution (13.4) shows the wrap-around as a picture, and when the result equals the ordinary convolution.

Here is a small case with N=4N=4. Take x=1,2,3,4x=1,2,3,4 and h=1,1,1,0h=1,1,1,0. Their DFTs are X=10, −2+2j, −2, −2−2jX=10,\,-2+2j,\,-2,\,-2-2j and H=3, −j, 1, jH=3,\,-j,\,1,\,j. The products are 30, 2+2j, −2, 2−2j30,\,2+2j,\,-2,\,2-2j, and the inverse DFT of those is 8,7,6,98,7,6,9. The sum directly gives the same: at n=0n=0 it is x[0]h[0]+x[1]h[3]+x[2]h[2]+x[3]h[1]=1+0+3+4=8x[0]h[0]+x[1]h[3]+x[2]h[2]+x[3]h[1]=1+0+3+4=8.

The ordinary convolution of the same two sequences is 1,3,6,9,7,41,3,6,9,7,4. The last two values, 7 and 4, wrapped round onto the first two, 1+7=81+7=8 and 3+4=73+4=7.

The same two rules, swapped

Multiplying in time gives a circular convolution in frequency, with a factor 1N\tfrac1N: x[n]h[n]↔1N(X⊛NH)[k]x[n]h[n]\leftrightarrow\tfrac1N(X\circledast_N H)[k]. Multiplying by ej2πk0n/Ne^{j2\pi k_0n/N} shifts the spectrum, X[(k−k0) mod N]X[(k-k_0)\bmod N]. Both are the shift and convolution rules read from the other side. That is duality: applying the DFT twice gives

DFT{X}[n]=N x[(−n) mod N].\mathrm{DFT}\{X\}[n]=N\,x[(-n)\bmod N].

The reason is the inverse formula x[m]=1N∑kX[k]ej2πkm/Nx[m]=\tfrac1N\sum_kX[k]e^{j2\pi km/N} evaluated at m=−nm=-n. For x=4,3,2,1,0,0,0,0x=4,3,2,1,0,0,0,0 the DFT of its DFT is 8×(4,0,0,0,0,1,2,3)8\times(4,0,0,0,0,1,2,3), that is 32,0,0,0,0,8,16,2432,0,0,0,0,8,16,24.

Where you’ll meet this

The maths behind it · permutation matrices

A circular shift is a permutation matrix: the identity with its columns rotated. In the DFT’s description it becomes a diagonal matrix of turns e−j2πkn0/Ne^{-j2\pi kn_0/N}. That is the first sign that the DFT diagonalises shifts, which The DFT as a matrix (13.5) develops.

The maths behind it · circular autocorrelation

Circular lags are what a circular (wrap-around) autocorrelation uses. It is quick to compute with the DFT, but it mixes the end of a record into its start. That is why Correlation (24.3) pads first.

The even and odd rules return in The discrete cosine transform (13.6), where the choice of mirror decides how well a block compacts.

Worked example

Take x=5,4,3,2,1,0,0,0x=5,4,3,2,1,0,0,0 with N=8N=8 and shift it by 4, as the clip ended. The shifted sequence is 1,0,0,0,5,4,3,21,0,0,0,5,4,3,2. Its bin 1 is the old bin 1 times e−j2π⋅1⋅4/8=e−jπ=−1e^{-j2\pi\cdot1\cdot4/8}=e^{-j\pi}=-1, a half turn, and the size is still 9.04. Bin 2 turns by −2π⋅2⋅4/8=−2π-2\pi\cdot2\cdot4/8=-2\pi, a full turn, so bin 2 is unchanged. In general, for n0=4n_0=4 and N=8N=8, odd bins flip sign and even bins stay.

Now reverse x=4,3,2,1,0,0,0,0x=4,3,2,1,0,0,0,0 and read bin 1. The DFT has X[1]=5.414−4.828jX[1]=5.414-4.828j. The reversed sequence 4,0,0,0,0,1,2,34,0,0,0,0,1,2,3 has 5.414+4.828j5.414+4.828j, the conjugate, as the rule says.

Reference card

PropertyTime (nn mod NN)DFT
Circular shiftx[(n−n0) mod N]x[(n-n_0)\bmod N]e−j2πkn0/NX[k]e^{-j2\pi kn_0/N}X[k]: sizes unchanged
Frequency shiftej2πk0n/Nx[n]e^{j2\pi k_0n/N}x[n]X[(k−k0) mod N]X[(k-k_0)\bmod N]
Circular reversalx[(−n) mod N]x[(-n)\bmod N]X[(−k) mod N]X[(-k)\bmod N]; real xx: X∗[k]X^*[k]
Real xxX[(−k) mod N]=X∗[k]X[(-k)\bmod N]=X^*[k]
Real, circular-evenx[(−n) mod N]=x[n]x[(-n)\bmod N]=x[n]real
Real, circular-oddx[(−n) mod N]=−x[n]x[(-n)\bmod N]=-x[n]imaginary
Circular convolution(x⊛Nh)[n]=∑m=0N−1x[m] h[(n−m) mod N](x\circledast_N h)[n]=\sum_{m=0}^{N-1}x[m]\,h[(n-m)\bmod N]X[k]H[k]X[k]H[k]
Multiplicationx[n]h[n]x[n]h[n]1N(X⊛NH)[k]\frac1N(X\circledast_N H)[k]
DualityX[n]X[n]N x[(−k) mod N]N\,x[(-k)\bmod N]

End of lesson 13.3

Where to go next.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look