跳到主要内容

数字信号处理

大学电气工程知识点 12

本主题的视频课程 打开视频页面
7:22

数字信号处理

数字信号处理针对采样信号重新建立连续信号理论,在这里算术运算是精确的:输入 N 个样本,输出 N 个数,每一项性能承诺都可以测量。我们从离散系统、DFT 和 FFT 开始,然后设计 FIR 和 IIR 滤波器、改变采样率,最后完成一个经过验证的项目。每一次加速都有运算次数作为依据,而不是凭感觉。

英文讲解 · 可切换中英文字幕

12.1

本课程介绍及使用方法

English

This is the twelfth course in University Electrical Engineering: digital signal processing 数字信号处理, the last course of the EE strand. Course 6 built the theory for continuous time. This course builds it again for samples: the transforms that run on a computer, filters that can be used in real products, and the methods for changing between sample rates.

  • Units 12.1–12.3 are the foundations: discrete-time systems, the DTFT and DFT, and the FFT.
  • Units 12.4–12.5 design filters: FIR filters with windows, and IIR filters with the bilinear transform.
  • Units 12.6–12.7 change sample rates and build a small, fully checked processing chain.

The checking habit of this course: every filter design is checked against its specification (measured ripple, measured transition and measured stopband). Every frequency mapping is prewarped explicitly. Every claimed speed-up is an operation count, not a belief.

词汇 训练
English 中文 拼音
digital signal processing/ˈdɪdʒɪtl ˈsɪɡnl ˈprəʊsesɪŋ/ 数字信号处理 shù zì xìn hào chǔ lǐ
12.1

离散时间信号与系统复习

English

Why it matters. Everything in this course, every filter, spectrum and speed-up, is in the end a program working on a list of numbers. One list decides everything that program does: the impulse response.

The idea, with a picture. A discrete system is linear and time-invariant (LTI) when its impulse response 单位脉冲响应 $h[n]$ describes it completely. The output is then the convolution 卷积 $y[n] = \sum_{k} h[k]\cdot x[n-k]$: slide the taps along the input, multiply and add.

A three-tap FIR smoother sliding across a step input, and the recursive averager whose step response closes on 1 geometrically
The FIR settles in three samples; the recursive averager never exactly settles — the tap sum is the destination in both

Two properties are used throughout:

  • Causality 因果性: $h[n] = 0$ for $n < 0$, so there is no output before an input.
  • BIBO stability BIBO 稳定: $\sum |h[n]|$ is finite, so every bounded input gives a bounded output.

The derivation. Put the complex exponential $x[n] = e^{j\omega n}$ into the convolution sum.

  1. Each term becomes $h[k]e^{j\omega(n-k)} = e^{j\omega n}h[k]e^{-j\omega k}$.
  2. So the output is $e^{j\omega n}\sum_{k}h[k]e^{-j\omega k}$: the same exponential, multiplied by a number.
  3. That number, $H(e^{j\omega}) = \sum h[n]e^{-j\omega n}$, is the frequency response 频率响应. (In linear-algebra words, the exponential is an eigenfunction and $H(e^{j\omega})$ its eigenvalue.)
  4. The frequency response is the DTFT of the taps, which unit 12.2 builds on.

Worked example 1 (the sliding table). Take $h = [1, 2, 1]$, a 3-tap smoother, and a step input $x = [1, 1, 1, 1, \ldots]$.

  1. Slide and add: $y = 1, 3, 4, 4, \ldots$
  2. The final value is the tap sum, $\sum h = 4$ ✓. A step through any FIR filter settles at the tap sum, which is the DC gain $H(1)$.
  3. A short pulse $[1,1,1]$ gives $1, 3, 4, 3, 1$: the output rises and falls again, symmetric like the taps.

Worked example 2 (a recursive filter). The running average $y[n] = (y[n-1] + x[n])/2$ has an infinite impulse response $h[n] = 0.5^{n+1}$.

  1. Its step response is $0.5, 0.75, 0.875, 0.9375, \ldots$: each step halves the distance to 1.
  2. This is $1 - 2^{-(n+1)}$ ✓, because its single pole is at $z = 0.5$.
  3. Compare the two smoothers. The FIR remembers exactly 3 samples; the recursive one never completely forgets.
  4. A pole with $|z| < 1$ means stability. Unit 12.5 uses this idea throughout.

