---
title: Problem set 9
heading: "Problem set 9: z-transforms and filter design"
eyebrow: C9 · Problem set 9
type: problems
---

::: hook
These problems use lessons 36 to 43: the z-transform and its inverse, frequency response from poles and zeros, inverse systems, FIR design by windows, IIR design by the bilinear transform, and the filter design lab.
:::

::: pool
pick: 12

::: check
kind: parts
given: p = 2 | -1; q = 5 | 3; r = -2 | 1; s = 1 | 4

## x = [{p}, {q}, {r}, {s}] for n = 0 to 3.

::: part
answer: p + q + r + s
tolerance: 0

### What is X(1)?

::: misses
- [any] The sum of the samples.
:::
:::

::: part
answer: p - q + r - s
tolerance: 0

### What is X(−1)?

::: misses
- [any] Alternate the signs.
:::
:::
:::

::: check
kind: parts
given: r = 0.5 | 0.9 | 0.99; fs = 1 | 48

## A causal filter's dominant poles are at radius {r}, running at {fs} kHz.

::: part
answer: ln(0.01)/ln(r)
tolerance: 0.5%

### After how many samples has their response fallen to 1%?

::: misses
- [any] Solve $r^n = 0.01$.
:::
:::

::: part
answer: ln(0.01)/ln(r)/fs
unit: ms
tolerance: 0.5%

### How long is that?

::: misses
- [any] Samples ÷ rate.
:::
:::
:::

::: check
kind: parts
given: a = 0.6 | 0.9; b = -0.3 | 0.2; n = 2 | 4

## $H(z) = \frac{1}{(1 - \given{a}z^{-1})(1 - (\given{b})z^{-1})}$.

::: part
answer: b/(b - a)
tolerance: 0.5%

### What is the partial-fraction coefficient on the $(\given{b})^n$ term?

::: misses
- [any] $b/(b - a)$.
:::
:::

::: part
answer: a/(a - b)*a^n + b/(b - a)*b^n
tolerance: 0.5%

### What is h[{n}]?

::: misses
- [any] Sum both modes.
:::
:::
:::

::: check
kind: parts
given: a = 0.4 | 0.9; c = 0.5 | -1 | 2

## $H(z) = (1 + \given{c}z^{-1})/(1 - \given{a}z^{-1})$.

::: part
answer: a^2*(a + c)
tolerance: 0.5%

### What is h[3]?

::: misses
- [any] h[1] = a + c, then each sample is a times the last.
:::
:::

::: part
answer: (1 + c)/(1 - a)
tolerance: 0.5%

### What is its DC gain?

::: misses
- [any] H(1).
:::
:::
:::

::: check
kind: parts
given: f0 = 50 | 400 | 1000; fs = 1 | 8 | 16; r = 0.9 | 0.99

## A notch removes {f0} Hz at {fs} kHz with pole radius {r}.

::: part
answer: 2*cos(2*pi*f0/(fs*1000))
tolerance: 0.5%

### What is the numerator's middle coefficient (after its minus sign)?

::: misses
- [any] $2\cos\omega_0$.
:::
:::

::: part
answer: 2*(1 - r)*fs*1000/(2*pi)
unit: Hz
tolerance: 0.5%

### About how wide is the notch, using 2(1 − r) radians per sample?

::: misses
- [any] Convert 2(1 − r) rad/sample to hertz.
:::
:::
:::

::: check
kind: parts
given: p = 0.5 | 0.8 | 0.95

## A filter has a zero at z = −1 and a pole at z = {p}.

::: part
answer: 2/(1 - p)
tolerance: 0.5%

### What is its unscaled gain at DC?

::: misses
- [any] H(1) = 2/(1 − p).
:::
:::

::: part
answer: (1 - p)/2
tolerance: 0.5%

### What scale factor makes the DC gain 1?

::: misses
- [any] The reciprocal.
:::
:::
:::

::: check
kind: parts
given: fs = 8 | 16 | 48; t = 0.5 | 1 | 2; fp = 1 | 3

## A Hamming FIR low-pass at {fs} kHz passes to {fp} kHz and stops {t} kHz higher.

::: part
answer: ceil(3.3*fs/t)
tolerance: 0

### About how many taps?

::: misses
- [any] $3.3\,f_s/\Delta f$, rounded up.
:::
:::

::: part
answer: (fp + t/2)/fs*2*pi
unit: rad
tolerance: 0.5%

### What cutoff $\omega_c$ does the ideal response use?

::: misses
- [any] The middle of the transition, in radians per sample.
:::
:::
:::

::: check
kind: parts
given: A = 35 | 55 | 70; d = 0.03 | 0.08

## A Kaiser design needs {A} dB over a transition of {d} cycles per sample.

::: part
answer: ceil((A - 8)/(2.285*2*pi*d) + 1)
tolerance: 0

### How many taps?

::: misses
- [any] $(A - 8)/(2.285\,\Delta\omega) + 1$, rounded up.
:::
:::

::: part
answer: 0.5842*(A - 21)^0.4*step(50.5 - A) + 0.07886*(A - 21)*step(50.5 - A) + 0.1102*(A - 8.7)*step(A - 50.5)
tolerance: 0.5%

### What β?

::: misses
- [any] Kaiser's formula for {A} dB.
:::
:::
:::

::: check
kind: parts
given: N = 41 | 65 | 129; fs = 16 | 48

## A symmetric FIR filter has {N} taps at {fs} kHz.

::: part
answer: (N - 1)/2
tolerance: 0

### What is its delay in samples?

::: misses
- [any] (N − 1)/2.
:::
:::

::: part
answer: ceil(N/2)
tolerance: 0

### How many multiplications per output, adding symmetric pairs first?

