Signals, Instruments, and Systems W6 Introduction to ...

70
Signals, Instruments, and Systems – W6 Introduction to Signal Processing – Analysis and Synthesis of Filters 1

Transcript of Signals, Instruments, and Systems W6 Introduction to ...

Signals, Instruments, and Systems – W6

Introduction to Signal

Processing – Analysis and

Synthesis of Filters

1

Outline

β€’ Motivating examples

β€’ Transforms, transfer functions, terminology

β€’ Bode plots

β€’ Examples of first order analog filters

β€’ Digital filters

Acknowledgment for Selected Slides

Motivating Examples

4

Filtering noisy signals

low pass filter

high pass filter

Solar radiationday/night cycle

changing cloud cover

5

6

spectrum of original signal

spectrum of reconstructed

signal

)(tx x

n

nTttp )(

)(txr)( jH

spectrum of sampled signal

sampling frequency

Ο‰s > 2 Ο‰m

filtering filter cut-off frequency

Ο‰m < Ο‰c < (Ο‰s –ωm)

If there is no overlap between the

shifted spectra the signal xr(t) can be

perfectly reconstructed from x(t))(txp

)()()( jHjXjX pr

Anti-Aliasing Filters

See also Week 5

See also Week 4

AM/FM Modulation

AM Modulation

AM Demodulation

Frequency Domain Multiplexing

Frequency Domain Multiplexing

Frequency Domain Multiplexing

Relevant Transforms,

Transfer Functions,

Terminology

13

Transform Overview

Discrete signal

Time domain

Discrete signal

Frequency domain

Continuous signal

Frequency domain

Continuous signal

Time domain

Fourier/Laplace

Inverse Fourier/Laplace

Z/DTFT

Inverse Z/DTFT

DA

C

AD

C

14

Laplace Transform

is

dttfef(t)sF st

)()(0

L

15

Fourier - Laplace

dttfesF

tftfFF

ti

is

is

)(|)(

|)}({)}({)(

L

The Fourier Transform is a special case of Laplace Transform

Fourier: frequency response (especially in signal processing)

Laplace: impulse response (especially in control)

16

Discrete-Time Fourier Transform

β€’ Corresponds to the Fourier Transform for discrete-time

signals (different from the Discrete Fourier Transform, a

finite, bounded approximation of the Fourier Transform for

digital devices)

β€’ Transform discrete-time signals from time-domain to

frequency domain

n

nienx ][)X(

17

Z Transform

β€’ Corresponds to Laplace transform for time-

discrete signals

β€’ Transform signals from time-domain to frequency

domain

β€’ The Discrete-Time Fourier Transform is a special

case of the Z Transform, A=1.

)sin(cosor

][]}[{)(

jAzAez

znxnxzX

j

n

n

Z

18

Filters

Analog

Digital

1 1( )n ny y f x x

Circuit

FunctionA/D

19

Transfer Functions of FiltersAnalog

Digital

1 1( )n ny y f x x

Circuit

Function

1( )

1

c

in

vH s

v RCs

1

0 1

1

1

( )1

N

N

M

M

b b z b zH z

a z b z

Laplace Transf.

z-Transf.

Numerator

Denominator

Numerator

Denominator20

From System to Frequency Response (1)

Continuous Time (CT)

Discrete Time (DT)

From System to Frequency Response (2)

CT notation

From System to Frequency Response (3)

Frequency Shaping and Filtering

By choice of H(j) as a function of , we can shape the frequency

composition of the output:

- Preferential amplification

- Selective filtering of some frequencies

Example: Audio System

Adjustable

FilterEqualizer Speaker

Bass, Mid-range, Treble controls

For audio signals, the amplitude is much more important than the phase.

CT

c β€” cutoff frequency

DT

Note: |H| = 1 and H = 0 for the ideal filters in the passbands,

no need for the phase plot.

Idealized Low Pass Filter

low

frequency

low

frequency

Low Pass Filter

CT

DT

Idealized High Pass Filter

Remember:

high

frequency

high

frequency

High Pass Filter

Idealized Band Pass Filter

CT

DT

lower cut-off upper cut-off

Band Pass Filter

Bode Plots

31

Bode plot: The Example of a

Low Pass Filter

not to scale !

32

Decibel

Source of sound Sound pressure Sound pressure level

pascal dB re 20 ΞΌPa

Jet engine at 30 m 630 Pa 150 dB

Rifle being fired at 1 m 200 Pa 140 dB

Threshold of pain 100 Pa 130 dB

Hearing damage (due

to short-term exposure)20 Pa approx. 120 dB

Jet at 100 m 6 – 200 Pa 110 – 140 dB

Jack hammer at 1 m 2 Pa approx. 100 dB

Hearing damage (due

to long-term exposure)6Γ—10βˆ’1 Pa approx. 85 dB

Major road at 10 m 2Γ—10βˆ’1 – 6Γ—10βˆ’1 Pa 80 – 90 dB

Passenger car at 10 m 2Γ—10βˆ’2 – 2Γ—10βˆ’1 Pa 60 – 80 dB

TV (set at home level)

at 1 m2Γ—10βˆ’2 Pa approx. 60 dB

Normal talking at 1 m 2Γ—10βˆ’3 – 2Γ—10βˆ’2 Pa 40 – 60 dB

Very calm room 2Γ—10βˆ’4 – 6Γ—10βˆ’4 Pa 20 – 30 dB

Leaves rustling, calm

breathing6Γ—10βˆ’5 Pa 10 dB

Auditory threshold at 1

kHz2Γ—10βˆ’5 Pa 0 dB

210

1

20logdB

VG

V

2 1

2 1

1( )

1( )

dB

dB

V V G gain

V V G damping

1V2V

33See also Week 4

Bode Plot - Rules

β€’ Zero (numerator = 0)

– Amplitude: 20 dB/decade

– Phase: 90Β°, 45Β°/decade, starting 1 decade

before zero

β€’ Pole (denominator = 0)

– Amplitude: -20 dB/decade

– Phase: -90Β°, -45Β°/decade, starting 1 decade

before pole

34

Bode plot (magnitude)

Zero (numerator = 0) Amplitude: 20 dB/decade

Pole (denominator = 0) Amplitude: -20 dB/decade

𝑯 𝒔 =𝒔 + 𝟏𝟎𝟎𝟎

𝒔 + 𝟏𝟎𝟎 35

Bode plot (phase)

Zero (numerator = 0): 90Β°, 45Β°/decade, starting 1 decade

before zero

Pole (denominator = 0): -90Β°, -45Β°/decade, starting 1

decade before pole 36

Examples of Bode Plots

37

Bode plot: H s =𝑠+10

𝑠+1

β€’ Zero at 10

β€’ Pole at 1

β€’ Low pass filter

β€’ lim𝑠→0

𝐻 𝑠 = 10

38

Bode plot: H s =100𝑠

𝑠+1

β€’ Zero at 0

β€’ Pole at 1

β€’ High pass filter

β€’ limπ‘ β†’βˆž

𝐻 𝑠 = 100

39

Examples of First Order

Analog Filters

40

First Order Low Pass Filter

RC circuit

41

First Order Low Pass Filter

β€’ πœπ‘‘π‘¦(𝑑)

𝑑𝑑+ 𝑦 𝑑 = π‘₯ 𝑑 (𝜏 = 𝑅𝐢)

β€’ β„Ž 𝑑 =1

πœπ‘’βˆ’

𝑑

πœπ‘’(𝑑)

β€’ 𝐻 π‘—πœ” =1

π‘—πœ”πœ+1

β€’ 𝐻 𝑠 =1

π‘ πœ+1

42

β„Ž 𝑑 (𝜏 = 0.01) |𝐻 π‘—πœ” | =1

|π‘—πœ”πœ + 1|

πœ”

πœ”

First order Low Pass Filter

Bode plot

43

First Order High Pass Filter

RC circuit

44

First Order High Pass Filter

β€’ πœπ‘‘π‘¦(𝑑)

𝑑𝑑+ 𝑦 𝑑 = 𝜏

𝑑π‘₯(𝑑)

𝑑𝑑(𝜏 = 𝑅𝐢)

β€’ e 𝑑 = π‘’βˆ’π‘‘

πœπ‘’(𝑑) (step response)

β€’ 𝐻 π‘—πœ” =π‘—πœ”πœ

1+π‘—πœ”πœ

β€’ 𝐻 𝑠 =𝑠

1+π‘ πœ

45

e 𝑑 , 𝑅𝐢 = 0.01

πœ”

|𝐻 π‘—πœ” |

First order high pass filter

Bode plot

46

Digital Filters

47

An Example

2 2 2 1 2

2 1 2

1 0

( 1) 2 1 1 2 ( )( )

1 3 1 3 1 3 ( )( )( ) 1

2 4 4 8 4 8

[ ] [ ] [ ]

1 3[ ] [ ] 2 [ 1] [ 2] [ 1] [ 2]

4 8

N M

k x

k k

z z z z z Y zH z

X zz z z z z z

y n a y n k b x n k

y n x n x n x n y n y n

Transfer function:

Difference equation:

General case

48

First Order Recursive Discrete-

Time Filters

β€’ y[n] + π‘Žπ‘¦[𝑛 βˆ’ 1] = π‘₯[𝑛]

β€’ β„Ž[𝑛] = π‘Žπ‘›π‘’[𝑛]

β€’ Infinite Impulse Response (IIR)

β€’ 𝐻 π‘’π‘—πœ” =1

1βˆ’π‘Žπ‘’βˆ’π‘—πœ”

β€’ 𝐻 𝑧 =1

1βˆ’π‘Žπ‘§βˆ’1=

𝑧

π‘§βˆ’π‘Ž

49

Continuous

β€’ πœπ‘‘π‘¦(𝑑)

𝑑𝑑+ 𝑦 𝑑 = π‘₯ 𝑑

β€’ β„Ž 𝑑 =1

πœπ‘’βˆ’

𝑑

πœπ‘’(𝑑)

β€’ 𝐻 π‘—πœ” =1

π‘—πœ”πœ+1

β€’ 𝐻 𝑠 =1

π‘ πœ+1

First Order Recursive Discrete-

Time Filters

β€’ 𝐻 π‘’π‘—πœ” =1

1βˆ’π‘Žπ‘’βˆ’π‘—πœ”

β€’ 1>π‘Ž > 0 then low pass filter (π‘Ž = 0.8)

50

|𝐻 π‘’π‘—πœ” | =1

|1 βˆ’ 0.8π‘’βˆ’π‘—πœ”|

First Order Recursive Discrete-

Time Filters

β€’ 𝐻 π‘’π‘—πœ” =1

1βˆ’π‘Žπ‘’βˆ’π‘—πœ”

β€’ 1>π‘Ž > 0 then low pass filter (π‘Ž = 0.8)

51

arg(𝐻 π‘’π‘—πœ” ) = arg(1

1 βˆ’ 0.8π‘’βˆ’π‘—πœ”)

First Order Recursive Discrete-

Time Filters

β€’ 𝐻 π‘’π‘—πœ” =1

1βˆ’π‘Žπ‘’βˆ’π‘—πœ”

β€’ 1>π‘Ž > 0 then low pass filter (π‘Ž = 0.2)

52

|𝐻 π‘’π‘—πœ” | =1

|1 βˆ’ 0.8π‘’βˆ’π‘—πœ”||𝐻 π‘’π‘—πœ” | =

1

|1 βˆ’ 0.2π‘’βˆ’π‘—πœ”|

higher |a| => smaller passbands

First Order Recursive Discrete-

Time Filters

β€’ 𝐻 π‘’π‘—πœ” =1

1βˆ’π‘Žπ‘’βˆ’π‘—πœ”π» 𝑧 =

1

1βˆ’π‘Žπ‘§βˆ’1=

𝑧

π‘§βˆ’π‘Ž

β€’ 𝐻 π‘’π‘—πœ” =|𝑣1|

|𝑣2|

53

Pole z=a

Zero z=0

𝑣1𝑣2

𝑣1𝑣2

First Order Recursive Discrete-

Time Filters

β€’ β„Ž[𝑛] = π‘Žπ‘›π‘’[𝑛]

β€’ Infinite Impulse Response (IIR)

54

(π‘Ž = 0.8)(π‘Ž = 0.2)

First Order Recursive Discrete-

Time Filters

β€’ 𝐻 π‘’π‘—πœ” =1

1βˆ’π‘Žπ‘’βˆ’π‘—πœ”

β€’ 0>π‘Ž > βˆ’1 then high pass filter (π‘Ž = βˆ’0.8)

55

|𝐻 π‘’π‘—πœ” | =1

|1 + 0.8π‘’βˆ’π‘—πœ”|

First Order Recursive Discrete-

Time Filters

β€’ 𝐻 π‘’π‘—πœ” =1

1βˆ’π‘Žπ‘’βˆ’π‘—πœ”

β€’ 0>π‘Ž > βˆ’1 then high pass filter (π‘Ž = βˆ’0.8)

56

arg(𝐻 π‘’π‘—πœ” ) = arg(1

1 + 0.8π‘’βˆ’π‘—πœ”)

First Order Recursive Discrete-

Time Filters

β€’ 𝐻 π‘’π‘—πœ” =1

1βˆ’π‘Žπ‘’βˆ’π‘—πœ”

β€’ 0>π‘Ž > -1 then high pass filter (π‘Ž = βˆ’0.2)

57

|𝐻 π‘’π‘—πœ” | =1

|1 + 0.8π‘’βˆ’π‘—πœ”||𝐻 π‘’π‘—πœ” | =

1

|1 + 0.2π‘’βˆ’π‘—πœ”|

higher |a| => smaller passbands

First Order Recursive Discrete-

Time Filters

β€’ β„Ž[𝑛] = π‘Žπ‘›π‘’[𝑛]

β€’ Infinite Impulse Response (IIR)

58

(π‘Ž = 0.8)(π‘Ž = 0.2)

Nonrecursive Discrete-Time Filters

β€’ y n = π‘˜=βˆ’π‘π‘€ π‘π‘˜ π‘₯[𝑛 βˆ’ π‘˜]

β€’ Finite Impulse Response (FIR)

β€’ Unrelated to continuous time filtering

β€’ If N>0 then noncausal

59

Nonrecursive Discrete-Time Filters

– 3 point moving averaging

β€’ y n =1

3(π‘₯ 𝑛 βˆ’ 1 + π‘₯ 𝑛 +π‘₯ 𝑛 + 1 )

β€’ h n =1

3(𝛿 𝑛 βˆ’ 1 + 𝛿 𝑛 + 𝛿 𝑛 + 1 ) (FIR)

60

Nonrecursive Discrete-Time Filters

– 3 point moving averaging

β€’ y n =1

3(π‘₯ 𝑛 βˆ’ 1 + π‘₯ 𝑛 +π‘₯ 𝑛 + 1 )

β€’ h n =1

3(𝛿 𝑛 βˆ’ 1 + 𝛿 𝑛 + 𝛿 𝑛 + 1 ) (FIR)

β€’ 𝐻 π‘’π‘—πœ” =1

3π‘’π‘—πœ” + 1 + π‘’βˆ’π‘—πœ” =

1

3(1 + 2 cos πœ” )

61

|𝐻 ejΟ‰ |

Low pass filter

β€’ y n =1

𝑁+𝑀+1 π‘˜=βˆ’π‘π‘€ π‘₯[𝑛 βˆ’ π‘˜]

β€’ h n =1

𝑁+𝑀+1 π‘˜=βˆ’π‘π‘€ 𝛿[𝑛 βˆ’ π‘˜] (FIR)

β€’ 𝐻 π‘’π‘—πœ” =1

𝑁+𝑀+1 π‘˜=βˆ’π‘π‘€ π‘’βˆ’π‘—πœ”π‘˜ =

1

𝑁+𝑀+1π‘’βˆ’π‘—πœ”[(π‘βˆ’π‘€)/2]

sin[πœ” 𝑀+𝑁+1

2]

sin(πœ”

2)

62

Nonrecursive Discrete-Time Filters

N+M+1 point moving averaging

Low pass filters

Larger N+M+1 => Narrower pass

Nonrecursive Discrete-Time Filters

Simple Highpass Filter

β€’ y n =1

2(π‘₯ 𝑛 βˆ’ π‘₯ 𝑛 βˆ’ 1 )

β€’ h n =1

2(𝛿 𝑛 βˆ’ 𝛿 𝑛 βˆ’ 1 ) (FIR)

63

Nonrecursive Discrete-Time Filters

Simple Highpass Filter

β€’ y n =1

2(π‘₯ 𝑛 βˆ’ π‘₯ 𝑛 βˆ’ 1 )

β€’ h n =1

2(𝛿 𝑛 βˆ’ 𝛿 𝑛 βˆ’ 1 ) (FIR)

β€’ 𝐻 π‘’π‘—πœ” =1

21 βˆ’ π‘’βˆ’π‘—πœ” = π‘—π‘’π‘—πœ” sin πœ”/2

64

|𝐻 ejΟ‰ |

High pass filter

Order of Filters

65

Filter Order and Type

β€’ 1st order is equivalent to 20dB per decade

β€’ Each successive order adds 20dB per decade

β€’ Filter with a high order are closer to the ideal

filter (rectangular function)

β€’ Several filters exists and are defined by the

polynomials at the numerator/denominator

(Finite Impulse Response, Bessel,

Butterworth, Tschebishev, etc.)

66

Filter OrderAnalog

Filter order: 3

++ faster cutoff

-- more components

-- higher power

consumption

0

0 1

0 1 2

[ ] [ ]

[ ] [ ] [ 1]

[ ] [ ] [ 1] [ 2]

y n a x n

y n a x n a x n

y n a x n a x n a x n

Filter order: 1

Filter order: 2

++ faster cutoff

-- more computation

-- higher power

consumption

Digital

67

Conclusion

68

Take-Home Messagesβ€’ Filters allow a number of operations (e.g., noise

removal, contrast enhancement, anti-aliasing, etc.)

β€’ Their transfer function can be represented in time and frequency domain

β€’ They are often easier to design in the frequency domain

β€’ Bode plots allows for analysis of filter response

β€’ Filters are characterized by different order and coefficient distributions

β€’ Programmable digital components (e.g. microcontrollers, DSPs) allow for easy encoding of digital filters 69

Additional Reading

Books

β€’ Ronald W. Schafer and James H. McClellan

β€œDSP First: A Multimedia Approach”, 1998

β€’ A. Oppenheim and A. S. Willsky with S. Hamid,

β€œSignals and Systems”, Prentice Hall, 1996.

70