Common mistakes.

  • Flipping the wrong signal in the table. Convolution is commutative, but in a hand table you must flip one signal and keep to it, or the sums come out wrong.
  • Calling $\sum h$ "the gain" without saying that it is the gain at DC only.
  • Expecting a recursive smoother to settle. It comes closer at every step but never arrives exactly.

Summary. An LTI system's output is the input convolved with $h[n]$. Causal means $h[n]=0$ for $n<0$; stable means $\sum|h| < \infty$, or all poles inside the unit circle. An exponential passes through the system multiplied by $H(e^{j\omega})$.

词汇 训练
English 中文 拼音
impulse response/ˈɪmpʌls rɪˈspɒns/ 单位脉冲响应 dān wèi mài chōng xiǎng yìng
convolution/kɒnvəˈluːʃn/ 卷积 juǎn jī
causality/kɔːˈzælɪti/ 因果性 yīn guǒ xìng
BIBO stability/ˌbiː aɪ biː ˈəʊ stəˈbɪlɪti/ BIBO 稳定 BIBO wěn dìng
frequency response/ˈfriːkwənsi rɪˈspɒns/ 频率响应 pín lǜ xiǎng yìng
12.2

离散时间傅里叶变换与离散傅里叶变换

English

Why it matters. A computer holds $N$ samples, not an integral, so the spectrum must also become a finite list of numbers. The ways that list can mislead you are the most practical topic in this course.

The idea, with a picture. The DTFT 离散时间傅里叶变换, $X(e^{j\omega}) = \sum_{n} x[n]e^{-j\omega n}$, is periodic in $\omega$ with period $2\pi$. Sampling it at $N$ points gives the DFT 离散傅里叶变换. Sampling in frequency means that the time signal is treated as if it repeats. That one fact explains leakage 频谱泄漏.

An 8-point DFT of a cosine exactly on bin 1 (two clean spikes), beside the same tone half a bin off (energy smeared across every bin)
On-bin: two spikes. Half a bin off: the rectangular window's sidelobes spread energy into every bin

Resolution 分辨率 is decided by the measurement time. The bins are $\Delta f = f_{s}/N$ apart, so 1 Hz resolution at $f_{s} = 1$ kHz needs $N = 1000$: one second of data, whatever else you do.

The derivation.

  1. Sampling the DTFT at $\omega_{k} = 2\pi k/N$ makes the time signal periodic, with period $N$.
  2. If the tone lies exactly on a bin, the repeated copies join smoothly, and the DFT shows two clean spikes.
  3. If it lies between bins, the copies do not join smoothly. The jump spreads energy into every bin.
  4. Multiplying the data by a window $w[n]$ convolves the true spectrum with the window's spectrum $W(e^{j\omega})$. The rectangular window's sidelobes are only $-13$ dB down, so the spread is strong. The Hamming window 海明窗 lowers its sidelobes to $-43$ dB, which gives a much cleaner spectrum, at the cost of a wider main lobe.

Worked example 1 (measuring the spread). Take an 8-point DFT.

  1. A cosine exactly on bin 1 ($f = f_{s}/8$) gives $|X| = 4$ at bins 1 and 7 and zero elsewhere ✓, because the 8 samples hold whole periods.
  2. Move the tone half a bin, to $f = 1.5 \times f_{s}/8$. The magnitudes become $1.0, 2.40, 2.80, 1.19, 1.0, \ldots$: there is energy in every bin ✓.
  3. A small signal next to a large one can disappear in these sidelobes. That is the real cost of leakage.

Worked example 2 (the resolution budget). Take $f_{s} = 1$ kHz.

  1. $N = 100$ gives 10 Hz bins. Two tones 6 Hz apart appear as one bump, however clean the plot looks.
  2. $N = 1000$ gives 1 Hz bins, from one second of data, and the two tones separate.
  3. Zero-padding the 100 samples to 4000 points draws the same bump 40 times more finely. Padding interpolates the same spectrum; it does not separate the tones.
  4. The resolution was decided when you chose how long to measure.
Computed spectra of two equal tones at 100 and 106 hertz sampled at 1 kilohertz; with 100 samples, zero-padded to 4000 points, they form one smooth bump; with 1000 samples the two peaks are resolved
Zero-padding smooths the picture; only a longer record separates the tones

