★ Spectral Analysis with the DFT
用 DFT 做谱分析:采样率、观测时长、补零
| 旋钮 | 动作 | 影响 / 问题 |
|---|---|---|
| 采样率 | 对 采样得 | 奈奎斯特 之上的成分折叠 → 频域混叠 |
| 观测时长 | 只保留 个样本(加窗) | 主瓣宽 → 决定频率分辨率 |
| 补零 | 补零到 再做 DFT | 频格变密(每主瓣点数 )→ 栅栏效应 |
测试信号固定为两个相近正弦:(间隔 30 Hz)。
三句话:采样率管混叠与可视频率范围;观测时长管能不能把两峰分开(动包络);补零只把同一条包络采得更密(不改分辨率)。
数学直观:理想 → 现实 的“双重打击”Intuition: the double whammy from ideal x(t) to real x[n]
理想连续信号 的频谱很干净(几根线);一旦变成现实里的数字信号 ,频谱要连挨两次打击。秘诀只有一句:时域相乘,频域就卷积。
第一重打击 · 采样:采样 = 时域乘一串冲击(冲击串)。于是频域被冲击串卷积 → 频谱复制成一串(周期化)。复制品若挤太近(信号超过 )就叠在一起 = 混叠。
第二重打击 · 加窗(有限观测):只看有限一段 = 时域乘一个窗(矩形窗)。于是频域被窗的频谱 sinc 卷积(像又盖了一道章) → 细谱线被抹宽(泄露)。窗看得越久,sinc 越瘦,谱线越锐利、越确定(分辨率 )。
An ideal x(t) has a clean spectrum. Turning it into a real digital x[n] hits the spectrum twice, both following one rule: multiply in time = convolve in frequency. Hit 1 (sampling): multiply by an impulse train, so the spectrum is convolved with an impulse train and copied periodically; if the copies crowd together (beyond f_s/2) they overlap, which is aliasing. Hit 2 (windowing): a finite observation multiplies by a window, so the spectrum is convolved with the window's sinc and every line is smeared (leakage); a longer window gives a thinner sinc and sharper, more certain lines (resolution ≈ 1/T_obs).
clean
replicas
smeared
补零不是“第三重打击”:它不改这条包络,只是沿 sinc 多采几个点(把曲线描得更顺),既不加信息,也不提分辨率。
Q1: 补零把谱线变密了,为什么本来分不开的两峰还是分不开?Why doesn't zero-padding separate two merged peaks?
补零不改变包络(加窗采样信号的 DTFT),只是在同一条包络上取更密的频点。两峰能否分开,取决于包络里有没有两个鼓包,而那是由 决定的主瓣宽 。把 调小让两峰并成一个鼓包后,无论补多少零,也只是把这一个鼓包描得更圆滑,变不出第二个峰。
Zero-padding samples the same envelope more densely; it never adds a second lobe. Resolution lives in the envelope, set by 1/T_obs.
Q2: 那提高采样率能提高分辨率吗?Does a higher sampling rate improve resolution?
不能。主瓣宽(以 Hz 计)是 ,与 无关。提高 会多采点、把可视频率范围 撑宽、并避免混叠,但峰宽不变。试一下:固定 只拉 ,两峰的宽度纹丝不动。想分得更开,只能采更久。
No. Main-lobe width in Hz is 1/T_obs, independent of f_s. Raising f_s widens the visible range and fixes aliasing, but not resolution. Only longer observation helps.
Q3: 采样率太低时,峰跑到哪去了?When f_s is too low, where do the peaks go?
超过奈奎斯特 的频率会折叠回来:真实频率 出现在 处。例如 时奈奎斯特只有 100 Hz,130 Hz 的峰折到 Hz(红色虚线)。这就是频域混叠,一旦发生就无法在数字域纠正,只能事先提高 或加抗混叠模拟低通。
Components above f_s/2 fold back to |f − f_s·round(f/f_s)|. Aliasing is irreversible in the digital domain; prevent it with higher f_s or an analog anti-alias filter.
Q4: 这三个旋钮对应课件的哪部分?Which part of the slides do the three knobs map to?
对应第 5 章 §4.3 用 DFT 做谱分析的"三大问题":频域混叠()、频谱泄漏 / 分辨率( 加窗)、栅栏效应( 补零)。
Maps to the slides' Ch.5 §4.3: aliasing (f_s) / leakage-resolution (T_obs) / picket-fence (N).