---
title: "Problem set 7: transforms, subspaces and estimation"
heading: "Problem set 7: the DCT and coding gain, subspace frequency estimation, prediction, Wiener, LMS and RLS"
eyebrow: S7 · Problem set 7
type: problems
---

::: hook
These problems use lessons 28 to 38: the DCT, energy compaction and bit allocation; sinusoids in noise, Pisarenko's method and the Cramér–Rao bound; linear prediction and Levinson–Durbin; Wiener filtering; and the LMS and RLS adaptive filters.
:::

::: pool
pick: 12

::: check
kind: parts
given: N = 4 | 16 | 32; a = 0.75 | 4

## A block of N = {N} samples all equal to {a} is transformed by the orthonormal DCT.

::: part
answer: sqrt(N)*a
tolerance: 0.5%

### What is X[0]?

::: misses
- [any] $\sqrt N\,a$.
:::
:::

::: part
answer: 0
tolerance: 0

### What is X[1]?

::: misses
- [any] A constant block has no other components.
:::
:::
:::

::: check
kind: parts
given: a = 2 | 9; b = 6 | 3

## The 2-point orthonormal DCT acts on [{a}, {b}].

::: part
answer: (a + b)/sqrt(2)
tolerance: 0.5%

### What is X[0]?

::: misses
- [any] $(x_0 + x_1)/\sqrt2$.
:::
:::

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

### What is X[1]?

::: misses
- [any] $(x_0 - x_1)/\sqrt2$.
:::
:::
:::

::: check
kind: parts
given: r = 0.6 | 0.85 | 0.95

## An AR(1) signal has neighbor correlation {r}.

::: part
answer: 10*log(1/sqrt(1 - r^2))
unit: dB
tolerance: 0.5%

### What coding gain does a 2-point transform give?

::: misses
- [any] $1/\sqrt{1 - \rho^2}$.
:::
:::

::: part
answer: 10*log(1/(1 - r^2))/6.02
unit: bits
tolerance: 0.5%

### How many bits per sample is the long-block limit worth?

::: misses
- [any] $10\log_{10}(1/(1 - \rho^2))$ over 6.02.
:::
:::
:::

::: check
kind: parts
given: s = 9 | 25; t = 0.1 | 1; b = 2 | 4

## Two coefficients have variances {s} and {t}, with an average of {b} bits each.

::: part
answer: b - 0.5*log(s/t)/log(2)/2
unit: bits
tolerance: 0.5%

### How many bits go to the smaller one?

::: misses
- [any] $\bar b + \frac12\log_2(\sigma^2/\text{geometric mean})$.
:::
:::

::: part
answer: 10*log((s + t)/2/sqrt(s*t))
unit: dB
tolerance: 0.5%

### What coding gain results?

::: misses
- [any] Arithmetic over geometric mean.
:::
:::
:::

::: check
kind: parts
given: W = 640 | 1920; H = 480 | 1080; r = 10 | 20 | 40

## A {W} × {H} 8-bit grayscale image compresses at {r} : 1.

::: part
answer: W*H*8/r/8/1000
unit: KB
tolerance: 0.5%

### How large is the file?

::: misses
- [any] Raw bits over the ratio, in bytes.
:::
:::

::: part
answer: 8/r
unit: bits
tolerance: 0.5%

### How many bits per pixel is that?

::: misses
- [any] 8 over the ratio.
:::
:::
:::

::: check
kind: parts
given: P = 0.5 | 3; s = 0.1 | 1; w = 0.15 | 0.3 | 0.45; let a = P*cos(w*pi); let b = P*cos(2*w*pi); let c = P + s

## A process with φ[0] = {c}, φ[1] = {a}, φ[2] = {b} is one real sinusoid in white noise.

::: part
answer: acos((b + sqrt(b^2 + 8*a^2))/(4*a))/pi
tolerance: 0.5%

### What is its frequency, in units of π?

::: misses
- [any] Pisarenko's closed form.
:::
:::

::: part
answer: a/((b + sqrt(b^2 + 8*a^2))/(4*a))
tolerance: 0.5%

### What is the sinusoid's power?

::: misses
- [any] φ[1]/cos ω.
:::
:::
:::

::: check
kind: parts
given: M = 5 | 10; P = 0.2 | 4; s = 0.05 | 0.5

## Two complex exponentials of power {P} each, at frequencies a multiple of 2π/M apart (so their steering vectors are orthogonal), sit in white noise of variance {s}; the correlation matrix is {M} × {M}.

::: part
answer: M*P + s
tolerance: 0.5%

### What are the two largest eigenvalues?