Common mistakes.

  • Reading bin numbers as hertz. Bin $k$ is the frequency $f = k \cdot f_{s}/N$.
  • Believing that zero-padding improves resolution.
  • Forgetting that the DFT treats your $N$ samples as repeating for ever. The jump from the end of one copy to the start of the next is itself a broadband signal.

Summary. The DFT $X[k]$ is the DTFT sampled at $2\pi k/N$, and the time record is treated as periodic with period $N$. Tones between bins leak through the window's sidelobes (rectangular $-13$ dB, Hamming $-43$ dB). The bin spacing $\Delta f = f_{s}/N$ decreases with zero-padding, but the ability to resolve tones is set by the measurement time and window.

词汇 训练
English 中文 拼音
DTFT/ˌdiː tiː ef ˈtiː/ 离散时间傅里叶变换 lí sàn shí jiān fù lǐ yè biàn huàn
DFT/ˌdiː ef ˈtiː/ 离散傅里叶变换 lí sàn fù lǐ yè biàn huàn
leakage/ˈliːkɪdʒ/ 频谱泄漏 pín pǔ xiè lòu
resolution/ˌrezəˈluːʃn/ 分辨率 fēn biàn lǜ
Hamming window/ˈhæmɪŋ ˈwɪndəʊ/ 海明窗 hǎi míng chuāng
12.3

快速傅里叶变换

English

Why it matters. The direct DFT costs $N^{2}$ complex operations: a 1024-point transform needs about a million multiplies. The FFT 快速傅里叶变换 is the algorithm that made digital signal processing practical.

A spectrum analyser display: power against frequency, the picture an FFT computes from samples
A spectrum analyser display: power against frequency, the picture an FFT computes from samples

The idea, with a picture. Split an $N$-point DFT into two $N/2$-point DFTs plus $N/2$ combining multiplies, then split each of those again, and so on. The butterfly 蝶形运算 is the combining unit. There are $\log_{2}N$ stages of $N/2$ butterflies, and each butterfly is one multiply plus additions.

A two-stage 4-point butterfly network, beside the direct-versus-FFT operation count on a log scale
Same answer, 102× fewer operations at N = 1024 — and the gap widens with N

The derivation.

  1. Split $x[n]$ into its even and odd samples: $X[k] = \sum_{r=0}^{N/2-1} x[2r]W_{N/2}^{kr} + W_{N}^{k}\sum_{r=0}^{N/2-1}x[2r+1]W_{N/2}^{kr}$, with the twiddle factor 旋转因子 $W_{N} = e^{-j2\pi/N}$.
  2. Each sum is an $N/2$-point DFT (the Danielson–Lanczos lemma). The odd half needs only the extra factor $W_{N}^{k}$ to combine with the even half.
  3. Repeat the split $\log_{2}N$ times, down to 2-point transforms.
  4. The repeated even/odd split reads the address bits from the end. This is why the decimation-in-time FFT takes its inputs in bit-reversed order.

Worked example 1 (the count). Count complex multiply-add operations.

  1. Direct: $N^{2} = 1024^{2} = 1\,048\,576$.
  2. FFT: $N\log_{2}N = 1024\times 10 = 10\,240$. That is 102 times fewer ✓. (Counting multiplies only, the FFT needs $(N/2)\log_{2}N = 5120$, so the saving is even larger.)
  3. At $N = 4096$: $4096^{2}$ against $4096\times 12$, 341 times fewer ✓.
  4. The gap keeps growing with $N$, because the FFT's cost grows as $N\log N$ instead of $N^{2}$.

Worked example 2 (a spectrum analyser). It needs 1 Hz bins at $f_{s} = 1$ kHz.

  1. That needs $N \ge 1000$. Choose $N = 1024$, a power of two, which gives $\Delta f = 1000/1024 = 0.977$ Hz ✓, just enough.
  2. At ten nanoseconds per operation, the transform takes about $100\ \mu$s. The record itself lasts 1.024 s, so the analyser easily keeps up in real time.
  3. Bin 100 of this DFT is the frequency $100\times 0.977 = 97.66$ Hz ✓. The mapping from bin to hertz is $k\cdot f_{s}/N$; forgetting it is the classic lab error.

Common mistakes.

  • Assuming $N$ must be a power of two. Mixed-radix and Bluestein algorithms handle any $N$; powers of two are only the fastest case.
  • Expecting the FFT to change the answer. It computes exactly the same DFT, only faster.
  • Reading bins as hertz, again.