::: misses
- [any] One per pair, plus the center tap.
:::
:::
:::

::: check
kind: parts
given: c = 0.15 | 0.3 | 0.6; k = 1 | 2 | 5

## An ideal low-pass has $\omega_c$ = {c}π.

::: part
answer: sin(c*pi*k)/(pi*k)
tolerance: 0.5%

### What is the tap {k} samples from the center?

::: misses
- [any] $\sin(\omega_ck)/(\pi k)$.
:::
:::

::: part
answer: sin(c*pi*k)/(pi*k)*(0.54 + 0.46*cos(pi*k/10))
tolerance: 0.5%

### And after a 21-tap Hamming window, which is $0.54 + 0.46\cos(\pi k/10)$ at offset k?

::: misses
- [any] Multiply by the window there.
:::
:::
:::

::: check
kind: parts
given: fc = 2 | 6 | 15; fs = 32 | 48

## A digital corner of {fc} kHz at {fs} kHz.

::: part
answer: fs/pi*tan(pi*fc/fs)
unit: kHz
tolerance: 0.5%

### At what corner is the analog prototype designed?

::: misses
- [any] $\frac{f_s}{\pi}\tan(\pi f_c/f_s)$.
:::
:::

::: part
answer: fs/pi*asin((pi*fc/fs)/sqrt(1 + (pi*fc/fs)^2))
unit: kHz
tolerance: 0.5%

### Without prewarping, where would an analog corner at {fc} kHz have landed?

::: misses
- [any] $\frac{f_s}{\pi}\arctan(\pi f_c/f_s)$.
:::
:::
:::

::: check
kind: parts
given: fc = 0.1 | 1 | 4; fs = 10 | 44.1

## A first-order bilinear low-pass at {fc} kHz, {fs} kHz.

::: part
answer: tan(pi*fc/fs)/(1 + tan(pi*fc/fs))
tolerance: 0.5%

### What is b?

::: misses
- [any] $\Omega_c/(1 + \Omega_c)$.
:::
:::

::: part
answer: (tan(pi*fc/fs) - 1)/(1 + tan(pi*fc/fs))
tolerance: 0.5%

### What is a?

::: misses
- [any] $(\Omega_c - 1)/(1 + \Omega_c)$.
:::
:::
:::

::: check
kind: parts
given: fp = 1 | 2; fst = 3 | 4; As = 30 | 50; fs = 10 | 20

## A Butterworth low-pass at {fs} kHz loses at most 3 dB to {fp} kHz and at least {As} dB from {fst} kHz.

::: part
answer: tan(pi*fst/fs)/tan(pi*fp/fs)
tolerance: 0.5%

### What is the ratio of the prewarped edges?

::: misses
- [fst/fp] Prewarp each edge first.
- [any] $\tan(\pi f_{st}/f_s)/\tan(\pi f_p/f_s)$.
:::
:::

::: part
answer: ceil(log((10^(As/10) - 1)/(10^0.3 - 1))/(2*log(tan(pi*fst/fs)/tan(pi*fp/fs))) - 0.000001)
tolerance: 0

### What order is needed?

::: misses
- [any] The order formula, rounded up.
:::
:::
:::

::: check
kind: parts
given: Ap = 0.5 | 1; As = 40 | 60; r = 2 | 3

## A Butterworth design needs at most {Ap} dB in the passband and {As} dB in the stopband, with prewarped edges {r} times apart.

::: part
answer: log((10^(As/10) - 1)/(10^(Ap/10) - 1))/(2*log(r))
tolerance: 0.5%

### What does the order formula give before rounding?

::: misses
- [any] Apply it directly.
:::
:::

::: part
answer: 10*log(1 + (10^(Ap/10) - 1)*r^(2*ceil(log((10^(As/10) - 1)/(10^(Ap/10) - 1))/(2*log(r)) - 0.000001)))
unit: dB
tolerance: 0.5%

### With the order rounded up and the passband edge exactly at {Ap} dB, what loss does it reach at the stopband edge?

::: misses
- [any] $10\log_{10}(1 + (10^{A_p/10} - 1)r^{2N})$.
:::
:::
:::

::: check
kind: parts
given: M = 2 | 4 | 8; fs = 48 | 96

## A {fs} kHz signal is to be decimated by {M} with an FIR filter whose stopband starts at the new Nyquist frequency.

::: part
answer: fs/(2*M)
unit: kHz
tolerance: 0.5%

### Where does the stopband start?

::: misses
- [any] Half the new rate.
:::
:::

::: part
answer: ceil(3.3*fs/(fs/(2*M)*0.2))
tolerance: 0

### With a Hamming window and a transition 20% of that frequency wide, about how many taps?

::: misses
- [any] $3.3\,f_s/\Delta f$, rounded up.
:::
:::
:::

::: check
kind: parts
given: a = 0.4 | 0.7 | 0.9; H = 0.02 | 0.1; L = 0.001 | 0.01

## An echo channel has strength {a}, and a sensor elsewhere has gain {H} at the band edge.

::: part
answer: -20*log(1 - a)
tolerance: 0.5%

### What's the echo inverse's largest gain in dB?

::: misses
- [20*log(1 + a)] That's the channel's peak; the inverse peaks at its notch.
- [any] Not yet. $-20\log_{10}(1 - a)$.
:::
:::

::: part
answer: H/(H^2 + L)
tolerance: 0.5%

### What gain does a regularized inverse with λ = {L} apply to the sensor's band edge?

::: misses
- [1/H] That's the plain inverse.
- [any] Not yet. $|H|/(|H|^2 + \lambda)$.
:::
:::

::: right
Right. Inverses amplify what the system attenuated; regularization caps it.
:::
:::
:::
