Unit 4.4: Introduction to Filters#

Colophon#

An annotatable worksheet for this presentation is available as Worksheet 9.

Scope and Background Reading#

This section is Based on the section Filtering from Chapter 5 of Benoit Boulet, Fundamentals of Signals and Systems[Boulet, 2006] from the Recommended Reading List.

This material is an introduction to analogue filters. You will find much more in-depth coverage on Pages 11-1—11-48 of [Karris, 2012].

Agenda#

  • Frequency Selective Filters

  • Ideal low-pass filter

  • Butterworth low-pass filter

  • High-pass filter

  • Bandpass filter

Introduction#

  • Filter design is an important application of the Fourier transform

  • Filtering is a rich topic often taught in graduate courses so we give only an introduction.

  • Our introduction will illustrate the usefulness of the frequency domain viewpoint.

  • We will explore how filters can shape the spectrum of a signal.

Other applications of the Fourier transform are sampling theory (introduced next week) and modulation.

Frequency Selective Filters#

An ideal frequency-selective filter is a system that let’s the frequency components of a signal through undistorted while frequency components at other frequency are completely cut off.

  • The range of frequencies which are let through belong to the pass Band

  • The range of frequencies which are cut-off by the filter are called the stopband

  • A typical scenario where filtering is needed is when noise \(n(t)\) is added to a signal \(x(t)\) but that signal has most of its energy outside the bandwidth of a signal.

Typical filtering problem#

Typical filtering problem

Signal#

Signal

Out-of Bandwidth Noise#

Out of bandwidth noise

Signal plus Noise#

Signal plus noise

Results of filtering#

Results of filtering

Motivating example#

See the video and script on Canvas Week 6.

Ideal Low-Pass Filter (LPF)#

An ideal low pass filter cuts-off frequencies higher than its cut-off frequency, \(\omega_c\).

