Lecture 12: Filtering - MIT OpenCourseWare

12
12 Filtering In discussing Fourier transforms, we developed a number of important prop- erties, among them the convolution property and the modulation property. The convolution property forms the basis for the concept of filtering, which we explore in this lecture. Our objective here is to provide some feeling for what filtering means and in very simple terms how it might be implemented. The concept of filtering is a direct consequence of the fact that for linear, time-invariant systems the Fourier transform of the output is the Fourier transform of the input multiplied by the frequency response, i.e., the Fourier transform of the impulse response. Because of this, the frequency content of the output is the frequency content of the input shaped by this frequency re- sponse. Frequency-selective filters attempt to exactly pass some bands of fre- quencies and exactly reject others. Frequency-shaping filters more generally attempt to reshape the signal spectrum by multiplying the input spectrum by some specified shaping. Ideal frequency-selective filters, such as lowpass, highpass, and bandpass filters, are useful abstractions mathematically but are not exactly implementable. Furthermore, even if they were implementable, in practical situations they may not be desirable. Often frequency-selective fil- tering is directed at problems where the spectra of the signals to be retained and those to be rejected overlap slightly; consequently it is more appropriate to design filters with a less severe transition from passband to stopband. Thus, nonideal frequency-selective filters have a passband region, a stopband region, and a transition region between the two. In addition, since they are only realized approximately, a certain tolerance in gain is permitted in the passband and stopband. A very common example of a simple approximation to a frequency-selec- tive filter is a series RC circuit. With the output taken across the capacitor, the circuit tends to reject or attenuate high frequencies and thus is an approxima- tion to a lowpass filter. With the output across the resistor, the circuit ap- proximates a highpass filter, that is, it attenuates low frequencies and retains high frequencies. Many simple, commonly used approximations to frequency-selective dis- crete-time filters also exist. A very common one is the class of moving average filters. These have a finite-length impulse response and consist of moving through the data, averaging together adjacent values. A procedure of this type 12-1

Transcript of Lecture 12: Filtering - MIT OpenCourseWare

Page 1: Lecture 12: Filtering - MIT OpenCourseWare

12Filtering

In discussing Fourier transforms, we developed a number of important prop-erties, among them the convolution property and the modulation property.The convolution property forms the basis for the concept of filtering, whichwe explore in this lecture. Our objective here is to provide some feeling forwhat filtering means and in very simple terms how it might be implemented.

The concept of filtering is a direct consequence of the fact that for linear,time-invariant systems the Fourier transform of the output is the Fouriertransform of the input multiplied by the frequency response, i.e., the Fouriertransform of the impulse response. Because of this, the frequency content ofthe output is the frequency content of the input shaped by this frequency re-sponse. Frequency-selective filters attempt to exactly pass some bands of fre-quencies and exactly reject others. Frequency-shaping filters more generallyattempt to reshape the signal spectrum by multiplying the input spectrum bysome specified shaping. Ideal frequency-selective filters, such as lowpass,highpass, and bandpass filters, are useful abstractions mathematically but arenot exactly implementable. Furthermore, even if they were implementable, inpractical situations they may not be desirable. Often frequency-selective fil-tering is directed at problems where the spectra of the signals to be retainedand those to be rejected overlap slightly; consequently it is more appropriateto design filters with a less severe transition from passband to stopband.Thus, nonideal frequency-selective filters have a passband region, a stopbandregion, and a transition region between the two. In addition, since they areonly realized approximately, a certain tolerance in gain is permitted in thepassband and stopband.

A very common example of a simple approximation to a frequency-selec-tive filter is a series RC circuit. With the output taken across the capacitor, thecircuit tends to reject or attenuate high frequencies and thus is an approxima-tion to a lowpass filter. With the output across the resistor, the circuit ap-proximates a highpass filter, that is, it attenuates low frequencies and retainshigh frequencies.

Many simple, commonly used approximations to frequency-selective dis-crete-time filters also exist. A very common one is the class of moving averagefilters. These have a finite-length impulse response and consist of movingthrough the data, averaging together adjacent values. A procedure of this type

12-1

Page 2: Lecture 12: Filtering - MIT OpenCourseWare

Signals and Systems12-2

is very commonly used with stock market averages to smooth out (i.e., reject)the high-frequency day-to-day fluctuations and retain the lower-frequency be-havior representing long-time trends. Cyclical behavior in stock market aver-ages might typically be emphasized by an appropriate discrete-time filter witha bandpass characteristic. In addition to discrete-time moving average filters,recursive discrete-time filters are very often used as frequency-selective fil-ters. In the same way that a simple RC circuit can be used as an approxima-tion to a lowpass or highpass filter, a first-order difference equation is often asimple and convenient way of approximating a discrete-time lowpass or high-pass filter.

In this lecture we are able to provide only a very quick glimpse into thetopic of filtering. In all its dimensions, it is an extremely rich topic with manydetailed issues relating to design, implementation, applications, and so on. Inthe next and later lectures, the concept of filtering will play a very natural andimportant role.

Suggested ReadingSection 6.1, Ideal Frequency-Selective Filters, pages 401-406

