Skip to content

Digital Signal Processing

University Electrical Engineering Topic 12 7:22 English narration · English and 中文 subtitles you can switch

space play · ←/→ 5s · j/l 10s · f fullscreen · c subtitles · ,/. speed

Chapters

Transcript
Digital signal processing rebuilds the continuous theory for samples, where arithmetic is exact: N samples in, N numbers out, and every promise can be measured. 数字信号处理针对采样信号重新建立连续信号理论,在这里算术运算是精确的:输入 N 个样本,输出 N 个数,每一项性能承诺都可以测量。
We start with discrete systems, the DFT and the FFT, then design FIR and IIR filters, change sample rates, and finish with a verified project. 我们从离散系统、DFT 和 FFT 开始,然后设计 FIR 和 IIR 滤波器、改变采样率,最后完成一个经过验证的项目。
Every speed-up is an operation count, not a belief. 每一次加速都有运算次数作为依据,而不是凭感觉。
A linear time-invariant system is decided by one list: its impulse response. 一个线性时不变系统由一个序列决定:它的冲激响应。
Feed a unit step into the taps 1, 2, 1, and the output reads 1, 3, 4, then 4 for ever: the tap sum, which is the DC gain. 向抽头系数为 1、2、1 的系统输入单位阶跃,输出依次为 1、3、4,之后永远保持 4:这就是抽头系数之和,也就是直流增益。
The recursive averager climbs 0.5, 0.75, 0.875, approaching 1 but never arriving, because its pole sits at one half. 递归平均器的输出依次升至 0.5、0.75、0.875,逐渐接近 1 却永远达不到,因为它的极点位于二分之一。
On the left, slide the taps along the input and add down the diagonal: the FIR filter settles in three samples, at 4. 在左图中,沿输入序列滑动抽头,再沿对角线相加:FIR 滤波器在三个采样后稳定在 4。
On the right, the recursive averager closes on 1, halving the remaining gap each step. 右图中的递归平均器逐渐接近 1,每一步都将剩余差距减半。
The pole at one half decides how fast it settles. 位于二分之一的极点决定了它达到稳定的速度。
A pole outside the unit circle would mean it never settles at all. 极点如果在单位圆之外,就意味着它根本不会稳定。
The DFT samples the DTFT at N equally spaced frequencies, and that makes the time signal periodic. DFT 在 N 个等间隔频率上对 DTFT 采样,这使时域信号呈现周期性。
A cosine exactly on bin 1 of an 8-point DFT gives two clean spikes of 4. 一个频率恰好落在 8 点 DFT 第 1 个频点上的余弦信号,会产生两个幅值为 4 的清晰谱峰。
Half a bin off, every bin lights up: that is leakage. 如果偏离半个频点,每个频点都会出现非零值:这就是频谱泄漏。
Resolution is the sample rate over N, so 1 hertz at 1 kilohertz costs one full second of data. 频率分辨率等于采样率除以 N,所以在 1千赫兹采样率下,要达到 1赫兹的分辨率就需要整整一秒的数据。
Count the bins that light up when the tone slides half a bin. 当信号频率偏移半个频点时,数一数有多少个频点出现非零值。
On bin, the periodic copies join seamlessly and only two bins are non-zero. 频率正好落在频点上时,周期延拓的各段无缝连接,只有两个频点非零。
Off bin, the copies join with a jump, and the rectangular window's sidelobes, at minus 13 decibels, smear energy everywhere. 频率偏离频点时,各段连接处出现跳变,矩形窗在负 13分贝处的旁瓣会让能量扩散到各处。
A Hamming window pushes them down to minus 43 decibels. 汉明窗将旁瓣压低到负 43分贝。
The FFT gives the same answer as the DFT with far fewer operations. FFT 用少得多的运算得到与 DFT 相同的结果。
It splits the input into even and odd samples, again and again, and recombines the halves with twiddle factors. 它不断将输入分成偶数和奇数位置的样本,再用旋转因子将两部分重新组合。
For 1024 points, the direct method needs about a million operations; the FFT needs 10,240, about 102 times fewer. 对于 1024 点,直接计算大约需要一百万次运算;FFT 需要 10,240 次,约少 102 倍。
Remember the bin map: bin k is k times f s over N hertz. 记住频点与频率的对应关系:第 k 个频点的频率是 k 乘以 f s 除以 N 赫兹。
Walk one butterfly: two inputs, one twiddle multiply, and two outputs, a sum and a difference. 看一个蝶形运算:两个输入、一次旋转因子乘法,以及两个输出,即和与差。
Two stages of these butterflies build a 4-point FFT. 两级这样的蝶形运算构成一个 4 点 FFT。
Each stage uses N over 2 butterflies, and there are log two N stages. 每一级使用 N 除以 2 个蝶形单元,一共有以 2 为底 N 的对数级。
The bit-reversed input order comes from repeatedly splitting even from odd. 输入的位倒序排列来自反复将偶数位置和奇数位置的样本分开。
An FIR filter truncates the ideal sinc with a window. FIR 滤波器用窗函数截断理想辛克函数。
The window's main lobe sets the transition width, and its sidelobes set the stopband. 窗函数的主瓣决定过渡带宽度,旁瓣决定阻带特性。
A Hamming window at 1 kilohertz with a 50 hertz transition needs about 66 taps, so take 67, with a delay of 33 samples. 在 1千赫兹采样率下,使用汉明窗实现 50赫兹的过渡带大约需要 66 个抽头,因此取 67 个,延迟为 33 个采样。
Symmetric taps give exactly linear phase. 对称抽头能给出严格的线性相位。
Always verify the measured response. 一定要验证实测响应。
The right panel was computed directly from the 67 windowed taps, not from a table. 右图直接根据加窗后的 67 个抽头计算得出,而不是查表得到。
With a 225 hertz cutoff, the stopband from 250 hertz peaks near minus 52 decibels, comfortably below the minus 43 target. 截止频率为 225赫兹时,从 250赫兹开始的阻带峰值接近负 52分贝,远低于负 43 的目标值。
The delay is exactly 33 samples at every frequency, which is what linear phase means. 所有频率的延迟都恰好是 33 个采样,这就是线性相位的含义。
Check each band against its stated limit. 检查每个频带是否满足规定的限值。
IIR design borrows analogue filters through one substitution: the bilinear transform. IIR 设计通过一次变量代换来借用模拟滤波器:这就是双线性变换。
It maps the stable left half plane inside the unit circle, so stability comes free. 它将稳定的左半平面映射到单位圆内,因此自然保持稳定性。
The cost is frequency warping, so prewarp the cutoff first. 代价是频率扭曲,所以要先对截止频率进行预畸变。
A second-order Butterworth at 100 hertz, sampled at 1 kilohertz, then lands exactly at minus 3 decibels, with poles at radius 0.643. 这样,在 1千赫兹采样率下设计的 100赫兹二阶巴特沃思滤波器,恰好在截止频率处达到负 3分贝,极点的模为 0.643。
Follow one pole across the map. 跟踪一个极点在映射中的变化。
The whole stable left half plane folds inside the unit circle, so a stable analogue pole lands as a stable digital pole, here at radius 0.643. 整个稳定的左半平面被映射到单位圆内,所以稳定的模拟极点会变成稳定的数字极点,这里的极点模为 0.643。
The tangent warp is the only toll. 唯一的代价是正切函数造成的频率扭曲。
Skip the prewarp and the cutoff drifts to 96.9 hertz; set the wrong constant and it lands at 250, silently off-specification. 如果跳过预畸变,截止频率就会偏移到 96.9赫兹;如果常数设置错误,截止频率就会落在 250,不知不觉中偏离规格。
The input passes through two delays, with feedforward gains 0.0675, 0.135 and 0.0675. 输入经过两个延迟单元,前馈增益分别为 0.0675、0.135 和 0.0675。
The output passes through two delays, with feedback gains plus 1.143 and minus 0.413. 输出经过两个延迟单元,反馈增益分别为正 1.143 和负 0.413。
Everything meets in one adder. 所有信号汇入一个加法器。
At zero frequency the gain is 0.27 over 1 minus 1.143 plus 0.413, which is exactly 1. 在零频率处,增益是 0.27 除以 1 减 1.143 加 0.413,结果恰好为 1。
Multirate processing does the work where it is cheap. 多速率处理把运算安排在成本较低的环节。
Before decimating, low-pass filter to prevent aliasing; after interpolating, low-pass to remove images. 抽取之前要进行低通滤波以防止混叠;插值之后要进行低通滤波以去除镜像。
Converting 8 kilohertz speech to 48 kilohertz means interpolating by 6, and polyphase filters do it with one sixth of the multiplies. 将 8千赫兹的语音转换为 48千赫兹,意味着要进行 6 倍插值,多相滤波器只需六分之一的乘法运算。
Remember to restore the lost gain of L after stuffing zeros. 记得在插零之后补偿损失的 L 倍增益。
On the left, stuffing five zeros between samples paints copies of the spectrum every 8 kilohertz. 左图中,在样本之间插入五个零,会使频谱每隔 8千赫兹出现一个副本。
One low-pass at 4 kilohertz erases every image, which is why it can never be skipped. 一个截止频率为 4千赫兹的低通滤波器就能消除所有镜像,这就是为什么绝不能省略它。
On the right, the polyphase structure splits that filter into six small subfilters running at the input rate, so the filtering costs one sixth as much. 右图中,多相结构将这个滤波器拆成六个以输入速率运行的小型子滤波器,因此滤波运算量降到六分之一。
The project ties it together: write the specification first, verify each stage alone, and report measured margins. 这个项目将所学内容串联起来:先写规格,分别验证每一级,并报告实测裕量。
A tone detector with 1 hertz bins at 1 kilohertz needs at least 1000 samples, already one second, so the latency conflict appears at design time. 在 1千赫兹采样率下,要让音调检测器的频点间隔为 1赫兹,至少需要 1000 个样本,已经是一秒的数据,因此延迟方面的矛盾在设计阶段就出现了。
A 1024-point FFT gives 27 decibels of processing gain, lifting a minus 10 decibel signal to plus 17. 1024 点 FFT 可提供 27分贝的处理增益,将负 10分贝的信号提升到正 17。
Read the pipeline from left to right: filter, window, FFT and threshold, each block carrying its own check. 从左到右看这条处理链:滤波、加窗、FFT 和阈值判决,每个模块都有自己的检查。
A defect found in a single stage costs an hour; found in the integrated system, it costs a week. 在单个阶段发现的缺陷需要一小时解决;在集成系统中发现则需要一周。
The table at the end lists specification, measurement and margin for every line, with every miss declared rather than hidden. 最后的表格逐项列出规格、测量值和裕量,所有未达标项都如实列出,而不是隐藏起来。
Now test yourself from memory. 现在凭记忆自测。
The taps 1, 2, 1 meet a unit step: where does the output settle? 抽头系数为 1、2、1 的系统遇到单位阶跃输入时,输出稳定在多少?
How many samples give 1 hertz bins at 1 kilohertz? 在 1千赫兹采样率下,需要多少个样本才能得到 1赫兹的频点间隔?
How much faster is a 1024-point FFT than the direct DFT? 1024 点 FFT 比直接计算 DFT 快多少?
And where does an unwarped IIR design cut off? 未经预畸变的 IIR 设计的截止频率是多少?
Pause, answer each one, then compute. 暂停一下,逐一回答,然后计算。

Comments

    Log in or create account

    IGCSE, A-Level & AP