\[\begin{split}H_{\rm{lp}}(\omega ) = \left\{ {\begin{array}{*{20}{c}} {1,}&{|\omega |{\kern 1pt} \, < {\omega _c}}\\ {0,}&{|\omega |{\kern 1pt} \, \ge {\omega _c}} \end{array}} \right.\end{split}\]

Frequency response of an ideal LPF#

Frequency response of an ideal LPF

Impulse response of an ideal LPF#

\[h_{\rm{lp}}(t) = \frac{\omega _c}{\pi }{\mathop{\rm sinc}\nolimits} \left( \frac{\omega _c}{\pi }t \right)\]

Impulse response of an ideal LPF

Filtering is Convolution#

The output of an LTI system with impulse response

\[h(t) \Leftrightarrow H(\omega)\]

subject to an input signal

\[x(t) \Leftrightarrow X(\omega)\]

is given by

\[y(t) = h(t)*x(t) \Leftrightarrow Y(\omega) = H(\omega)X(\omega)\]

Issues with the “ideal” filter#

This is the step response:

Step response of ideal LPF

(reproduced from [Boulet, 2006] Fig. 5.23 p. 205)

Ripples in the impulse resonse would be undesireable, and because the impulse response is non-causal it cannot actually be implemented.

Butterworth low-pass filter#

N-th Order Butterworth Filter

\[\left| H_B(\omega ) \right| = \frac{1}{\left(1 + \left(\frac{\omega }{\omega _c}\right)^{2N}\right)^{\frac{1}{2}}}\]

Remarks

  • DC gain is

    \[|H_B(j0)|=1\]
  • Attenuation at the cut-off frequency is

    \[|H_B(j\omega_c)|=1/\sqrt{2}\]

    for any \(N\)

More about the Butterworth filter: Wikipedia Article

Example 5: Second-order BW Filter#

The second-order butterworth Filter is defined by is Characteristic Equation (CE):

\[p(s) = s^2 + \omega_c\sqrt{2}s+\omega_c^2 = 0^*\]

Calculate the roots of \(p(s)\) (the poles of the filter transfer function) in both Cartesian and polar form.

Note: This has the same characteristic as a control system with damping ratio \(\zeta = 1/\sqrt{2}\) and \(\omega_n = \omega_c\)!

Example 6#

Derive the differential equation relating the input \(x(t)\) to output \(y(t)\) of the 2nd-Order Butterworth Low-Pass Filter with cutoff frequency \(\omega_c\).

Example 7#

Determine the frequency response \(H_B(\omega)=Y(\omega)/X(\omega)\)

Magnitude of frequency response of a 2nd-order Butterworth Filter#

wc = 100;

Transfer function

H = tf(wc^2,[1, wc*sqrt(2), wc^2])
H =
 
          10000
  ---------------------
  s^2 + 141.4 s + 10000
 
Continuous-time transfer function.

Poles of \(H(s)\)

[poles] = pole(H)
poles =

 -70.7107 +70.7107i
 -70.7107 -70.7107i

Natural frequency \(\omega_n\) and damping ratio \(\zeta\) of the poles

[mag,phase] = damp(H)
mag =

   100
   100
phase =

    0.7071
    0.7071

Phase of the poles

phase = angle(poles)*180/pi % degrees
phase =

   135
  -135

Magnitude frequency response

w = -400:400;
mHlp = 1./(sqrt(1 + (w./wc).^4));
plot(w,mHlp)
grid
ylabel('|H_B(j\omega)|')
title('Magnitude Frequency Response for 2nd-Order LP Butterworth Filter (\omega_c = 100 rad/s)')
xlabel('Radian Frequency \omega [rad/s]')
text(100,0.1,'\omega_c')
text(-100,0.1,'-\omega_c')
hold on
plot([-400,-100,-100,100,100,400],[0,0,1,1,0,0],'r:')
hold off
../../_images/b6c1fee972194f945c0e33b9a2f8fde486aa3a2c8e249df4189544e36204bf50.png

Bode plot

bode(H)
grid
title('Bode-plot of Butterworth 2nd-Order Butterworth Low Pass Filter')
../../_images/34e9e72985a313a1abd7cb541e8b1d3ee4342e2dab48c7d70ddc5379d08e7363.png

Note that the attentuation of the filter is flat at 0 dB in the pass-band at frequencies below the cut-off frequency \(\omega < \omega_c\); has a value of \(-3\) dB at the cut-off frquency \(\omega = \omega_c\); and has a “roll-off” (rate of decrease) of \(N\times 20\) dB/decade in the stop-band.

In this case, \(N=2\), and \(\omega_c = 100\) rad/s so the attenuation is -40 dB at \(\omega = 10\omega_c = 1,000\) rad/s and \(\omega = -80\) dB at \(\omega = 100\omega_c = 10,000\) rad/s.

The phase is \(0^\circ\) at \(\omega = 0\); \(N\times 90^\circ\) at \(\omega = \infty\); and \(N\times 45^\circ\) and \(\omega = \omega_c\).

Example 8#

Determine the impulse and step response of a butterworth low-pass filter.

You will find this Fourier transform pair useful:

\[e^{-at}\sin\omega_0 t\;u_0(t) \Leftrightarrow \frac{\omega_0}{(j\omega + a)^2+\omega_0^2}\]

Impulse response

impulse(H,0.1)
grid
title('Impulse Response of 2nd-Order Butterworth Low Pass Filter')
../../_images/f561654d1d27348a362eb43c1e9f18b42a20e233bc79bb6a9768ec270b209c2b.png

Step response

step(H,0.1)
title('Step Response of Butterworth 2nd-Order Butterworth Low Pass Filter')
grid
text(0.008,1,'s_B(t) for \omega_c = 100 rad/s')
../../_images/d240df1316b1773bb28de8fde5a24cbf87c03e8d77302ca94610f874ce392d4b.png

High-pass filter (HPF)#

An ideal highpass filter cuts-off frequencies lower than its cutoff frequency, \(\omega_c\).

\[\begin{split}H_{\rm{hp}}(\omega ) = \left\{ {\begin{array}{*{20}{c}} {0,}&{|\omega |{\kern 1pt} \, \le {\omega _c}}\\ {1,}&{|\omega |{\kern 1pt} \, > {\omega _c}} \end{array}} \right.\end{split}\]

Frequency response of an ideal HPF#

Frequency response of an ideal HPF

Responses#

Frequency response

\[H_{\mathrm{hp}}(\omega)=1-H_{\mathrm{lp}}(\omega)\]

Impulse response

\[h_{\mathrm{hp}}(t)=\delta(t)-h_{\mathrm{lp}}(t)\]

Example 9#

Determine the frequency response of a 2nd-order butterworth highpass filter

Magnitude frequency response

w = -400:400;
plot(w,1-mHlp)
grid
ylabel('|H_B(j\omega)|')
title('Magnitude Frequency Response for 2nd-Order HP Butterworth Filter (\omega_c = 100 rad/s)')
xlabel('Radian Frequency \omega [rad/s]')
text(100,0.9,'\omega_c')
text(-100,0.9,'-\omega_c')
hold on
plot([-400,-100,-100,100,100,400],[0,0,1,1,0,0],'r:')
hold off
../../_images/5d2e261f080c56c531605c360033c6bbf35734bcb49008e915cd99c23e27303d.png

High-pass filter

Hhp = 1 - H
bode(Hhp)
grid
title('Bode-plot of Butterworth 2nd-Order Butterworth High Pass Filter')
Hhp =
 
      s^2 + 141.4 s
  ---------------------
  s^2 + 141.4 s + 10000
 
Continuous-time transfer function.
../../_images/11729c4124e6ca4970ac46aa1012e63686164acc913f8bdf571cb4db8f89efec.png

Band-pass filter (BPF)#

An ideal bandpass filter cuts-off frequencies lower than its first cutoff frequency \(\omega_{c1}\), and higher than its second cutoff frequency \(\omega_{c2}\).

\[\begin{split}H_{\rm{bp}}(\omega ) = \left\{ {\begin{array}{*{20}{c}} {1,}&\omega _{c1} < \,|\omega |\, < \omega _{c2}\\ {0,}&\rm{otherwise} \end{array}} \right.\end{split}\]

Frequency response of an ideal BPF#

Frequency response of an ideal BPF

Bandpass filter design#

A bandpass filter can be obtained by multiplying the frequency responses of a lowpass filter by a highpass filter.

\[H_{\mathrm{bp}}(\omega) = H_{\mathrm{hp}}(\omega)H_{\mathrm{lp}}(\omega)\]
  • The highpass filter should have cut-off frequency of \(\omega_{c1}\)

  • The lowpass filter should have cut-off frequency of \(\omega_{c2}\)

Summary#

  • Frequency-Selective Filters

  • Ideal low-pass filter

  • Butterworth low-pass filter

  • High-pass filter

  • Bandpass filter

Solutions#

Handwritten#

Solutions to Examples 5-9 are captured as a PenCast in filters.pdf.

MATLAB#

To generate all the plots shown in this presentation, you can use butter2_ex.mlx