---
title: "Problem set 9: analytic signals, filter banks, wavelets and images"
heading: "Problem set 9: Hilbert transformers and envelopes, DFT and QMF banks, the wavelet transform and 2D processing"
eyebrow: S7 · Problem set 9
type: problems
---

::: hook
These problems use lessons 40 to 49: the discrete Hilbert transform, envelopes and single sideband; uniform DFT and two-channel filter banks; the wavelet transform and denoising; and two-dimensional filtering, transforms and sampling.
:::

::: pool
pick: 12

::: check
kind: parts
given: n = 1 | 3 | 5 | 9

## The ideal discrete Hilbert transformer is evaluated at tap n = {n} and n = {n} + 1.

::: part
answer: 2/(pi*n)
tolerance: 0.5%

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

::: misses
- [1/(pi*n)] The odd taps are $2/(\pi n)$.
- [any] $2/(\pi n)$ for odd n.
:::
:::

::: part
answer: 0
tolerance: 0

### What is the next tap?

::: misses
- [any] Even taps are zero.
:::
:::
:::

::: check
kind: parts
given: A = 1 | 3; B = 0.4 | 2.5; p = 60 | 120

## Two tones of amplitudes {A} and {B} are {p}° apart in phase at some instant.

::: part
answer: sqrt(A^2 + B^2 + 2*A*B*cos(p*pi/180))
tolerance: 0.5%

### What is the envelope there?

::: misses
- [any] $\sqrt{A^2 + B^2 + 2AB\cos\phi}$.
:::
:::

::: part
answer: abs(A - B)
tolerance: 0.5%

### What is the envelope's minimum over time?

::: misses
- [any] |A − B|.
:::
:::
:::

::: check
kind: parts
given: m = 0.3 | 1 | 2.5; c = 10 | 50; s = 1 | -1

## A {m} kHz message on a {c} kHz carrier is modulated as $x\cos\omega_cn - s\cdot\hat x\sin\omega_cn$ with s = {s}.

::: part
answer: c + s*m
unit: kHz
tolerance: 0.5%

### At what frequency is the output?

::: misses
- [c - s*m] The minus sign with s = +1 keeps the upper sideband.
- [any] Upper sideband for s = +1, lower for s = −1.
:::
:::
:::

::: check
kind: parts
given: M = 8 | 64 | 512; s = 1 | 48 | 1000; k = 1 | 5

## A uniform DFT filter bank has {M} channels at {s} kHz, critically sampled.

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

### Where is channel {k} centered?

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

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

### At what rate does each channel run?

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

::: check
kind: parts
given: M = 32 | 128 | 2048; T = 4 | 12

## A polyphase-FFT channelizer has {M} channels and a prototype of {T}M taps, critically sampled.

::: part
answer: T + 0.5*log(M)/log(2)
tolerance: 0.5%

### About how many multiplications per input sample does it need?

::: misses
- [any] Taps/M plus $\frac12\log_2M$.
:::
:::
:::

::: check
kind: parts
given: w = 0.3 | 1 | 2

## The Haar analysis filters $H_0 = [1, 1]/\sqrt2$ and $H_1 = [1, -1]/\sqrt2$ are evaluated at ω = {w}.

::: part
answer: sqrt(2)*cos(w/2)
tolerance: 0.5%

### What is $|H_0|$?

::: misses
- [any] $\sqrt2|\cos(\omega/2)|$.
:::
:::

::: part
answer: 2
tolerance: 0.5%

### What is $|H_0|^2 + |H_1|^2$?

::: misses
- [any] The pair is power complementary.
:::
:::
:::

::: check
kind: parts
given: s = 16 | 44.1; j = 1 | 3 | 5; N = 8192 | 65536

## A wavelet transform runs on {N} samples at {s} kHz.

::: part
answer: s/2^(j + 1)
unit: kHz
tolerance: 0.5%

### Where does level {j}'s detail band start?

::: misses
- [any] $f_s/2^{j+1}$.
:::
:::

::: part
answer: N/2^j
unit: coefficients
tolerance: 0

### How many coefficients does it hold?

::: misses
- [any] $N/2^j$.
:::
:::
:::

