---
title: Midterm exam
heading: "Midterm exam: transforms, sampling, multirate systems, frequency response, structures and IIR design"
eyebrow: S7 · Midterm exam
type: problems
---

::: hook
Twelve problems from lessons 1 to 19: LTI systems and the DTFT, z-transforms and inversion, sampling and reconstruction, converter impairments, decimation and interpolation, oversampled converters, group delay, all-pass and minimum-phase systems, linear-phase types, filter structures, finite word length and IIR design. Give yourself two hours and work without the lessons open. "Another set" deals a different exam.
:::

::: pool
pick: 12

::: check
kind: parts
given: a = 0.7 | 0.9 | -0.6; w = 0.25 | 1 | 2.2; A = 2 | 5

## h[n] = ({a})ⁿu[n] with input $\given{A}\cos(\given{w}n)$.

::: part
answer: A/sqrt(1 - 2*a*cos(w) + a^2)
tolerance: 0.5%

### Output amplitude?

::: misses
- [any] $A/|1 - ae^{-j\omega}|$.
:::
:::

::: part
answer: (a*cos(w) - a^2)/(1 - 2*a*cos(w) + a^2)
tolerance: 0.5%

### Group delay at that frequency?

::: misses
- [any] $\frac{a\cos\omega - a^2}{1 - 2a\cos\omega + a^2}$.
:::
:::

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

### Energy of h?

::: misses
- [any] $1/(1 - a^2)$.
:::
:::
:::

::: check
kind: parts
given: a = 0.4 | 0.6; b = 1.25 | 1.8; n = 2 | 3

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

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

### x[{n}] for the causal ROC?

::: misses
- [any] Both right-sided.
:::
:::

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

### x[−{n}] for the stable ROC?

::: misses
- [any] Only the b term, left-sided.
:::
:::
:::

::: check
kind: parts
given: r = 0.8 | 0.93; t = 0.4 | 1.3; n = 4 | 7

## A causal two-pole resonator with poles at {r}e^{±j{t}}.

::: part
answer: r^n*sin((n + 1)*t)/sin(t)
tolerance: 0.5%

### h[{n}]?

::: misses
- [any] $r^n\sin((n + 1)\theta)/\sin\theta$.
:::
:::

::: part
answer: (r - r^2)/(1 - r)^2 + (r*cos(2*t) - r^2)/(1 - 2*r*cos(2*t) + r^2)
tolerance: 0.5%

### Group delay at ω = {t}?

::: misses
- [any] Both poles' contributions.
:::
:::
:::

::: check
kind: parts
given: f = 23 | 37 | 58; s = 20 | 32 | 44.1

## A {f} kHz tone sampled at {s} kHz and played through a zero-order hold.

::: part
answer: abs(f - s*round(f/s))
unit: kHz
tolerance: 0.01

### Apparent frequency?

::: misses
- [any] Fold about the nearest multiple of $f_s$.
:::
:::

::: part
answer: 20*log(abs(sin(pi*abs(f - s*round(f/s))/s)/(pi*abs(f - s*round(f/s))/s)))
unit: dB
tolerance: 0.02

### Hold response at that frequency?

::: misses
- [any] The ZOH sinc.
:::
:::
:::

::: check
kind: parts
given: s = 48 | 192; M = 3 | 4 | 8; N = 60 | 144

## A {s} kHz signal is decimated by {M} with an N = {N}-tap FIR.

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

### Anti-aliasing cutoff?

::: misses
- [any] $f_s/2M$.
:::
:::

::: part
answer: N/M
tolerance: 0.5%

### Polyphase multiplications per input sample?

::: misses
- [any] N/M.
:::
:::
:::

::: check
kind: parts
given: B = 1 | 3; M = 32 | 128; p = 1 | 2

## A {B}-bit quantizer, oversampled ×{M}, with order-{p} noise shaping.

