This tutorial works through exam-style problems on the material of Lectures 5 to 8. Each problem gives the full question, then a step-by-step solution.
Each section is one problem. Attempt it before opening the solution.
This problem applies the bilinear-transform design of Section 8.3 to a low-pass specification, using the Butterworth design equations of Lecture 5 (Eqs. 5.4 to 5.7). It follows the same steps as Example 8.2.
Low-pass IIR filter design
A digital Butterworth low-pass filter is required. Its frequency response must satisfy
The sampling period is \(T=1\). Design the filter using a Butterworth low-pass prototype and the bilinear transform (BLT). Numerical values are required for the prewarped edges, filter order and cutoff frequency. However, the transfer functions \(H_{LP}(s)\) and \(H(z)\) may be left in clearly defined symbolic form; numerical coefficient expansion is not required.
The order-\(N\) Butterworth low-pass filter with cutoff \(\Omega_c\) has the squared magnitude of Eq. (5.4),
and its \(N\) left-half-plane poles, Eq. (5.7), lie on a circle of radius \(\Omega_c\):
Here \(N\) is the order, \(\Omega_c\) the \(-3\,\text{dB}\) cutoff and \(p_k\) the poles. No frequency transformation is needed: the prototype is designed directly at the prewarped edges.
The two bounds are the linear passband and stopband gains, equivalent to \(G_p=-1\,\text{dB}\) and \(G_s=-60\,\text{dB}\):
With \(T=1\), Eq. (8.11) gives
The naive values \(\omega/T\) would be 0.9425 and 1.8850; the stopband edge moves much further because \(\tan\) grows faster than linearly.
The minimum Butterworth order, Eq. (5.5), is
With \(1/A_p^2-1\approx0.2589\), \(1/A_s^2-1=10^{6}-1\approx10^6\) and \(\Omega_s/\Omega_p=\tan(0.3\pi)/\tan(0.15\pi)\approx2.7013\):
The cutoff that meets the passband edge exactly, Eq. (5.6), is
With \(N=8\):
Substitute \(N=8\) and \(\Omega_c=1.1088\ \text{rad/s}\) into Eq. (5.4):
With \(N=8\), Eq. (5.7) places the eight left-half-plane poles at
so that
Substitute the bilinear transform with \(T=1\) into \(H_{LP}(s)\) from Step 6:
On the unit circle, \(z=e^{j\omega}\) and the bilinear transform gives \(s=j\Omega\) with \(\Omega=2\tan(\omega/2)\). The digital response therefore equals the analog response of Step 6 at the warped frequency:
Passband edge, \(\omega=0.3\pi\)
\(0.8913\ge0.89125\): the passband requirement is met, exactly at the limit, because Step 5 chose \(\Omega_c\) to make \((\Omega_p/\Omega_c)^{16}=1/A_p^2-1\).
Stopband edge, \(\omega=0.6\pi\)
\(6.93\times10^{-4}\le0.001\): the stopband requirement is met with a margin of \(3.2\ \text{dB}\).
The response decreases monotonically from 0 dB at \(\omega=0\), so it stays above \(-1\,\text{dB}\) for \(0\le\omega\le0.3\pi\) and below \(-63.2\,\text{dB}\) for \(0.6\pi\le\omega\le\pi\). Both requirements are met: the passband exactly, the stopband with a 3.2 dB margin. The \(-3\,\text{dB}\) point is at \(\omega_c=2\arctan(\Omega_c/2)\approx0.322\pi\). Figure 9.1 draws the gain against the mask.
Compared with Example 8.2 (\(0.2\pi\) to \(0.4\pi\), \(-40\,\text{dB}\), \(N=7\)), the transition ratio \(\Omega_s/\Omega_p\) here is wider, but the extra 20 dB of stopband attenuation still needs one more order.
This problem uses the Butterworth design equations of Lecture 5 (Eqs. 5.4 to 5.7), the low-pass to high-pass transformation of Eq. (8.3.b), and the bilinear transform with prewarping of Section 8.3. Problem 9.1 is the low-pass version of the same procedure; this problem adds the low-pass to high-pass transformation.
High-pass IIR filter design
A digital Butterworth high-pass filter is required. Its frequency response must satisfy
The sampling period is \(T=1\). Design the filter using a Butterworth low-pass prototype and the bilinear transform (BLT). Numerical values are required for the prewarped edges, filter order and cutoff frequency. However, the transfer functions \(H_{LP}(s)\), \(H_{HP}(s)\) and \(H(z)\) may be left in clearly defined symbolic form; numerical coefficient expansion is not required.
Primes mark prototype quantities. The order-\(N\) Butterworth low-pass prototype with cutoff \(\Omega_c'\) has the squared magnitude of Eq. (5.4),
and its \(N\) left-half-plane poles, Eq. (5.7), lie on a circle of radius \(\Omega_c'\):
Here \(N\) is the order, \(\Omega_c'\) the \(-3\,\text{dB}\) cutoff and \(p_k\) the poles.
For a high-pass filter the stopband is the low band and the passband the high band. The two bounds are the linear gains, equivalent to \(G_s=-20\,\text{dB}\) and \(G_p=-1\,\text{dB}\):
With \(T=1\), Eq. (8.11) gives
The low-pass to high-pass transformation of Eq. (8.3.b), with the scaling constant set to the passband edge, is \(s\to\Omega_p/s\). On the \(j\Omega\) axis it maps \(\Omega\) to \(\Omega'=\Omega_p/\Omega\):
The gains \(A_p\) and \(A_s\) are unchanged.
The minimum Butterworth order, Eq. (5.5), is
With \(1/A_p^2-1\approx0.2589\), \(1/A_s^2-1=99\) and \(\Omega_s'/\Omega_p'=2.2361\):
The cutoff that meets the passband edge exactly, Eq. (5.6), is
With \(\Omega_p'=1\) and \(N=4\):
Mapped back with \(\Omega=\Omega_p/\Omega'\), the high-pass \(-3\,\text{dB}\) cutoff is
Substitute \(N=4\) and \(\Omega_c'=1.1840\) into Eq. (5.4):
With \(N=4\), Eq. (5.7) places the four left-half-plane poles at
so that
The high-pass filter follows from \(s\to\Omega_p/s\):
Substitute the bilinear transform with \(T=1\) into \(H_{HP}(s)\) from Step 7:
The four zeros at \(s=0\) map to four zeros at \(z=1\) (\(\omega=0\)).
On the unit circle, \(z=e^{j\omega}\) and the bilinear transform gives \(s=j\Omega\) with \(\Omega=2\tan(\omega/2)\). With \(\Omega'=\Omega_p/\Omega\) in \(|H_{LP}|^2\), the high-pass response is
Stopband edge, \(\omega=0.2\pi\)
\(0.0784\le0.1\): the stopband requirement is met with a margin of \(2.1\ \text{dB}\).
Passband edge, \(\omega=0.4\pi\)
\(0.8913\ge0.89125\): the passband requirement is met, exactly at the limit, because Step 6 chose \(\Omega_c'\) to make \((\Omega_c/\Omega_p)^{8}=1/A_p^2-1\).
\(|H(e^{j\omega})|\) increases monotonically from 0 at \(\omega=0\) to 1 at \(\omega=\pi\), because \(\tan(\omega/2)\) increases monotonically on \(0\le\omega<\pi\). The response is therefore below 0.0784 throughout \(0\le\omega\le0.2\pi\) and above 0.89125 throughout \(0.4\pi\le\omega\le\pi\). The \(-3\,\text{dB}\) point is at \(\omega_c=2\arctan(\Omega_c/2)\approx0.350\pi\). Figure 9.2 draws the response against the mask.
The order of operations is the one in Section 8.1.3: prewarp, transform to the low-pass prototype, design, transform back, then apply the bilinear transform. Because the bilinear transform has no aliasing, it suits a high-pass filter, whose response stays near 1 up to \(\omega=\pi\) (Problem 8.3).
This problem designs the FIR filter of a rational sample-rate converter by the window method of Lecture 7, first with a fixed window and then with a Kaiser window (Eqs. 7.15 to 7.22).
FIR low-pass filter for sample-rate conversion
The system in Figure 9.3.a changes the sampling rate by first upsampling by \(U=2\) and then downsampling by \(D=3\). The input is bandlimited to \(|\omega|\leq \pi/3\) and has unity peak magnitude, \(X(e^{j0})=1\). At every point in the system, \(\omega\) denotes digital angular frequency in rad/sample, normalized to the sampling rate at that point.
Design the low-pass FIR filter \(H(z)\) for a passband ripple of \(A_p=0.1\,\mathrm{dB}\) and a minimum stopband attenuation of \(A_s=60\,\mathrm{dB}\). The nominal passband gain must be \(G=U=2\), so that the complete converter preserves the time-domain amplitude of the reconstructed signal.
Fixed-window table (Lecture 7, Table 7.4). Main-lobe width \(K\pi/L\) with \(L=M+1\) taps; \(G_p\) and \(G_s\) are the passband and stopband gains of a window-designed low-pass filter.
Upsampling by \(U\) raises the rate by 2 and downsampling by \(D\) lowers it by 3, so
Upsampling divides every digital frequency by \(U\); downsampling multiplies it by \(D\). The input edge \(\pi/3\) therefore moves to
This is below \(\pi\), so the converted signal fits in the output band without aliasing.
Inserting \(U-1=1\) zero between samples compresses the spectrum by 2:
Within \(-\pi\le\omega\le\pi\) there are two kinds of copy, each of peak 1: the baseband copy on \(|\omega|\le\pi/6\), and the image centred at \(\pm\pi\), occupying \(5\pi/6\le|\omega|\le\pi\).
The filter must keep the baseband copy and remove the nearest image. The passband edge is the baseband edge, and the stopband edge is where the image begins:
The ideal cutoff sits at the centre of the transition band, Eq. (7.20):
After filtering, the signal occupies \(|\omega|\le\pi/6<\pi/D=\pi/3\), so the downsampler does not alias it. The transition band \(\pi/6<|\omega|<5\pi/6\) contains no signal, so its shape does not matter.
The filter has gain \(G=U=2\) in the passband and removes the image:
with peak 2. The image remains only at the stopband level, at most \(2\delta_s\); Step 7 makes this meet the specification.
Keeping every third sample stretches the spectrum by 3 and scales it by \(1/D\):
with peak \(2/3\). The gain of 2 restores the time-domain amplitude: the area under one period of the spectrum is \(\tfrac{1}{2}\cdot\tfrac{2\pi}{3}\cdot1=\tfrac{\pi}{3}\) for \(X\) and \(\tfrac{1}{2}\cdot\pi\cdot\tfrac{2}{3}=\tfrac{\pi}{3}\) for \(Z\), so \(z[0]=x[0]=1/6\). Figure 9.3.b draws all four stages.
Follow the recipe of Section 7.5.1. The ripple and attenuation are given as positive dB numbers, so \(G_p=-0.1\,\text{dB}\) and \(G_s=-60\,\text{dB}\). Eq. (7.18) gives
A window design produces a unit-gain filter within \(1\pm\delta_p\) in the passband and below \(\delta_s\) in the stopband. Multiplying the coefficients by \(G=2\) scales both deviations by 2. The passband ripple is relative to the nominal gain, so \(\delta_p\) is unchanged. The stopband limit is an absolute level, so the unit-gain design must satisfy \(2\delta_s\le0.001\):
The window must meet the tighter tolerance, Eq. (7.22):
This is the stopband gain the window must reach, \(G_s\approx-66.02\,\text{dB}\).
From the table, the stopband gains are \(-21\) (rectangular), \(-26\) (Bartlett), \(-44\) (Hann) and \(-53\,\text{dB}\) (Hamming): none reaches \(-66.0\,\text{dB}\). Blackman gives \(G_s=-74\,\text{dB}\le-66.0\,\text{dB}\) and \(G_p=-0.0017\,\text{dB}\ge-0.1\,\text{dB}\), so it is the first window that meets both. Blackman has \(K=12\).
Eq. (7.15) sets the main-lobe width \(K\pi/L\) equal to \(\Delta\omega\):
Choose a Type I filter: round \(M\) up to the next even integer, so that the impulse response has a centre sample and an integer group delay.
at the filter's sampling rate \(2F_x\).
The linear tolerances are those of Step 7, \(\delta_p\approx0.0114\) and \(\delta_s=0.0005\), so \(-G_s=66.02\,\text{dB}\). Since \(-G_s>50\), the top case of Eq. (7.17) applies:
Round up to the next even integer for a Type I filter:
The coefficients are \(h[n]=2\,\dfrac{\sin(\omega_c(n-7))}{\pi(n-7)}\,w_K[n]\), \(0\le n\le14\), with \(w_K[n]\) from Eq. (7.16) at \(\beta=6.32\). After scaling by 2, the stopband stays below \(2\times0.0005=0.001\), as required.
The Kaiser design uses \(L=15\) coefficients against Blackman's 19, which is 4 fewer (21% fewer). Both are symmetric Type I filters, so the number of distinct multipliers is \((L+1)/2\): 8 against 10. The delay falls from 9 to 7 samples at the rate \(2F_x\), that is, from 4.5 to 3.5 input sample periods. Blackman is longer because its fixed \(-74\,\text{dB}\) stopband exceeds the \(-66.0\,\text{dB}\) requirement, while \(\beta\) tunes the Kaiser window to the requirement.
The same comparison appears in Examples 7.7 and 7.8; here the specification comes from the upsampler image rather than being given directly.
The reference sheet: the formulas used in this tutorial, in the order they are applied. The last row covers the FIR design of Problem 9.3.