---
title: Midterm exam
heading: "Midterm exam: signals, convolution, frequency response and sampling"
eyebrow: C9 · Midterm exam
type: problems
---

::: hook
Twelve problems from the first half of the course: signals and their periods, energy and power, time operations, impulses and exponentials, system properties, convolution in discrete and continuous time, impulse responses and difference equations, frequency response, the DTFT, simple digital filters, sampling, rate changes, the DFT and the FFT. Give yourself two hours, work without the lessons open, and write out your reasoning before checking each answer. "Another set" deals a different exam.
:::

::: pool
pick: 12

::: check
kind: parts
given: m = 1 | 5 | 7; d = 6 | 10; A = 2 | 4; tau = 0.5 | 3

## Consider $x[n] = \cos(2\pi \given{m}n/\given{d})$ and $v(t) = \given{A}e^{-t/\given{tau}}u(t)$. ({m} and {d} share no factor.)

::: part
answer: d
tolerance: 0

### What is the period of x[n]?

::: misses
- [any] $\omega_0/2\pi = m/d$ in lowest terms.
:::
:::

::: part
answer: A^2*tau/2
tolerance: 0.5%

### What is the energy of v(t)?

::: misses
- [any] $A^2\tau/2$.
:::
:::
:::

::: check
kind: parts
given: a = 3 | -2 | 0.25; b = 6 | -5; t0 = 0 | 2; D = 3 | 8

## x(t) lasts {D} s and peaks at t = {t0}. Consider $x(\given{a}t + \given{b})$.

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

### Where is the peak?

::: misses
- [any] Solve $at + b = t_0$.
:::
:::

::: part
answer: D/abs(a)
unit: s
tolerance: 0.5%

### How long does it last?

::: misses
- [any] D/|a|.
:::
:::
:::

::: check
kind: parts
given: t0 = 1 | 2; a = 3 | 4; b = 3 | 8

## Evaluate over all t.

::: part
answer: (t0^2 + 1)*exp(-t0)
tolerance: 0.5%

### $\int (t^2 + 1)e^{-t}\delta(t - \given{t0})\,dt$

::: misses
- [any] Sift at t = {t0}.
:::
:::

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

### $\int t^2\,\delta(\given{a}t - \given{b})\,dt$

::: misses
- [(b/a)^2] $\delta(at - b) = \delta(t - b/a)/a$.
- [any] Not yet. Rescale the impulse first.
:::
:::
:::

::: check
kind: parts
given: M = 2 | 5; a = 0.5 | -0.75 | 0.9; N = 10 | 50

## $h[n] = (\given{a})^n u[n]$ and inputs are bounded by {M}; separately, an accumulator receives u[n].

::: part
answer: M/(1 - abs(a))
tolerance: 0.5%

### What bound holds on the output of h?

::: misses
- [any] $M\sum\lvert h\rvert$.
:::
:::

::: part
answer: N + 1
tolerance: 0

### What does the accumulator output at n = {N}?

::: misses
- [any] The count of ones so far.
:::
:::
:::

::: check
kind: parts
given: a = 3 | -1; b = 2 | 4; c = 1 | -2; p = 2 | 1; q = -1 | 3; r = 3 | 4

## x = [{a}, {b}, {c}] is convolved with h = [{p}, {q}, {r}].

::: part
answer: a*r + b*q + c*p
tolerance: 0

### What is y[2]?

::: misses
- [a*p + b*q + c*r] Pair x[k] with h[2 − k].
- [any] Not yet. x[0]h[2] + x[1]h[1] + x[2]h[0].
:::
:::

::: part
answer: 5
tolerance: 0

### How many samples long is y?

::: misses
- [any] 3 + 3 − 1.
:::
:::
:::

::: check
kind: parts
given: tau = 0.5 | 2; T = 1 | 3; d = 0.5 | 1

## A unit pulse lasting {T} s drives a system with $h(t) = \frac{1}{\given{tau}}e^{-t/\given{tau}}u(t)$.

::: part
answer: 1 - exp(-T/tau)
tolerance: 0.5%

### What is the output at t = {T}?

::: misses
- [any] The step response at T.
:::
:::

::: part
answer: (1 - exp(-T/tau))*exp(-d/tau)
tolerance: 0.5%

### What is it at t = {T} + {d}?

::: misses
- [any] Decay from the value at T.
:::
:::
:::

::: check
kind: parts
given: a = 0.7 | -0.5; b = 2 | 0.5; C = 1 | 6; k = 2 | 4

## $y[n] = \given{a}\,y[n-1] + \given{b}\,x[n]$, at rest.

::: part
answer: b*a^k
tolerance: 0.5%

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

::: misses
- [any] $ba^k$.
:::
:::

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

### What does it settle to for a constant input {C}?

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

::: check
kind: parts
given: A = 1 | 2; r = 0.5 | 2; k = 3 | 7

