Worksheet 9#

To accompany Unit 4.4 Introduction to Filters#

This worksheet can be downloaded as a PDF file. We will step through this worksheet in class.

An annotatable copy of the notes for this presentation will be distributed before the second class meeting as Worksheet 9 in the Week 6: Classroom Activities section of the Canvas site. I will also distribute a copy to your personal Worksheets section of the OneNote Class Notebook so that you can add your own notes using OneNote.

You are expected to have at least watched the video presentation of Unit 4.4: Introduction to Filters of the notes before coming to class. If you haven’t watch it afterwards!

After class, the lecture recording and the annotated version of the worksheets will be made available through Canvas.We will step through this worksheet in class.

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 frequencies 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

Filtering#

Results of filtering

Motivating example#

See the video and script on Motivating Example: Filter Design Using MATLAB on Canvas.

Ideal Low-Pass Filter (LPF)#

An ideal low pass filter cuts-off frequencies higher than its cutoff frequency, ωc.

Hlp(ω)={1,|ω|ωc0,|ω|ωc

Frequency response of an ideal LPF#

Frequency response of an ideal LPF

Impulse response of an ideal LPF#

hlp(t)=ωcπsinc(ωcπt)

Impulse response of an ideal LPF

Filtering is Convolution#

The output of an LTI system with impulse response

h(t)H(ω)

subject to an input signal

x(t)X(ω)

is given by

y(t)=h(t)x(t)Y(ω)=H(ω)X(ω)

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

|HB(ω)|=1(1+(ωωc)2N)12

Remarks

  • DC gain is

    |HB(j0)|=1
  • Attenuation at the cut-off frequency is

    |HB(jωc)|=1/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 Characteristic Equation (CE):

p(s)=s2+ωc2s+ωc2=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 ζ=1/2 and ωn=ωc!

Solution to example 5#
























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 ωc.

Solution to example 6#
























Example 7#

Determine the frequency response HB(ω)=Y(ω)/X(ω)

Solution to example 7#
























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

cd ../matlab
format compact; setappdata(0, "MKernel_plot_format", 'svg')
open butter2_ex
wc = 100;

Transfer function

H = tf(wc^2,[1, wc*sqrt(2), wc^2])

Poles of H(s)

[poles] = pole(H)

Natural frequency ωn and damping ratio ζ of the poles

[wn,zeta] = damp(H)

Phase of the poles

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

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

Bode plot

bode(H)
grid
title('Bode-plot of Butterworth 2nd-Order Butterworth Low Pass Filter')

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

In this case, N=2, and ωc=100 rad/s so the attenuation is -40 dB at ω=10ωc=1,000 rad/s and ω=80 dB at ω=100ωc=10,000 rad/s.

The phase is 0 at ω=0; N×90 at ω=; and N×45 and ω=ωc.

Example 8#

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

You will find this Fourier transform pair useful:

eatsinω0tu0(t)ω0(jω+a)2+ω02

Solution to example 8#
























Impulse response

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

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')

High-pass filter (HPF)#

An ideal highpass filter cuts-off frequencies lower than its cutoff frequency, ωc.

Hhp(ω)={0,|ω|ωc1,|ω|>ωc

Frequency response of an ideal HPF#

Frequency response of an ideal HPF

Responses#

Frequency response

Hhp(ω)=1Hlp(ω)

Impulse response

hhp(t)=δ(t)hlp(t)

Example 9#

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

Solution to example 9#
























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

High-pass filter

Hhp = 1 - H
bode(Hhp)
grid
title('Bode-plot of Butterworth 2nd-Order Butterworth High Pass Filter')

Band-pass filter (BPF)#

An ideal bandpass filter cuts-off frequencies lower than its first cutoff frequency ωc1, and higher than its second cutoff frequency ωc2.

Hbp(ω)={1,ωc1<|ω|<ωc20,otherwise

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.

Hbp(ω)=Hhp(ω)Hlp(ω)
  • The highpass filter should have cut-off frequency of ωc1

  • The lowpass filter should have cut-off frequency of ωc2

Solutions#

Solutions to Examples 5-9 are captured as a PenCast which you will find attached to the Worked Solutions section of the Week 6 Section of the Canvas course site or here filters2.pdf