22-Elec-B1 Digital Signal Processing · May 2014
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Paper format. National Exams May 2014, 07-Elec-B1 Digital Signal Processing — 3 hours, open book, any non-communicating calculator permitted. Seven questions are printed; five constitute a complete paper and the first five appearing in the answer book are marked. All questions are of equal value (20 marks each; the printed marking scheme gives the sub-part split). A table of symbols, trigonometric identities, DFT definitions, DTFT tables and z-transform tables is supplied at the back of the paper. All seven questions are solved below, so the set works as a complete study resource.
Reference texts. Proakis & Manolakis, Digital Signal Processing, 4th ed. (z-transform and ROC, Ch. 3; DFT and FFT, Ch. 7; filter structures, Ch. 9); Oppenheim & Schafer, Discrete-Time Signal Processing, 3rd ed. (the DTFT symmetry and transform tables reproduced at the back of this paper are Tables 2.1–2.3 of that text); B. P. Lathi, Linear Systems and Signals, 2nd ed. (discrete-time convolution and system response).
Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.
Given. $F_s = 48$ kHz; a 64-point DFT of the sampled sequence; the two interfering components appear at bins $k = 8$ and $k = 16$, with their conjugate images at $k = 56$ and $k = 48$ as expected for a real sequence; a d.c. bin is also present.
Find. (a) the two analogue interferer frequencies; (b) the causal real-coefficient FIR notch $H_{notch}(z)$; (c) its pole-zero plot, a minimum-multiplier realisation and its operation count; (d) the frequencies blocked if the same filter is fed at 10 kHz; (e) a narrower-notch IIR replacement with its structure.
[Figure not reproduced: Figure 2 redrawn: magnitude of the 64-point DFT. The four heavy stems at k = 8, 16, 48 and 56 are the two interferers and their conjugate images; everything else is broadband signal content. See the official exam paper.]
Approach. Convert bin index to analogue frequency, convert that to digital radian frequency, place a conjugate pair of zeros on the unit circle at each unwanted frequency, then factor the result into second-order sections to minimise multipliers. For part (e), pull a matching pole in behind each zero along the same radial line.
Hence $F_1 = 750 \times 8 = 6\,000$ Hz and $F_2 = 750 \times 16 = 12\,000$ Hz. The stems at $k = 56$ and $k = 48$ are not extra tones: for real $x[n]$ the DFT is conjugate-symmetric, $X[N-k] = X^{*}[k]$, so each real sinusoid always shows up as a mirrored pair. Both frequencies satisfy the stated $0 \lt F_1 \lt F_2 \lt 24$ kHz, so neither is aliased.
$$\boxed{F_1 = 6\;\text{kHz}, \qquad F_2 = 12\;\text{kHz}.}$$A zero exactly at $z = e^{j\omega_0}$ forces $H(e^{j\omega_0}) = 0$, which annihilates that tone completely. Real coefficients require zeros in conjugate pairs, and each pair contributes a real second-order factor:
$$H_{notch}(z) = \prod_{i=1}^{2}\left(1 - 2\cos\omega_i\, z^{-1} + z^{-2}\right) = \left(1 - \sqrt{2}\,z^{-1} + z^{-2}\right)\left(1 + z^{-2}\right),$$using $2\cos(\pi/4) = \sqrt{2}$ and $2\cos(\pi/2) = 0$. Expanding,
$$\boxed{H_{notch}(z) = 1 - \sqrt{2}\,z^{-1} + 2 z^{-2} - \sqrt{2}\,z^{-3} + z^{-4}.}$$All four taps are real and the filter is causal (only non-negative powers of $z^{-1}$), as required. The tap set $\{1, -\sqrt{2}, 2, -\sqrt{2}, 1\}$ is symmetric, so the filter also has exactly linear phase with a constant group delay of 2 samples.
Rather than implementing the five-tap transversal filter directly, keep the cascade of the two second-order sections: the first has the single non-trivial coefficient $-\sqrt{2}$, and the second has coefficients $\{1, 0, 1\}$, i.e. no multiplier at all. That is the minimum-multiplication structure.
Counting per output sample: section 1 forms $x[n] + x[n-2]$ (one addition) and then subtracts $\sqrt{2}\,x[n-1]$ (one multiplication and one subtraction); section 2 forms $w[n] + w[n-2]$ (one addition). Storage is two delay registers per section plus the one coefficient.
$$\boxed{1 \text{ multiplication}, \quad 3 \text{ additions/subtractions}, \quad 4 \text{ delay registers} + 1 \text{ coefficient word.}}$$For comparison, the direct five-tap form needs four multiplications and four additions; exploiting the tap symmetry brings that to two multiplications and four additions. The cascade wins because the $\omega_2 = \pi/2$ section is coefficient-free, and even the remaining multiplier could be traded for a shift-and-add pair since $\sqrt{2} \approx 1 + \tfrac{1}{4} + \tfrac{1}{8} + \tfrac{1}{32}$ if a small coefficient error were acceptable.
So the same code now removes 1.25 kHz and 2.5 kHz — the notches scale with the sampling rate, which is exactly why a rate change silently de-tunes a fixed-coefficient filter.
$$\boxed{F_1^{\prime} = 1.25\;\text{kHz}, \qquad F_2^{\prime} = 2.5\;\text{kHz.}}$$where $2r\cos(\pi/4) = 1.34350$ and $r^{2} = 0.9025$. The structure is elegant: every denominator coefficient is the corresponding numerator coefficient scaled by $r^{k}$, i.e.
$$\boxed{H_{IIR}(z) = \frac{N(z)}{N(z/r)}, \qquad N(z) = 1 - 2.41421 z^{-1} + 3.41421 z^{-2} - 3.41421 z^{-3} + 2.41421 z^{-4} - z^{-5}.}$$All poles have radius $r = 0.95 \lt 1$, so the filter is stable, and the ROC $|z| \gt 0.95$ makes it causal.
Each second-order section is implemented canonically in Direct Form II, which needs only two delay elements because the feedback and feedforward arms share them:
The improvement is quantitative, not merely qualitative. Measuring the −3 dB width of the $\pi/4$ notch against the local passband level between the two nulls gives $0.4145$ rad/sample for the FIR ($\approx 3167$ Hz at 48 kHz) but only $0.0999$ rad/sample for the IIR ($\approx 763$ Hz) — a factor of $4.15$ narrower, so far less of the wanted signal is destroyed alongside the interference.
Check: part (b) asks only for the sinusoids at $F_1$ and $F_2$, and Figure 2 marks only those four bins, so $H_{notch}(z)$ above is fourth order. Part (e) then says the IIR filter should "again remove the d.c. component", which introduces the d.c. requirement for the first time. It is answered as printed: the d.c. notch is included in part (e). If the examiner intended d.c. to be caught in part (b) as well, simply append the factor $(1 - z^{-1})$ there, giving the fifth-order FIR $1 - 2.41421 z^{-1} + 3.41421 z^{-2} - 3.41421 z^{-3} + 2.41421 z^{-4} - z^{-5}$ — which is exactly the numerator $N(z)$ used in part (e), at a cost of one extra delay and one extra addition.
| Part | Quantity | Result |
|---|---|---|
| (a) | Interferer frequencies | $F_1 = 6$ kHz ($k = 8$), $F_2 = 12$ kHz ($k = 16$) |
| (b) | $H_{notch}(z)$ | $1 - \sqrt{2} z^{-1} + 2 z^{-2} - \sqrt{2} z^{-3} + z^{-4}$ |
| (b) | Zeros / poles | $e^{\pm j\pi/4}, e^{\pm j\pi/2}$ on the UC; 4 poles at $z = 0$ |
| (c) | Multiplications | 1 (the $\sqrt{2}$ tap) |
| (c) | Additions/subtractions | 3 |
| (c) | Storage | 4 delay registers + 1 coefficient |
| (d) | Blocked at $F_s = 10$ kHz | 1.25 kHz and 2.5 kHz |
| (e) | $H_{IIR}(z)$ | $N(z)/N(z/r)$ with $r = 0.95$ |
| (e) | Notch −3 dB width at $\pi/4$ | FIR 0.4145 rad ($\approx$ 3167 Hz) vs IIR 0.0999 rad ($\approx$ 763 Hz) |