## A ±{A} square wave at $f_0$ goes into an RC low-pass with its corner at $f_0/\given{r}$.

::: part
answer: 4*A/(pi*k)/sqrt(1 + (k*r)^2)
tolerance: 0.5%

### How big is harmonic {k} at the output?

::: misses
- [any] $(4A/\pi k)/\sqrt{1 + (kr)^2}$.
:::
:::

::: part
answer: -atan(k*r)*180/pi
unit: °
tolerance: 0.5%

### What phase does the filter give it?

::: misses
- [any] $-\arctan(kr)$.
:::
:::
:::

::: check
kind: parts
given: t0 = 0.5 | 2; f = 100 | 400; N = 15 | 33

## A pure delay of {t0} ms, and a symmetric {N}-tap FIR filter.

::: part
answer: -360*f*t0/1000
unit: °
tolerance: 0.5%

### What phase does the delay give {f} Hz?

::: misses
- [any] $-360ft_0$.
:::
:::

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

### How many samples does the FIR filter delay every frequency?

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

::: check
kind: parts
given: a = 1 | 4; b = 2 | -3; c = 3 | 1; d = -1 | 2

## x = [{a}, {b}, {c}, {d}], from n = 0.

::: part
answer: a - b + c - d
tolerance: 0.5%

### What is its DTFT at ω = π?

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

::: part
answer: a^2 + b^2 + c^2 + d^2
tolerance: 0.5%

### What is $\frac{1}{2\pi}\int_{-\pi}^{\pi}\lvert X\rvert^2d\omega$?

::: misses
- [any] Parseval: the energy.
:::
:::
:::

::: check
kind: parts
given: fs = 6000 | 12000; fh = 50 | 60; alpha = 0.05 | 0.25

## Data at {fs} Hz carries {fh} Hz hum. Two filters are considered: a moving average and an exponential smoother with α = {alpha}.

::: part
answer: fs/fh
tolerance: 0

### How many points must the moving average span to null the hum?

::: misses
- [any] One period of the hum.
:::
:::

::: part
answer: alpha/(2 - alpha)
tolerance: 0.5%

### What is the smoother's gain at half the sample rate?

::: misses
- [any] $\alpha/(2 - \alpha)$.
:::
:::
:::

::: check
kind: parts
given: f = 1700 | 3400 | 6200; fs = 4000 | 5000; B = 15 | 20; f2 = 44.1 | 48

## Sampling problems.

::: part
answer: abs(f - fs*round(f/fs))
unit: Hz
tolerance: 0.5%

### Where does {f} Hz appear when sampled at {fs} Hz?

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

::: part
answer: f2 - 2*B
unit: kHz
tolerance: 0.5%

### What guard band does a {B} kHz signal sampled at {f2} kHz leave?

::: misses
- [any] $f_s - 2B$.
:::
:::
:::

::: check
kind: parts
given: fs = 24 | 96; M = 2 | 4; L = 3 | 5

## A {fs} kHz signal is decimated by {M}, or alternatively interpolated by {L}.

::: part
answer: pi/M
unit: rad
tolerance: 0.5%

### What anti-aliasing cutoff does decimation need, at the old rate?

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

::: part
answer: fs*L
unit: kHz
tolerance: 0.5%

### What rate does interpolation produce?

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

::: check
kind: parts
given: fs = 8000 | 32000; N = 256 | 2048; A = 1 | 0.2

## An {N}-point DFT at {fs} Hz sees a real cosine of amplitude {A} exactly on a bin.

::: part
answer: fs/N
unit: Hz
tolerance: 0.5%

### How far apart are the bins?

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

::: part
answer: A*N/2
tolerance: 0.5%

### How big is the tone's bin?

::: misses
- [any] AN/2.
:::
:::
:::

::: check
kind: parts
given: m = 8 | 11 | 13; M = 65 | 129

## A $2^{\given{m}}$-point FFT is used for overlap-add with a {M}-tap filter.

::: part
answer: 2^(m - 1)*m
tolerance: 0.5%

### How many complex multiplications does one FFT need?

::: misses
- [any] $\frac N2\log_2N$.
:::
:::

::: part
answer: 2^m - M + 1
tolerance: 0

### How many new samples does each block take?

::: misses
- [any] N − M + 1.
:::
:::
:::

::: check
kind: parts
given: N = 7 | 31 | 255; s = -12 | -6 | 0

## A known {N}-sample pulse is detected with a matched filter; the per-sample SNR is {s} dB.

::: part
answer: s + 10*log(N)
unit: dB
tolerance: 0.5%

### What is the SNR at the filter's output peak?

::: misses
- [any] Add $10\log_{10}N$.
:::
:::

::: part
answer: 10*log(N)
unit: dB
tolerance: 0.5%

### How much of that is the filter's gain?

::: misses
- [any] $10\log_{10}N$.
:::
:::
:::
:::