Summary. Even/odd splits with twiddle factors give $\log_{2}N$ stages and $N\log_{2}N$ operations: 102 times faster at $N=1024$, and more for larger $N$. The mathematics is the DFT; the butterfly is how it is computed.

词汇 训练
English 中文 拼音
FFT/ˌef ef ˈtiː/ 快速傅里叶变换 kuài sù fù lǐ yè biàn huàn
butterfly/ˈbʌtəflaɪ/ 蝶形运算 dié xíng yùn suàn
twiddle factor/ˈtwɪdl ˈfæktə/ 旋转因子 xuán zhuǎn yīn zǐ
12.4

FIR滤波器设计

English

Why it matters. The FIR 有限脉冲响应 (finite impulse response) filter is the filter whose behaviour you can guarantee. It is always stable, and with symmetric taps its phase is exactly linear. Frequencies in a flat passband keep their relative phases; but changing the amplitudes can still change a waveform's shape.

A graphic equaliser: a bank of band filters, each slider setting the gain in one frequency band
A graphic equaliser: a bank of band filters, each slider setting the gain in one frequency band

The idea, with a picture. Start from the impulse response of the ideal low-pass filter, a sinc. Cut it to $N$ taps by multiplying by a window $w[n]$. The window's spectrum then decides the result: its main-lobe width becomes the transition band, and its sidelobes set the stopband.

A 67-tap Hamming window and the computed low-pass response: 200 Hz passband edge, 250 Hz stopband edge
The window guides the design; compute the actual filter response to verify its passband and stopband

Definitions with numbers.

  • The peak sidelobes of the windows themselves are: rectangular $-13$ dB, Hann $-31$ dB, Hamming $-43$ dB, Blackman $-58$ dB.
  • For the Hamming window the transition width is about $3.3\cdot f_{s}/N$.
  • Real symmetric taps, $h[n] = h[N-1-n]$, give linear phase 线性相位, with a group delay of $(N-1)/2$ samples wherever the response is not zero. The phase can jump by $\pi$ where the real amplitude changes sign, and phase and group delay are not defined at the zeros of the response.

The derivation.

  1. Cutting $h[n]$ short is the same as multiplying it by $w[n]$. In frequency, the true response is then convolved with $W(e^{j\omega})$.
  2. So the filter you build is the ideal brick-wall response spread out by the window. It has some passband ripple, a transition about one main lobe wide, and a stopband whose depth depends on the convolution, the cutoff and the number of taps.
  3. A window's sidelobe level is therefore not a guarantee for the filter's stopband. Use the window table and the transition estimate to choose a first design, then compute its response.
  4. (The alternation theorem behind the Parks–McClellan method makes its equiripple design optimal. Windows are only convenient, not optimal.)

Worked example 1 (sizing the filter). A Hamming FIR at $f_{s} = 1$ kHz must pass everything up to 200 Hz and attenuate everything from 250 Hz.

  1. Put the ideal cutoff at 225 Hz, in the middle of the 50 Hz transition.
  2. $N = 3.3\cdot 1000/50 = 66$ ✓. Take 67 taps, an odd number, for a Type I symmetric filter.
  3. Its delay is $(67-1)/2 = 33$ samples, which is 33 ms. Record this delay as a cost of the design.
  4. With only 31 taps, the same window gives a transition of $3.3\cdot 1000/31 = 106$ Hz, much wider than the 50 Hz allowed. So 31 taps fail the specification.

Worked example 2 (checking the design). Build the 67 taps and measure them.

  1. The taps are $h[n] = 0.45\operatorname{sinc}(0.45(n-33))w[n]$, where $\operatorname{sinc}(x)=\sin(\pi x)/(\pi x)$ and $\operatorname{sinc}(0) = 1$.
  2. Scale the taps so that they add up to 1 (unit DC gain).
  3. Compute $H(f)=\sum_{n=0}^{66}h[n]e^{-j2\pi fn/1000}$ on a 0.025 Hz grid.
  4. The passband (0–200 Hz) ranges from $-0.034$ to $+0.0045$ dB, and the highest stopband level (250–500 Hz) is about $-52.3$ dB.
  5. These sampled values meet the targets of ±0.05 dB ripple and a stopband of at most $-43$ dB. A finer grid, or a search for the peaks, checks the values between the samples.
  6. If a design gives $-37$ dB instead, it fails the target. Check its taps, cutoff, window, number of taps and measurement band; do not guess a single cause.