::: part
answer: 6.02*B + 1.76 - 10*log(pi^(2*p)/(2*p + 1)) + (2*p + 1)*10*log(M)
unit: dB
tolerance: 0.05

### In-band SNR?

::: misses
- [any] $6.02B + 1.76 - 10\log\frac{\pi^{2p}}{2p + 1} + (2p + 1)10\log M$.
:::
:::

::: part
answer: (6.02*B + 1.76 - 10*log(pi^(2*p)/(2*p + 1)) + (2*p + 1)*10*log(M) - 1.76)/6.02
tolerance: 0.5%

### Effective bits?

::: misses
- [any] (SNR − 1.76)/6.02.
:::
:::
:::

::: check
kind: parts
given: a = 0.5 | 0.8 | -0.7; w = 0.6 | 2

## A first-order all-pass with real a = {a}.

::: part
answer: (1 - a^2)/(1 - 2*a*cos(w) + a^2)
tolerance: 0.5%

### Group delay at ω = {w}?

::: misses
- [any] $(1 - a^2)/|1 - ae^{-j\omega}|^2$.
:::
:::

::: part
answer: -90 - 2*atan(a)*180/pi
unit: °
tolerance: 0.2

### Phase at π/2?

::: misses
- [any] $-90° - 2\arctan a$.
:::
:::
:::

::: check
kind: parts
given: c = 1.5 | 3 | 6; a = 0.35 | 0.75; n = 3 | 5

## A channel $1 - \given{c}z^{-1}$; and the inverse of a minimum-phase $1 - \given{a}z^{-1}$.

::: part
answer: c^2/(c^2 + 1)
tolerance: 0.5%

### First-sample energy fraction of the channel's minimum-phase counterpart?

::: misses
- [any] $c^2/(c^2 + 1)$.
:::
:::

::: part
answer: a^n
tolerance: 0.5%

### The inverse's sample n = {n}?

::: misses
- [any] $a^n$.
:::
:::
:::

::: check
kind: parts
given: a = 0.5 | 2; b = 1 | 4; w = 0.8 | 2.4; N = 33 | 100; s = 8 | 48

## Type I [{a}, {b}, {a}]; and an N = {N}-tap linear-phase FIR at {s} kHz.

::: part
answer: b + 2*a*cos(w)
tolerance: 0.5%

### Type I amplitude at ω = {w}?

::: misses
- [any] $b + 2a\cos\omega$.
:::
:::

::: part
answer: (N - 1)/2/s
unit: ms
tolerance: 0.5%

### FIR delay?

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

::: check
kind: parts
given: a = 0.35 | -0.7; k = 0.3 | -0.45; M = 4 | 8; N = 6 | 10

## An all-pole $1 + \given{a}z^{-1} + \given{k}z^{-2}$; and an IIR filter with {M} zeros and {N} poles.

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

### Lattice $k_1$?

::: misses
- [any] $a_1/(1 + k_2)$.
:::
:::

::: part
answer: (M + N + abs(M - N))/2
tolerance: 0

### Direct form II delays?

::: misses
- [any] max(M, N).
:::
:::
:::

::: check
kind: parts
given: B = 13 | 15; a = 0.95 | 0.99; r = 0.95 | 0.99; t = 0.2 | 1.5

## Rounding to B = {B} bits at the input of a pole at {a}; and a resonator at {r}e^{±j{t}}.

::: part
answer: 10*log(2^(-2*B)/12/(1 - a^2))
unit: dB
tolerance: 0.05

### First-order output noise, dB re 1?

::: misses
- [any] $\sigma_e^2/(1 - a^2)$.
:::
:::

::: part
answer: 10*log((1 + r^2)/((1 - r^2)*((1 + r^2)^2 - 4*r^2*cos(t)^2)))
unit: dB
tolerance: 0.05

### Resonator noise gain?

::: misses
- [any] The resonator formula.
:::
:::
:::

::: check
kind: parts
given: w = 0.2 | 0.45; T = 2; a = 400 | 2500; h = 0.1 | 0.25