Section 6.2, Nonideal Frequency-Selective Filters, pages 406-408

Section 6.3, Examples of Continuous-Time Frequency-Selective Filters De-scribed by Differential Equations, pages 408-413

Section 6.4, Examples of Discrete-Time Frequency-Selective Filters De-scribed by Difference Equations, pages 413-422

Page 3: Lecture 12: Filtering - MIT OpenCourseWare

Filtering

Conve+'d0 - egert

C ) .-nm

vr~ -7 -4

I

12-3

MARKERBOARD12.1

TRANSPARENCY12.1Frequency response ofideal lowpass, high-pass, and bandpasscontinuous-timefilters.

Page 4: Lecture 12: Filtering - MIT OpenCourseWare

Signals and Systems

12-4

TRANSPARENCY12.2Frequency response ofideal lowpass, high-pass, and bandpassdiscrete-time filters.

TRANSPARENCY12.3The impulse responseand step response ofan ideal continuous-time lowpass filter.

H(w)

1

-oc 0 c Li

hq,(t)

W4=;pX IZ ir 11_ 1F / i %-

0 r

Page 5: Lecture 12: Filtering - MIT OpenCourseWare

Filtering12-5

H(92)

F2l-2v -V -9c 0 92.

I F7r 2v n

hv [n]

s[n] = I hp [k]k=- o

TRANSPARENCY12.4The impulse responseand step response ofan ideal discrete-timelowpass filter.

IH(w)|I

////////

I" \

Passband ITransition |\ I

Stopband

- I - ~

0 W,

TRANSPARENCY12.5Approximation to acontinuous-timelowpass filter.

17

1 +51

82

Page 6: Lecture 12: Filtering - MIT OpenCourseWare

Signals and Systems12-6

|H (92)1TRANSPARENCY12.6 1 + 6 /Approximation to adiscrete-time lowpassfilter. . "

MARKERBOARD12.2

Page 7: Lecture 12: Filtering - MIT OpenCourseWare

Filtering12-7

20203 dB

0 dB - - Asymptotic3 approximation

-20 TRANSPARENCY_ 12.7

S=- Rc CBode plots for a first--40 order RC circuit

approximation to alowpass filter and a

-60 highpass filter.0.1 /r 1/7- 10/r 100/r

20

Asymptotic

0 dB approximation

I

o -20

0r=RC

-40

-600.1 /r

I I I I I I1/r- 10/r 100/r

Page 8: Lecture 12: Filtering - MIT OpenCourseWare

Signals and Systems12-8

TRANSPARENCY12.8A three-point movingaverage discrete-timefilter.

TRANSPARENCY12.9A general discrete-time moving averagefilter.

NON-RECURSIVE (MOVING AVERAGE) FILTERS

Three-point moving average:

y[n] = lx[n-1] +x[n] +x[n+1]1

x[n]

Go*_ I

990

000 0

y[n] = 1 x[n-1] + x[n] + x[n+1]

3

y~nI = N Y~+ x[n-kIk=- N

M

y[n] = bk x[n-k]k=-N

-N 0 M

Page 9: Lecture 12: Filtering - MIT OpenCourseWare

Filtering12-9

Example 5.7:x [n]

IMW OW W w- - **.&-S@S-2 0 2 nl

X (92)

27r 92

TRANSPARENCY12.10Impulse response andfrequency responsefor a five-point movingaverage lowpass filterwith equal weights.[Example 5.7 from thetext.]

0.0650.0200.0250.070

o' 0 0.05 0.10

-100

-120 L-140

-160 I I I ~ I I

~ I~fff~ 'II I I I I I I

TRANSPARENCY12.11Frequency response ofan optimally designedmoving average filterwith 256 weights.

- 27r

77r,11

Page 10: Lecture 12: Filtering - MIT OpenCourseWare

Signals and Systems

12-10

TRANSPARENCY12.12Difference equationand block diagram fora recursive discrete-time filter.

TRANSPARENCY12.13Determination of thefrequency response ofa first-order systemusing the properties ofthe Fourier transform.[Example 5.5 from thetext.]

x[n] h[n] y[n]

X(W) H (2) Y(W)

y[n] -

Y(&2) -

ay[n-1] = x[n]

Ia e-iE Y(W) = X(&2)

Y(2) = -a X(92)

H(92) =1-a e

1"u[n] + 1-

1-a e-jQ

(Example 5.5)h [n]

Page 11: Lecture 12: Filtering - MIT OpenCourseWare

Filtering12-11

I H (2) 1

h[n] O< a< 1 1a) TRANSPARENCY12.14Illustration of the

a) impulse response andfrequency response

2i -n 0 I 27T for a first-ordersystem.

i H(2) I

h[n] <a<0 -1 L-

0 7T 2r

Page 12: Lecture 12: Filtering - MIT OpenCourseWare

MIT OpenCourseWare http://ocw.mit.edu

Resource: Signals and Systems Professor Alan V. Oppenheim

The following may not correspond to a particular course on MIT OpenCourseWare, but has been provided by the author as an individual learning resource.

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.