Common mistakes.

  • Choosing $N$ from the cutoff and never measuring the response.
  • Choosing an even $N$ when a Type I (odd, symmetric) design was intended.
  • Forgetting the $(N-1)/2$ delay inside a control loop.
  • Expecting windows to give the best possible filter. They are convenient, not optimal.

Summary. Window the ideal sinc. The sidelobe table guides the choice of window, $3.3f_{s}/N$ sets the transition, and symmetric taps give linear phase with a delay of $(N-1)/2$. Then measure the response against every number in the specification.

词汇 训练
English 中文 拼音
FIR/ˌef aɪ ˈɑː/ 有限脉冲响应 yǒu xiàn mài chōng xiǎng yìng
linear phase/ˈlɪnɪə feɪz/ 线性相位 xiàn xìng xiàng wèi
12.5

IIR滤波器设计

English

Why it matters. The FIR above needed 67 taps. An IIR 无限脉冲响应 (infinite impulse response) filter feeds its output back, so a 2nd-order section, a biquad, has only 5 coefficients. And one substitution lets it reuse decades of analog filter designs.

The idea, with a picture. The bilinear transform 双线性变换, $s = \frac{2}{T}\cdot\frac{1-z^{-1}}{1+z^{-1}}$ with $T$ the sampling period, maps the whole analog left half-plane to the inside of the unit circle. So every stable analog filter becomes a stable digital filter, automatically.

The s-plane with the stable left half shaded and the two Butterworth poles at minus 459.5 plus or minus j459.5, mapped by the bilinear transform into the z-plane, where the poles sit inside the unit circle at radius 0.643 and 100 hertz is a point on the circle; beside it the digital response, minus 3.0 decibels at 100 hertz
Stable analog poles land inside the unit circle; prewarping puts the $-3$ dB point exactly at 100 Hz

The cost is a frequency warp. The whole analog frequency axis, from $-\infty$ to $\infty$, is squeezed once around the unit circle. So every critical frequency must be prewarped 预畸变 before the design: $\omega_{a} = \frac{2}{T}\tan(\omega_{d}T/2)$, where $\omega_{d}$ is the digital frequency you want and $\omega_{a}$ the analog frequency to design for.

The derivation.

  1. Solve the transform for $z$: $z = \frac{1+sT/2}{1-sT/2}$.
  2. Its magnitude is exactly 1 when $\mathrm{Re}\,s = 0$. So the analog imaginary axis maps onto the unit circle, and the left half-plane maps strictly inside it.
  3. The tangent relation is the warp. Near DC, $\tan\theta \approx \theta$, so the distortion is very small. But as the digital frequency approaches the Nyquist frequency, it corresponds to analog frequencies going to infinity.
  4. Butterworth, Chebyshev and elliptic designs can be reused unchanged, because only the frequency axis is bent; the shape of the polynomials is kept.

Worked example 1 (the biquad). Design a 2nd-order Butterworth low-pass at 100 Hz, with $f_{s} = 1$ kHz.

  1. Prewarp: $\omega_{a} = 2000\tan(\pi\cdot 100/1000) = 649.8$ rad/s ✓.
  2. With $s$ scaled by $\omega_{a}$, the substitution constant is $K = 1/\tan(0.1\pi) = 3.078$.
  3. The prototype $H(s) = 1/(s^{2}+1.4142s+1)$ becomes
$$H(z) = \frac{1 + 2z^{-1} + z^{-2}}{14.82 - 16.94z^{-1} + 6.12z^{-2}}$$

Worked example 2 (checking it, and its costs).

  1. DC gain: the denominator adds up to $14.82 - 16.94 + 6.12 = 4.00$, and so does the numerator, so $H(1) = 4/4 = 1.000$ ✓. A Butterworth filter is flat at DC.
  2. The response at exactly 100 Hz is $-3.0$ dB ✓. The prewarp put the $-3$ dB point exactly on the required frequency; that is its whole purpose.
  3. The poles are at $|z| = 0.643$, inside the unit circle, as the mapping guarantees ✓.
  4. Skip the prewarp, designing the analog filter at $2\pi \times 100 = 628.3$ rad/s, and the $-3$ dB point lands at 96.9 Hz.
  5. Also set $T = 1$ ($K = 1$) and the cutoff moves to 250 Hz. The response at 100 Hz then reads only $-0.05$ dB, which looks fine but misses the specification completely. The numbers show the difference.
  6. The costs: 5 coefficients against the FIR's 67 taps (the FIR meets a much sharper specification, but each biquad is cheap), and the phase is not linear near the cutoff. In fixed-point arithmetic the denominator coefficients are sensitive: rounding 6.12 moves the cutoff measurably. Efficiency, phase and sensitivity have to be balanced.
