MIT 6.300 — Lecture 13

Discrete Fourier Transform II

§ Lecture: Frequency Resolution

Recall from the end of the Lecture 12 notes what DT and DFT samples tell us about the original CT signal.

Problem. At a sampling rate of fs=44100f_s = 44 \, 100, a total of N=1024N = 1024 samples are taken from a CT signal of a cello, yielding the DT signal x[n]x[n]. The DFT of x[n]x[n] is X[k]X[k], pictured below.

A zoomed-in graph of X[k]|X[k]| for k{0,1,,24}k \in \{0, 1, \dots, 24\} is shown above. Estimate the frequency of the original cello CT signal.

Solution: Note that arg maxkX[k]=7\argmax_k |X[k]| = 7. The index k=7k = 7 in the DFT X[k]X[k] corresponds to the frequency 7×fsN301.467 \times \frac{f_s}{N} \approx 301.46 Hz.

More precisely, the true peak frequency must correspond to some index k[6.5,7.5]k \in [6.5, 7.5]. This gives us the interval [280Hz,323Hz][280 \, \mathrm{Hz}, 323 \, \mathrm{Hz}], corresponding to frequencies between D4 and Eb4.

Greater values of NN will yield a finer frequency resolution. Let's consider one way we might increase the value of NN.

Problem. Let's increase NN by a factor of 88 by defining a new signal y[n]y[n] via zero-padding.

