NivaarExam PrepOfficial exam papers ↗

22-Elec-B1 Digital Signal Processing · December 2013

Question 1 of 5: Impulse and Frequency Response of a Three-Tap FIR System

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

Paper format. National Exams, 07-Elec-B1 Digital Signal Processing, December 2013 — 3 hours, closed book, approved calculator plus one double-sided aid sheet. Five questions of 25 marks each; the paper states that FOUR questions constitute a complete paper, so a candidate answers any four. All five are solved here, because the set is a study resource.

Reference texts.

Question 1: Impulse and Frequency Response of a Three-Tap FIR System (25 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Given. A causal LTI system described by the three-tap non-recursive difference equation $y[n] = -x[n] + 2x[n-1] - x[n-2]$, i.e. tap weights $b_0 = -1$, $b_1 = +2$, $b_2 = -1$ with no feedback terms. For part (d) the input is the two-tone (in fact DC-plus-complex-exponential) sequence $x_1[n] = 1 + e^{j0.5\pi n}$, applied for all $n$.

Find. (a) $h[n]$; (b) $H(e^{j\omega})$ written as a real amplitude $A(e^{j\omega})$ times a pure delay $e^{-j\omega n_d}$, with both quantities stated explicitly; (c) labelled magnitude and phase sketches over $-\pi \le \omega \le \pi$; (d) the steady-state output $y_1[n]$ obtained from the frequency response alone.

-2-101234-112-12-1nh[n]
Impulse response h[n] = -1, +2, -1 for n = 0, 1, 2. The sequence is symmetric about n = 1, which is what makes the phase exactly linear.

Approach. Read the impulse response straight off the tap weights, take the DTFT of that three-term sum, factor out the common delay term so the remainder collapses to a real cosine expression, and then use the eigenfunction property of LTI systems to pass each complex exponential of the part (d) input through the resulting gain.

  1. Excite the difference equation with a unit impulse. The equation is non-recursive, so setting $x[n] = \delta[n]$ makes every term an isolated impulse: $h[n] = -\delta[n] + 2\delta[n-1] - \delta[n-2]$. Written as a list of samples, $$\boxed{\,h[n] = \{\,\underset{n=0}{-1},\ 2,\ -1\,\}\,}$$ and $h[n] = 0$ for $n \lt 0$ and $n \gt 2$. The system is therefore a causal FIR filter of length 3 (order 2), and it is BIBO stable because $\sum_n |h[n]| = 4 \lt \infty$.
  2. Transform the impulse response. The frequency response is the DTFT of $h[n]$: $$H(e^{j\omega}) = \sum_{n=-\infty}^{\infty} h[n]e^{-j\omega n} = -1 + 2e^{-j\omega} - e^{-j2\omega}.$$ Nothing has been assumed here beyond linearity and time invariance; the sum converges for every $\omega$ because $h[n]$ has finite length.
  3. Factor out the mid-point delay. Pulling $e^{-j\omega}$ out of all three terms leaves a conjugate-symmetric pair that combines into a cosine: $$H(e^{j\omega}) = e^{-j\omega}\left(-e^{j\omega} + 2 - e^{-j\omega}\right) = e^{-j\omega}\bigl(2 - 2\cos\omega\bigr).$$ Comparing with the requested form $H = A(e^{j\omega})e^{-j\omega n_d}$ gives $$\boxed{\,A(e^{j\omega}) = 2\left(1 - \cos\omega\right) = 4\sin^{2}\!\left(\tfrac{\omega}{2}\right), \qquad n_d = 1\,}$$ so the system delays every frequency by exactly one sample. That is the expected result: $h[n]$ is symmetric about $n = 1$, which is the defining condition for a Type I generalized-linear-phase FIR filter with group delay $(M)/2 = 1$ for order $M = 2$.
  4. Deduce the magnitude and phase from the sign of $A(e^{j\omega})$. Because $4\sin^{2}(\omega/2) \ge 0$ for every $\omega$, the amplitude never changes sign, so no extra $\pi$ jumps appear in the phase. Hence $$|H(e^{j\omega})| = 2(1-\cos\omega), \qquad \angle H(e^{j\omega}) = -\omega, \quad |\omega| \le \pi .$$ The magnitude is zero at $\omega = 0$, equals $2$ at $\omega = \pm\pi/2$, and reaches its maximum $4$ at $\omega = \pm\pi$: the filter is a highpass (second-difference) operator that annihilates DC. The phase is the straight line of slope $-1$ sample.
-pi-pi/20pi/2pi1234peak 4 at w = +/- piw|H(e^jw)|-pi-pi/20pi/2pi-pipislope -1 sample (exact linear phase)warg H(e^jw)
Part (c): magnitude |H| = 2(1 - cos w) rises monotonically from 0 at w = 0 to 4 at w = +/- pi, and the phase is the exact straight line arg H = -w (one-sample group delay).

With the frequency response in hand, part (d) needs no convolution at all — a complex exponential is an eigenfunction of any LTI system, so each component of the input is simply multiplied by the value of H at that frequency.

  1. Evaluate $H$ at the two input frequencies. The input $x_1[n] = 1 + e^{j0.5\pi n}$ contains a DC term ($\omega = 0$) and a complex exponential at $\omega = 0.5\pi$. Substituting into $A(e^{j\omega})e^{-j\omega}$: $$H(e^{j0}) = 2(1 - \cos 0)\,e^{-j0} = 0, \qquad H(e^{j0.5\pi}) = 2\left(1 - \cos\tfrac{\pi}{2}\right)e^{-j\pi/2} = 2e^{-j\pi/2} = -2j .$$ The DC gain is exactly zero, so the constant part of the input is removed completely.
  2. Apply the eigenfunction property term by term. For $x[n] = e^{j\omega_0 n}$ the output is $H(e^{j\omega_0})e^{j\omega_0 n}$, so by linearity $$y_1[n] = \underbrace{0 \cdot 1}_{\text{DC removed}} + 2e^{-j\pi/2}e^{j0.5\pi n} \;\Longrightarrow\; \boxed{\,y_1[n] = 2\,e^{j0.5\pi (n-1)} = -2j\,e^{j0.5\pi n}\,}$$ valid for all $n$. The result is the input exponential amplified by 2 and delayed by exactly one sample, which is precisely what parts (b) and (c) predicted. Substituting $y_1[n]$ back into the original difference equation confirms it identically.
Question 1 — final results
PartQuantityResult
(a)Impulse response$h[n] = \{-1,\,2,\,-1\}$ at $n = 0,1,2$; zero elsewhere
(b)Amplitude function$A(e^{j\omega}) = 2(1-\cos\omega) = 4\sin^{2}(\omega/2)$
(b)Delay$n_d = 1$ sample (Type I linear phase)
(c)Magnitude$0$ at $\omega = 0$, $2$ at $\pm\pi/2$, maximum $4$ at $\pm\pi$ (highpass)
(c)Phase$\angle H = -\omega$ exactly, $|\omega| \le \pi$
(d)Output$y_1[n] = 2e^{j0.5\pi(n-1)} = -2j\,e^{j0.5\pi n}$
← Paper overview