Direct form I of the biquad: x of n through two delays with feedforward gains 0.0675, 0.135 and 0.0675, and y of n through two delays with feedback gains plus 1.143 and minus 0.413, all into one adder
The biquad's five coefficients in one diagram

Common mistakes.

  • Skipping the prewarp. The cutoff lands low: 96.9 Hz instead of 100 Hz at 1 kHz is a small error, but 2.86 kHz instead of 4 kHz at 10 kHz is a serious one.
  • Setting $T = 1$ while still giving the frequencies in hertz.
  • Testing stability by trial instead of relying on the mapping.
  • Expecting linear phase. Near its poles, the phase of an IIR filter changes fastest.

Summary. The bilinear transform maps the left half-plane into the unit disk, so stability is automatic. It warps frequencies as $\frac{2}{T}\tan(\cdot)$, so prewarp every critical frequency. The Butterworth biquad becomes $H(z) = \frac{1+2z^{-1}+z^{-2}}{14.82 - 16.94z^{-1} + 6.12z^{-2}}$ (DC gain 1.000, $-3.0$ dB at 100 Hz, poles at 0.643).

词汇 训练
English 中文 拼音
IIR/ˌaɪ aɪ ˈɑː/ 无限脉冲响应 wú xiàn mài chōng xiǎng yìng
bilinear transform/baɪˈlɪnɪə trænsˈfɔːm/ 双线性变换 shuāng xiàn xìng biàn huàn
prewarp/prɪˈwɔːp/ 预畸变 yù jī biàn
12.6

多速率信号处理

English

Why it matters. The sample rate decides the amount of computing: a filter running at 48 kHz does six times the work of the same filter at 8 kHz. Multirate processing does each job at the lowest rate that works.

The idea, with a picture.

  • Decimation 抽取 by $M$ keeps every $M$th sample. You must first low-pass the signal below $f_{s}/(2M)$. Otherwise the spectrum folds over (aliases), and the damage cannot be undone.
  • Interpolation 插值 by $L$ puts $L-1$ zeros between samples. You must then low-pass below the old Nyquist frequency to remove the images this creates.
Left: the spectrum after zero-stuffing 8 kilohertz speech by 6, with the signal from 0 to 4 kilohertz under a 4 kilohertz low-pass and copies (images) centred on 8, 16 and 24 kilohertz. Right: the polyphase form, six subfilters E0 to E5, each holding every sixth tap and running at 8 kilohertz, with a switch that takes their outputs in turn at 48 kilohertz
Zero-stuffing makes copies of the spectrum every 8 kHz; one low-pass removes them, and the polyphase form does the same work at the low rate

The derivation.

  1. Stuffing zeros by $L$ in time gives $X_{up}(e^{j\omega}) = X(e^{j\omega L})$: the same spectrum repeated $L$ times around the circle. These copies are the images, and they are as real as the signal.
  2. Keeping 1 sample in $M$ adds $M$ shifted copies of the spectrum on top of each other. Anything above the new Nyquist frequency folds back into the band.
  3. So each of the two low-pass filters is necessary: each removes something the mathematics guarantees will be there.
  4. Polyphase 多相分解 is then pure algebra. In the interpolation filter, the inputs are mostly stuffed zeros, so each set of taps meets only every $L$th real sample. One filter at $Lf_{s}$ becomes $L$ subfilters at $f_{s}$: the same output, with $1/L$ of the multiplies of a naive high-rate implementation that multiplies the inserted zeros.

Worked example 1 (8 kHz speech to 48 kHz).

  1. Interpolate by 6. A low-pass at 4 kHz (the old Nyquist frequency) then removes the images at 8, 16, 24, 32 and 40 kHz.
  2. Run directly, that filter works at 48 kHz: six times the work.
  3. In polyphase form it becomes 6 subfilters, each running at 8 kHz: the same arithmetic with $1/6$ of the multiplies ✓.
  4. This is not an approximation; it is the same computation in a better order.