::: misses
- [any] Orthogonal steering vectors each carry MP.
:::
:::

::: part
answer: M - 2
unit: eigenvalues
tolerance: 0

### How many eigenvalues equal the noise variance?

::: misses
- [any] M − K.
:::
:::
:::

::: check
kind: parts
given: N = 200 | 2000; S = 0 | 20; f = 10 | 100

## A tone at {S} dB SNR is recorded for {N} samples at {f} kHz.

::: part
answer: sqrt(12/(10^(S/10)*N*(N^2 - 1)))/(2*pi)*f*1000
unit: Hz
tolerance: 0.5%

### What is the Cramér–Rao bound on its frequency's standard deviation?

::: misses
- [any] $\sqrt{12/(\text{SNR}N(N^2 - 1))}\cdot f_s/2\pi$.
:::
:::
:::

::: check
kind: parts
given: p = 0.3 | 0.6 | 0.8; q = 0.1 | 0.4

## A process has φ[0] = 1, φ[1] = {p}, φ[2] = {q}.

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

### What is $k_2$?

::: misses
- [any] $(\phi[2] - k_1\phi[1])/E_1$.
:::
:::

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

### What is $E_2$?

::: misses
- [any] $E_1(1 - k_2^2)$.
:::
:::
:::

::: check
kind: parts
given: a = 0.5 | 0.9 | 0.95; v = 0.5 | 1 | 2; w = 0 | 1 | 3

## An AR(1) process with a = {a} is driven by white noise of variance {v}.

::: part
answer: 10*log(v/(1 - 2*a*cos(w) + a^2))
unit: dB
tolerance: 1%

### What is its PSD at ω = {w}, in dB?

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

::: part
answer: 10*log(1/(1 - a^2))
unit: dB
tolerance: 0.5%

### What one-step prediction gain does it allow?

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

::: check
kind: parts
given: s = 0.5 | 2 | 8; v = 0.25 | 1 | 4

## A scalar signal of variance {s} is observed in uncorrelated noise of variance {v}.

::: part
answer: s/(s + v)
tolerance: 0.5%

### What Wiener gain is best?

::: misses
- [any] $\sigma_s^2/(\sigma_s^2 + \sigma_v^2)$.
:::
:::

::: part
answer: s*v/(s + v)
tolerance: 0.5%

### What error does it leave?

::: misses
- [any] $\sigma_s^2\sigma_v^2/(\sigma_s^2 + \sigma_v^2)$.
:::
:::
:::

::: check
kind: parts
given: P = 16 | 64; s = 0.5 | 2; M = 2 | 10; f = 8 | 48

## A {P}-tap LMS filter with white input of power {s} at {f} kHz targets {M}% misadjustment.

::: part
answer: 2*M/100/(P*s)
tolerance: 0.5%

### What step size?

::: misses
- [any] $2M/(P\sigma_x^2)$.
:::
:::

::: part
answer: P/(2*M/100)/(f*1000)*1000
unit: ms
tolerance: 0.5%

### What time constant?

::: misses
- [any] $1/(\mu\sigma_x^2)$ samples.
:::
:::
:::

::: check
kind: parts
given: P = 8 | 32 | 100; l = 0.98 | 0.995 | 0.9995

## An RLS filter has {P} taps and λ = {l}.

::: part
answer: 1/(1 - l)
unit: samples
tolerance: 0.5%

### What is its memory?

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

::: part
answer: P*(1 - l)/(1 + l)*100
unit: %
tolerance: 0.5%

### What misadjustment?

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

::: check
kind: parts
given: L = 100 | 1000; P = 10 | 40; f = 8 | 16

## An RLS filter with {P} taps at {f} kHz should remember about {L} samples.

::: part
answer: 1 - 1/L
tolerance: 0.01%

### What λ?

::: misses
- [any] $1 - 1/L$.
:::
:::

::: part
answer: 2*P/(f*1000)*1000
unit: ms
tolerance: 0.5%

### Roughly how long does it take to converge?

::: misses
- [any] About 2P samples.
:::
:::
:::

::: check
kind: parts
given: a = 0.7 | 0.85; v = 1 | 4; n = 2 | 3

## The optimal linear predictor for an AR(1) process (a = {a}, driving variance {v}) forecasts {n} steps ahead.

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

### What coefficient multiplies the current sample?

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

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

### What prediction error variance results?

::: misses
- [v] That's the one-step error; more steps accumulate more driving noise.
- [any] $\sigma_w^2(1 + a^2 + \dots + a^{2(n-1)})$.
:::
:::
:::
:::
