DTFT và DFT
Đã giới thiệuTrong bài học này
| English | Ý nghĩa |
|---|---|
| DTFT/ˌdiː tiː ef ˈtiː/ | Biến đổi Fourier thời gian rời rạc (DTFT) |
| DFT/ˌdiː ef ˈtiː/ | Biến đổi Fourier rời rạc (DFT) |
| resolution/ˌrezəˈluːʃn/ | độ phân giải |
| leakage/ˈliːkɪdʒ/ | Rò rỉ phổ |
| Hamming window/ˈhæmɪŋ ˈwɪndəʊ/ | Hàm窗 Hamming |
| interpolates/ɪnˈtɜːpəleɪts/ | Nội suy |
A spectrum from a finite list
- A computer holds $N$ samples, not an integral. The spectrum must become a finite list of numbers too.
- The ways that list can mislead you are the most practical topic in this course.
From DTFT to DFT
- The DTFT 离散时间傅里叶变换 $X(e^{j\omega}) = \sum x[n]e^{-j\omega n}$ is continuous in $\omega$ and repeats every $2\pi$.
- The DFT 离散傅里叶变换 samples it at $N$ points, $\omega_{k} = 2\pi k/N$. In return, it treats the $N$ samples as repeating for ever.
The DFT treats its N samples as one period of a signal that repeats for ever.
Độ khó 1/5 · 100 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Sampling the spectrum makes the time signal periodic. That is where leakage comes from.
Worked example: a 4-point DFT by hand
- Find the DFT of $x = [1,\ 1,\ 0,\ 0]$. With $N = 4$, $e^{-j2\pi k n/4} = (-j)^{kn}$, and only $n = 0, 1$ count.
- $X[0] = 1 + 1 = 2$, the sum of the samples (the DC term).
- $X[1] = 1 + (-j) = 1 - j$, $\;X[2] = 1 + (-j)^2 = 1 - 1 = 0$, $\;X[3] = 1 + (-j)^3 = 1 + j$.
- Read it: $X[3]$ is the conjugate of $X[1]$. For any real signal, bin $N - k$ mirrors bin $k$: it is the negative frequency. Only bins 0 to $N/2$ carry new information.
- Reading an amplitude: a cosine of amplitude $A$ exactly on bin $k$ gives $|X[k]| = AN/2$. The 8-point example below has $A = 1$, so $|X| = 4$. A 1024-point peak of 256 means $A = 2 \times 256/1024 = 0.5$.
The 4-point DFT of $x = [2,\ 0,\ 2,\ 0]$. What is $X[2]$?
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
$X[2] = \sum x[n](-1)^n = 2 - 0 + 2 - 0 = 4$. The signal alternates every other sample, so its energy sits at DC ($X[0] = 4$) and at $f_s/2$ (bin 2).
A 2048-point DFT of an on-bin cosine shows a peak of 1536. The cosine's amplitude?
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
$A = 2|X|/N = 2 \times 1536/2048 = 1.5$.
Resolution
- The bins are $\Delta f = f_{s}/N$ apart, and bin $k$ is the frequency $k f_{s}/N$.
- Resolution 分辨率 is set by measurement time: 1 Hz bins at 1 kHz need $N = 1000$, one whole second of data.
A 256-point DFT runs at f_s = 8 kHz. What frequency is bin 32, in Hz?
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
$32 \times 8000/256 = 1000$ Hz.
Two tones 4 Hz apart must land in different bins. At least how long a record is needed, in s?
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
The bins must be 4 Hz or narrower, and $\Delta f = 1/T$, so $T \ge 0.25$ s, whatever the sample rate.
Leakage and windows
- A tone between bins does not fit a whole number of periods, so the repeated copies do not join. Its energy spreads into every bin: leakage 频谱泄漏.
- A window tapers the ends. The rectangle's sidelobes are only $-13$ dB down; the Hamming window 海明窗 pushes them to $-43$ dB, at the cost of a wider main lobe.
A weak tone sits 30 dB below a strong one nearby. Which window lets you see it?
Độ khó 1/5 · 100 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
The rectangle's −13 dB sidelobes bury anything 30 dB down. Hamming's −43 dB sidelobes leave it visible.
Worked example: on and off the bin
- An 8-point DFT of a cosine exactly on bin 1: $|X| = 4$ at bins 1 and 7, zero elsewhere.
- Move it half a bin: the magnitudes become $1.0, 2.40, 2.80, 1.19, 1.0, \ldots$ in every bin. A small tone nearby would be lost in that spread.

A 16-point DFT takes a unit cosine exactly on bin 2. What is |X| at bin 2?
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
An on-bin cosine of amplitude 1 gives N/2 at its bin and its mirror (bins 2 and 14), and zero elsewhere.
Worked example: the resolution budget
- At $f_{s} = 1$ kHz, $N = 100$ gives 10 Hz bins: two tones 6 Hz apart show as one bump.
- Zero-padding to 4000 points draws that bump more smoothly. It interpolates 插值 the spectrum, but cannot split the two tones.
You zero-pad a 100-point record (f_s = 1 kHz) to 4000 points. Two tones are 6 Hz apart. What happens?
Độ khó 1/5 · 100 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
The record is still 0.1 s, so the true resolution is still 10 Hz. Padding only interpolates.
Four common slips
- Bins as hertz. Bin $k$ is $k f_{s}/N$ Hz.
- Zero-padding for resolution. Only a longer record resolves closer tones.
- Forgetting the repeat. The jump from the last sample back to the first is itself a broadband signal.
- Reading a raw peak as the amplitude. Divide by $N/2$ first (and by the window's gain, if you used one).
Match each choice to what it decides.
Độ khó 2/5 · 140 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Only a longer measurement time gives better resolution.
Recap
- The DFT samples the DTFT: $X[k] = \sum x[n]e^{-j2\pi kn/N}$, with the record treated as periodic. Bin $N - k$ mirrors bin $k$; an on-bin cosine of amplitude $A$ peaks at $AN/2$.
- $\Delta f = f_{s}/N$ is bought with measurement time. At $f_{s} = 1$ kHz:
| $N$ | Record | Bin spacing |
|---|---|---|
| 100 | 0.1 s | 10 Hz |
| 1000 | 1 s | 1 Hz |
- Off-bin tones leak; windows trade sidelobes for main-lobe width.
Đã xảy ra vấn đề gì? Chỉ đội ngũ trang web nhìn thấy thông tin này.