y[n]:={x[n] if n{0,1,,N1}.0 if n{N,N+1,,8N1}.y[n] := \begin{cases} x[n] & \text{ if } n \in \{0, 1, \dots, N - 1\}. \\ 0 & \text{ if } n \in \{N, N + 1, \dots, 8N - 1\}. \end{cases}

We then read from 8Y[k]8 \cdot Y[k], where Y[k]Y[k] is the DFT of y[n]y[n]. What frequency data should we expect to obtain from this?

Solution: Recall from Lecture 12 that Y[k]Y[k] is the result of taking 8N8 \cdot N samples from the DTFT of yw[n]y_w[n] and dividing them by 8N8 \cdot N. Here's the key:

Claim. The DTFT of yw[n]y_w[n] is identical to the DTFT of xw[n]x_w[n].

Proof:   Yw(Ω)=n=08N1y[n]ejΩn=n=0N1x[n]ejΩn=Xw(Ω).   \text{Proof:} ~~~ Y_w(\Omega) = \sum_{n = 0}^{8N - 1} y[n] e^{-j\Omega n} = \sum_{n = 0}^{N - 1} x[n] e^{-j\Omega n} = X_w(\Omega). ~~~ \square

Thus 8Y[k]8 \cdot Y[k] is just a more finely-discretized sampling of 1NXw(Ω)\frac{1}{N} X_w(\Omega) than X[k]X[k].

Note that arg maxk8Y[k]=55\argmax_k |8 \cdot Y[k]| = 55, which suggests a tighter interval of frequencies [293Hz,298.77Hz][293 \, \mathrm{Hz}, 298.77 \, \mathrm{Hz}] from k[54.5,55.5]k \in [54.5, 55.5]. But it would be misleading to be so tight: the peak at k=55k = 55 is not very much higher than the peak at, say, k=54k = 54 or k=56k = 56.

Through zero-padding, larger values of NN will give us a clearer view of the DTFT Xw(Ω)X_w(\Omega). But if the DTFT Xw(Ω)X_w(\Omega) itself is too fuzzy, we still won't get a clearer vision of the correct CT frequency.

If we want to genuinely increase our frequency resolution, we just need to sample more data. Increasing the length of our DT signal by ×32\times 32 to N=32768N = 32 \, 768, we arrive at the following.

Only now can we see the truth:

Zero-padding can make our understanding of the data more precise, but it can't make the data we got any more informative.

§ Lecture and Recitation: Circular Convolution

Definition. Given two arrays AA and BB and a positive integer NN, their circular convolution is:

(AB)[n]:=m=0N1A[m]B[(nm)%N].(A \circledast B)[n] := \sum_{m = 0}^{N - 1} A[m]B[(n - m) \% N].

Remark. It's just polynomial multiplication in the ring C[z]/(zN1)\mathbb{C}[z]/(z^N - 1).

Just as the DTFT of a convolution is the product of the DTFTs, the DFT of a circular convolution is the product of the DFTs.

Theorem. (Circular Convolution = Multiplication) Suppose the DFT of a[n]a[n] is A[k]A[k], and the DFT of b[n]b[n] is B[k]B[k], both using the same window size NN. Then the DFT of (ab)[n](a \circledast b)[n] is NA[k]B[k]N \cdot A[k] \cdot B[k], and the DFT of a[n]b[n]a[n] \cdot b[n] is (AB)[k](A \circledast B)[k].

Proof: Just the same sort of argument as we saw in Lecture 10. For the first direction,

DFT(ab)[k]=1Nn=0N1(ab)[n]ej(2πk/N)n=1N(n=0N1a[n]ej(2πk/N)n)= NA[k](n=0N1b[n]ej(2πk/N)n)= NB[k]=NA[k]B[k].\mathrm{DFT}(a \circledast b)[k] = \frac{1}{N} \sum_{n = 0}^{N - 1} (a \circledast b)[n] e^{-j (2\pi k / N) n} = \frac{1}{N} \underbrace{\left(\sum_{n = 0}^{N - 1} a[n] e^{-j (2\pi k / N)n}\right)}_{ = \ N \cdot A[k] } \underbrace{\left(\sum_{n = 0}^{N - 1} b[n] e^{-j (2\pi k / N)n}\right)}_{ = \ N \cdot B[k] } = N \cdot A[k] \cdot B[k].

It's just polynomial multiplication in the ring C[z]/(zN1)\mathbb{C}[z]/(z^N - 1). And for the inverse direction,

DFT1(AB)[n]=k=0N1(AB)[k]ej(2πk/N)n=(k=0N1A[k]ej(2πk/N)n)= a[n](k=0N1B[k]ej(2πk/N)n)= b[n]=a[n]b[n].\mathrm{DFT}^{-1}(A \circledast B)[n] = \sum_{k = 0}^{N - 1} (A \circledast B)[k] e^{j (2\pi k / N) n} = \underbrace{\left(\sum_{k = 0}^{N - 1} A[k] e^{j (2\pi k / N)n}\right)}_{ = \ a[n] } \underbrace{\left(\sum_{k = 0}^{N - 1} B[k] e^{j (2\pi k / N)n}\right)}_{ = \ b[n] } = a[n] \cdot b[n].

And that's it; nothing new.   \blacksquare

Problem. Consider a DT signal x[n]x[n] of length 1111 whose DFT for N=16N = 16 (found via zero-padding) is X[k]X[k]. Determine how the length-1111 circular convolution (xx)[n](x \circledast x)[n] relates to the signal x[n]:=16DFT1(X2[k])x'[n] := 16 \cdot \mathrm{DFT}^{-1}(X^2[k]).

Solution: By the theorem above, we should expect:

x[n]=m=010x[m]x[(nm)%16]    and    (xx)[n]=m=010x[m]x[(nm)%11].x'[n] = \sum_{m = 0}^{10} x[m] x[(n - m)\%16] ~~~ \text{ and } ~~~ (x \circledast x)[n] = \sum_{m = 0}^{10} x[m] x[(n - m)\%11].

So we should expect some time-aliasing errors between x[n]x'[n] and (xx)[n](x \circledast x)[n]. For example, suppose x[n]x[n] is given by:

x[n]:={1 if n{1,2,4,8}0 if n{0,3,5,6,7,9,10}.x[n] := \begin{cases} 1 & \text{ if } n \in \{1, 2, 4, 8\} \\ 0 & \text{ if } n \in \{0, 3, 5, 6, 7, 9, 10\} \end{cases}.

There is exactly 11 pair of numbers from {1,2,4,8}\{1, 2, 4, 8\} whose sum is 00 modulo 1616—the pair (8,8)(8, 8)—so x[0]=1x'[0] = 1. However, there is no pair of numbers from {1,2,4,8}\{1, 2, 4, 8\} whose sum is 00 modulo 1111, so (xx)[0]=0(x \circledast x)[0] = 0.

§ Recitation: Impulse Trains

An impulse train is a special kind of periodic signal consisting of repeating evenly-spaced impulses.

An example of an impulse train and its DFT is shown above.

Theorem. (Impulse Trains) The Fourier transform of an impulse train is another impulse train.

Proof: Just plain computation. Work it out in your head; the discussion from Lecture 6 on impulses is relevant here.   \blacksquare