Worked example 2 (one converter, not two). Resample 48 kHz audio to 72 kHz.

  1. This needs $L = 3$ and $M = 2$, since $48\times 3/2 = 72$ ✓.
  2. Doing it as two separate steps would need an interpolator, a filter, a decimator and a second filter.
  3. One rational converter does it all: upsample by 3 to 144 kHz, apply a single low-pass at 24 kHz, and keep every second sample.
  4. 24 kHz is the input's own Nyquist frequency, the lower of the two limits. So the one filter removes the images from $\uparrow 3$ and prevents the aliases from $\downarrow 2$ at the same time.

Common mistakes.

  • Decimating before filtering. The aliases are then not noise; they are permanent.
  • Forgetting that zero-stuffing divides the level by $L$. The filter must have a gain of $L$ to restore it.
  • Treating polyphase as an approximation. It is exact.

Summary. $\downarrow M$ needs a low-pass at $f_{s}/2M$ first. $\uparrow L$ needs a low-pass at the old Nyquist frequency afterwards. Polyphase gives the same result with $1/L$ of the multiplies. A rational $L/M$ converter needs only one filter, at the intermediate rate.

词汇 训练
English 中文 拼音
decimation/ˌdesɪˈmeɪʃn/ 抽取 chōu qǔ
interpolation/ɪnˌtɜːpəˈleɪʃn/ 插值 chā zhí
polyphase/ˌpɒlɪˈfeɪz/ 多相分解 duō xiāng fēn jiě
12.7

信号处理项目

English

Why it matters. The course ends the way real work begins: with a specification, an implementation and a measurement, and a clear record of the differences between the three.

The idea, with a picture. Build a tone detector as a chain of stages: anti-alias filter, then window, then FFT, then threshold. Check each stage on its own before you add the next. A fault found in one stage takes an hour to fix; found in the complete system, it can take a week of searching.

The tone detector as four blocks in a row, anti-alias filter, Hamming window, FFT with N equal to 1024, and threshold, each with its own check underneath, above a table of specification, measured value and result: 1 hertz bins pass at 0.977 hertz, answer in under 1 second fails with a 1.024 second record, and detection at minus 10 decibels SNR passes with plus 17 decibels in the bin
Write the specification first, check each stage alone, then measure the whole chain against every line

The method.

  1. Write the specification first. The tone detector must give 1 Hz bins, answer in under 1 s, and detect a tone at $-10$ dB SNR.
  2. Build it in stages, checking each one.
  3. Report the measured performance against every line of the specification, failures included.

Worked example 1 (two specification lines conflict).

  1. 1 Hz bins at $f_{s} = 1$ kHz need $N \ge 1000$ samples. That is already 1.0 s of data, but the specification asks for an answer in under 1 s.
  2. The conflict appears at design time, which is when you want to find it.
  3. $N = 1024$ gives 0.977 Hz bins ✓ but a 1.024 s record ✗.
  4. $N = 1000$ gives exactly 1.000 Hz and needs exactly 1.0 s, so it passes only if the limit allows 1.0 s.
  5. The table of margins records this trade-off openly.

Worked example 2 (can a −10 dB tone be detected?).

  1. A sine wave's energy collects in one bin, while white noise spreads over all $N/2$ bins. So the FFT's processing gain 处理增益 in the tone's bin is $10\log_{10}(N/2)$.
  2. At $N = 1024$ that is $10\log_{10}512 = 27$ dB ✓.
  3. An input SNR of $-10$ dB becomes about $+17$ dB in the tone's bin.
  4. The window costs a few dB of that gain, and the tone is still clearly detectable. The answer comes from the transform, not from a guess.

Common mistakes.

  • Testing only the easy cases.
  • Leaving out specification lines: goals that exist in the code but not in the report.
  • Tuning the detector to the one test tone. A detector fitted to one test proves nothing about other signals.
  • Skipping the checks on each stage. Faults that a stage check would show stay hidden in the complete system.

Summary. Write the specification first, check each stage alone, and trust only measured margins. The processing gain $10\log_{10}(N/2)$ decides whether a weak tone can be found.

词汇 训练
English 中文 拼音
processing gain/ˈprəʊsesɪŋ ɡeɪn/ 处理增益 chǔ lǐ zēng yì

该知识点的互动课程

逐步完成,配合即时检查练习。

更多 大学电气工程 知识点

登录或创建账户

IGCSE, A-Level & AP