::: check
kind: parts
given: a = 10 | 20; b = 12 | 30; c = 14 | 40; d = 16 | 50

## Two levels of the Haar transform act on [{a}, {b}, {c}, {d}].

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

### What is the level-2 approximation?

::: misses
- [(a + b + c + d)/4] Two orthonormal Haar levels scale by $1/\sqrt2$ twice: the sum over 2.
- [any] $(a + b + c + d)/2$.
:::
:::

::: part
answer: (a + b - c - d)/2
tolerance: 0.5%

### What is the level-2 detail?

::: misses
- [any] $((a + b) - (c + d))/2$.
:::
:::
:::

::: check
kind: parts
given: s = 0.02 | 0.2 | 1; N = 1024 | 32768

## Wavelet denoising handles {N} coefficients with noise of standard deviation {s}.

::: part
answer: s*sqrt(2*ln(N))
tolerance: 0.5%

### What is the universal threshold?

::: misses
- [any] $\sigma\sqrt{2\ln N}$.
:::
:::
:::

::: check
kind: parts
given: L = 2 | 6 | 12; N = 4096 | 1048576; f = 10 | 100

## A wavelet transform with length-{L} filters processes {N}-sample blocks {f} times a second.

::: part
answer: 2*L*N*f/1e6
unit: M/s
tolerance: 0.5%

### How many million multiplications a second does it need?

::: misses
- [any] About 2LN per block.
:::
:::
:::

::: check
kind: parts
given: K = 3 | 11 | 25; P = 2 | 8 | 50

## A K = {K} kernel filters images of {P} megapixels each.

::: part
answer: K^2*P
unit: M
tolerance: 0.5%

### How many million multiplications per image does direct filtering need?

::: misses
- [any] $K^2$ per pixel.
:::
:::

::: part
answer: 2*K*P
unit: M
tolerance: 0.5%

### And separable filtering, if the kernel allows it?

::: misses
- [any] 2K per pixel.
:::
:::
:::

::: check
kind: parts
given: N = 128 | 256 | 512 | 1024 | 2048 | 4096

## An N × N image with N = {N} is transformed by a separable radix-2 2D FFT.

::: part
answer: N^2*log(N)/log(2)/1e6
unit: M
tolerance: 0.5%

### About how many million complex multiplications does it take?

::: misses
- [any] $N^2\log_2N$.
:::
:::
:::

::: check
kind: parts
given: u = 0.62 | 0.78 | 1.35 | 1.9

## A fine pattern of {u} cycles per pixel is sampled without an optical low-pass filter.

::: part
answer: abs(u - round(u))
tolerance: 0.5%

### At what frequency does it appear, in cycles per pixel?

::: misses
- [any] |u − round(u)|.
:::
:::
:::

::: check
kind: parts
given: a = 40 | 100; b = 60 | 200

## A horizontal edge: the 3 × 3 neighborhood's top row is {a} and its middle and bottom rows are {b}.

::: part
answer: 0
tolerance: 0

### What does the Sobel $G_x$ give?

::: misses
- [any] Left and right columns are equal.
:::
:::

::: part
answer: 1*(b - a)*(1 + 2 + 1)
tolerance: 0.5%

### What does $G_y$ (bottom row minus top row, weighted 1–2–1) give?

::: misses
- [any] (1 + 2 + 1)(bottom − top).
:::
:::
:::

::: check
kind: parts
given: n = 0 | 1 | 2 | 3

## The Daubechies-4 highpass is $h_1[n] = (-1)^nh_0[3 - n]$ with $h_0$ = [0.4830, 0.8365, 0.2241, −0.1294].

::: part
answer: (1 - 2*step(n - 0.5)*step(1.5 - n) - 2*step(n - 2.5))*(0.4830*step(n - 2.5) + 0.8365*step(n - 1.5)*step(2.5 - n) + 0.2241*step(n - 0.5)*step(1.5 - n) - 0.1294*step(0.5 - n))
tolerance: 0.5%

### What is $h_1[\given{n}]$?

::: misses
- [any] $(-1)^nh_0[3 - n]$.
:::
:::
:::
:::