## The bilinear transform with T = {T}; and an analog pole at −{a} rad/s with a {h} ms sample period.

::: part
answer: 2/T*tan(w*pi/2)
tolerance: 0.5%

### Prewarped frequency for {w}π?

::: misses
- [any] $\frac{2}{T}\tan(\omega/2)$.
:::
:::

::: part
answer: exp(-a*h/1000)
tolerance: 0.5%

### Impulse-invariant pole?

::: misses
- [any] $e^{sT}$.
:::
:::

::: part
answer: (1 - a*h/2000)/(1 + a*h/2000)
tolerance: 0.5%

### Bilinear pole?

::: misses
- [any] $\frac{1 + sT/2}{1 - sT/2}$.
:::
:::
:::

::: check
kind: parts
given: p = 0.1 | 0.2; s = 0.4 | 0.55; A = 25 | 35

## A bilinear Butterworth lowpass, 1 dB at {p}π, {A} dB at {s}π.

::: part
answer: ceil(log((10^(A/10) - 1)/(10^0.1 - 1))/(2*log(tan(s*pi/2)/tan(p*pi/2))))
tolerance: 0

### Order?

::: misses
- [any] Prewarp, then the order formula.
:::
:::

::: part
answer: 10*log(1 + (tan(s*pi/2)/tan(p*pi/2))^(2*ceil(log((10^(A/10) - 1)/(10^0.1 - 1))/(2*log(tan(s*pi/2)/tan(p*pi/2)))))*(10^0.1 - 1))
unit: dB
tolerance: 0.05

### Stopband loss at {s}π if the passband edge is met exactly?

::: misses
- [any] With $\Omega_c$ set by the 1 dB point, evaluate at $\Omega_s$.
:::
:::
:::

::: check
kind: parts
given: L = 160 | 4; M = 147 | 3; s = 44.1 | 48

## A rational resampler up by {L}, down by {M}, from {s} kHz.

::: part
answer: s*L/M
unit: kHz
tolerance: 0.5%

### Output rate?

::: misses
- [any] $f_sL/M$.
:::
:::

::: part
answer: 1/((L + M + abs(L - M))/2)
tolerance: 0.5%

### Filter cutoff in units of π (upsampled rate)?

::: misses
- [any] $\min(1/L, 1/M)$.
:::
:::
:::

::: check
kind: parts
given: B = 10 | 16; f = 2 | 15; s = 48 | 96; w = 0.1 | 0.35

## A {B}-bit converter at {s} kHz; a digital filter with cutoff {w}π; a {f} kHz tone.

::: part
answer: 6.02*B + 1.76
unit: dB
tolerance: 0.05

### Quantizer SNR?

::: misses
- [any] 6.02B + 1.76.
:::
:::

::: part
answer: w*s/2
unit: kHz
tolerance: 0.5%

### Filter cutoff in kilohertz?

::: misses
- [any] $\omega_cf_s/2\pi$.
:::
:::

::: part
answer: 20*log(sin(pi*f/s)/(pi*f/s))
unit: dB
tolerance: 0.02

### Zero-order-hold droop at {f} kHz?

::: misses
- [any] The ZOH sinc.
:::
:::
:::

::: check
kind: parts
given: B = 12 | 16 | 24; C = 3 | 4

## A {B}-bit converter carries a signal of crest factor {C}, and separately a full-scale sine with TPDF dither.

::: part
answer: 6.02*B + 4.77 - 20*log(C)
unit: dB
tolerance: 0.5%

### What SNR does the crest-factor signal get?

::: misses
- [any] $6.02B + 4.77 - 20\log_{10}C$.
:::
:::

::: part
answer: 6.02*B + 1.76 - 4.77
unit: dB
tolerance: 0.5%

### What SNR does the dithered sine get?

::: misses
- [any] Subtract 4.77 dB.
:::
:::
:::
:::
