Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
27 views

Finite Impulse Response Filters

This document provides an outline and overview of a lecture on finite impulse response (FIR) filters. It discusses many roles of filters including noise removal, analysis/synthesis, and spectral shaping. It reviews convolution, z-transforms, and linear time-invariant systems. It also demonstrates FIR filter design and cascading FIR filters. Key concepts covered include convolution, transfer functions, frequency responses, and the region of convergence for z-transforms.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Finite Impulse Response Filters

This document provides an outline and overview of a lecture on finite impulse response (FIR) filters. It discusses many roles of filters including noise removal, analysis/synthesis, and spectral shaping. It reviews convolution, z-transforms, and linear time-invariant systems. It also demonstrates FIR filter design and cascading FIR filters. Key concepts covered include convolution, transfer functions, frequency responses, and the region of convergence for z-transforms.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

EE445S Real-Time Digital Signal Processing Lab Fall 2015

Finite Impulse Response Filters

Prof. Brian L. Evans


Dept. of Electrical and Computer Engineering
The University of Texas at Austin

Lecture 5 http://www.ece.utexas.edu/~bevans/courses/realtime
Outline
• Many Roles for Filters
• Convolution
• Z-transforms
• Linear time-invariant systems
Transfer functions
Frequency responses
• Finite impulse response (FIR) filters
Filter design with demonstration
Cascading FIR filters demonstration
Linear phase
5-2
Many Roles for Filters
• Noise removal
Signal and noise spectrally separated
Example: bandpass filtering to suppress out-of-band noise
• Analysis, synthesis, and compression
Spectral analysis
Examples: calculating power spectra (slides 14-10 and 14-11)
and polyphase filter banks for pulse shaping (lecture 13)
• Spectral shaping
Data conversion (lectures 10 and 11)
Channel equalization (slides 16-8 to 16-10)
Symbol timing recovery (slides 13-17 to 13-20 and slide 16-7)
Carrier frequency and phase recovery
5-3
Finite Impulse Response (FIR) Filter
• Same as discrete-time tapped delay line (slide 3-18)
x[n-1]
x[n] z-1 z-1 … z-1

h[0] h[1] h[2] … h[M-1]

S y[n]

• Impulse response h[n] has finite extent n = 0,…, M-1


M 1
y[n]   h[m] x[n  m] Discrete-time
m 0
convolution
5-4
Review

Discrete-time Convolution Derivation


• Output y[n] for input x[n] yn  T xn
  
• Any signal can be decomposed yn  T   xm n  m
m 
into sum of discrete impulses 

• Apply linear properties yn   xmT  n  m


m  

• Apply shift-invariance yn   xm hn  m
m  

• Apply change of variables yn   hm xn  m
m  
h[n] Averaging filter
impulse response
1
2 y[n] = h[0] x[n] + h[1] x[n-1]
n = ( x[n] + x[n-1] ) / 2 5-5
0 1 2 3
Review

Convolution Comparison
• Continuous-time convolution of x(t) and h(t)
 
yt   xt  ht    x  ht    d   h  xt    d
 

For each t, compute different (possibly) infinite integral


• In discrete-time, replace integral with summation
 
yn   xm hn  m   hm xn  m
m   m  

For each n, compute different (possibly) infinite summation


• LTI system
Characterized uniquely by its impulse response
Its output is convolution of input and impulse response
5-6
Convolution Demos
• The Johns Hopkins University Demonstrations
http://pages.jh.edu/~signals
Convolution applet to animate convolution of simple signals
and hand-sketched signals
Convolving two rectangular pulses of same width gives
triangle with width of twice the width of rectangular pulses
(see Appendix E in course reader for intermediate work)
x(t) * h(t) = y(t)
1 1 Ts

t t t
0 Ts 0 Ts Ts 2Ts

What about convolving two pulses of different lengths?


5-7
Review

Z-transform Definition
• For discrete-time systems, z-transforms play same
role as Laplace transforms do in continuous-time
Bilateral Forward z-transform Bilateral Inverse z-transform

hn z  n
1
H ( z)  
n  
h[n] 
2  j R
H ( z ) z n 1dz

Inverse transform requires contour integration over closed


contour (region) R
Contour integration covered in a Complex Analysis course
• Compute forward and inverse transforms using
transform pairs and properties

5-8
Review

Three Common Z-transform Pairs


• h[n] = [n] • h[n] = an u[n]

H z    a un z
 0
H z     n z n    n z n  1
n n

n   n 0 n  

  n
Region of convergence: entire a
  a n z n   
z-plane n 0 n 0  z 

1 a
 1
• h[n] = [n-1] 1
a
if
z
 1
H z     n  1 z    n  1 z  n  z 1
n z
n   n 1 Region of convergence
Region of convergence: entire for summation: |z| > |a|
z-plane except z = 0 |z| > |a| is the complement
h[n-1]  z-1 H(z) of a disk

Finite extent sequences 5-9


Infinite extent sequence
Review

Region of Convergence
• Region of the complex z- • Four possibilities (z = 0 is
plane for which forward z- special case that may or
transform converges may not be included)
Im{z} Im{z}

Entire Disk
plane Re{z} Re{z}

Im{z} Im{z}

Intersection
Complement of a disk and
of a disk Re{z} complement Re{z}

of a disk
5 - 10
Review

System Transfer Function


• Z-transform of system’s impulse response
Impulse response uniquely represents an LTI system
• Example: FIR filter with M taps (slide 5-4)
 M 1
H ( z )   hn z   hn z  n  h[0]  h[1] z 1  ...  h[ M  1] z ( M 1)
n

n   n 0

Transfer function H(z) is polynomial in powers of z -1


Region of convergence (ROC) is entire z-plane except z = 0
• Since ROC includes unit circle, substitute z = e j w
into transfer function to obtain frequency response
M 1
H (e )  H ( z ) | z e   hn e  j w n  h[0]  h[1] e  j w  ...  h[ M  1] e  j ( M 1) w
jw
jw

n 0

5 - 11
Example: Ideal Delay
• Continuous Time • Discrete Time
Delay by T seconds Delay by 1 sample
x(t) y(t) x[n] 1
y[n]
T z
yt   x(t  T ) y[n]  x[n  1]

Impulse response Impulse response


ht    (t  T ) h[n]   [n  1]
Frequency response Frequency response
H   e  j  T H w   e  j w

| H  |  1 | H w  |  1

H     T H w    w 5 - 12
Linear Time-Invariant Systems
• Fundamental Theorem of Linear Systems
If a complex sinusoid were input into an LTI system, then
output would be input scaled by frequency response of
LTI system (evaluated at complex sinusoidal frequency)
Scaling may attenuate input signal and shift it in phase
Example in continuous time: see handout F
Example in discrete time. Let x[n] = e j w n,
 
y[n]  e j w n  m 
h[m]  e jw n
 h[ m ] e  jw m
 e jw n
H w 
m   m  

x[n] * h[n] H(w)

H(w) is discrete-time Fourier transform of h[n]


H(w) is also called the frequency response
5 - 13
Frequency Response
• Continuous-time e jt
H  j e j  t
h(t )
LTI system cos t  H  j cos t  H  j
• Discrete-time e jw n  
H e jw e jw n
LTI system h[n ]
cosw n H e  cosw n  H e 
jw jw

• For real-valued impulse response H(e -j ω) = H*(e j ω)


Input e  j w n  e j w n  2 cos(w n)
Output H e j w  e j w n  H e j w  e j w n  H * e j w  e j w n  H e j w  e j w n 
 e
He jw
e  H e  e
 jH ( e jw )  jw n jw jH ( e jw )
e jw n 
2 H e  cos ω n  H e 
jw jw
5 - 14
Frequency Response
• System response to complex sinusoid e j w n for all
possible frequencies w in radians per sample:
|H(w)| |H(w)|
stopband
Linear
stopband
phase

w w
wstop wp wp wstop
d
passband delay (w )   H (w )  kdelay
dw
Lowpass filter: passes low and attenuates high frequencies
Linear phase: must be FIR filter with impulse response that is
symmetric or anti-symmetric about its midpoint
• Not all FIR filters exhibit linear phase 5 - 15
Filter Design
• Specify a desired Lowpass Filter Example
piecewise constant Desired Magnitude Response
magnitude response
forbidden
• Lowpass filter example 1
1p
w  [0, wp], mag  [1-p, 1] forbidden

w  [ws, ], mag  [0, s] forbidden Achtung!

Transition band unspecified s


w
• Symmetric FIR filter wp ws 
design methods Passband Transition Stopband
Windowing band
Least squares p passband ripple Red region
Remez (Parks-McClellan) s stopband ripple is forbidden
5 - 16
Example: Two-Tap Averaging Filter
• Input-output relationship h[n] Two-tap averaging filter
1 1
y[n]  x[n]  x[n  1]
2 2 ½
• Impulse response n
1 1
h[n]   [n]   [n  1] 1 2 3
2 2
• Frequency response x[n-1]
H w    e  j w
1 1 x[n] z-1
2 2
1  j 12w   j 12w j w 
1
H w   e
h[0] h[1]
e  e 2 
 
2  
 w   j 2w
1
S y[n]
H w   cos  e
2 5 - 17
Example: First-Order Difference
• Input-output relationship h[n] First-order difference
1 1
y[n]  x[n]  x[n  1]
2 2 ½
• Impulse response n
1 1
h[n]   [n]   [n  1] 2 3
2 2 -½
• Frequency response
H w    e  j w
1 1
2 2
1  j 12w   j 12w  j 12w 
H w   e e
 e 

2  
  1 
 w   j 2w  w  j 2  j 2w  w  j  2  2 w 
1 1
H w   sin   j e  sin   e e  sin   e
2 2 2 5 - 18
Cascading FIR Filters Demo
• Five-tap discrete-time averaging FIR filter with
input x[n] and output y[n]
yn  x[n]  x[n 1]  x[n  2]  x[n  3]  x[n  4]
Standard averaging filtering scaled by 5
Lowpass filter (smooth/blur input signal)
Impulse response is {1, 1, 1, 1, 1}
• First-order difference FIR filter
yn  x[n]  x[n 1] h[n] First-order difference
impulse response
Highpass filter (sharpens
input signal) 1

Impulse response is {1, -1} n


2 3
-1 5 - 19
Cascading FIR Filters Demo
• DSP First, Ch. 6, Freq. Response of FIR Filters
http://www.ece.gatech.edu/research/DSP/DSPFirstCD/visible/chapters/6firfreq/demos/blockd/index.htm

For username/password help


• From lowpass filter to highpass filter
original image  blurred image  sharpened/blurred image
• From highpass to lowpass filter
original image  sharpened image  blurred/sharpened image
• Frequencies that are zeroed out can never be
recovered (e.g. DC is zeroed out by highpass filter)
• Order of two LTI systems in cascade can be
switched under the assumption that computations
are performed in exact precision 5 - 20
Cascading FIR Filters Demo
• Input image is 256 x 256 matrix
Each pixel represented by eight-bit number in [0, 255]
0 is black and 255 is white for monitor display
• Each filter applied along row then column
Averaging filter adds five numbers to create output pixel
Difference filter subtracts two numbers to create output pixel
• Full output precision is 16 bits per pixel
Demonstration uses double-precision floating-point data and
arithmetic (53 bits of mantissa + sign; 11 bits for exponent)
No output precision was harmed in the making of this demo 
5 - 21
Importance of Linear Phase
• Speech signals • Linear phase crucial
Use phase differences in Audio
arrival to locate speaker Images
Once speaker is located, ears Communication systems
are relatively insensitive to
phase distortion in speech
• Linear phase response
from that speaker Need FIR filters
Used in speech compression Realizable IIR filters
in cell phones) cannot achieve linear
d = c t phase response over all
frequencies

5 - 22
Importance of Linear Phase
code
• For images, vital visual information in phase

Take FFT of image Take FFT of image Take FFT of image


Set phase to zero Set magnitude to one Set magnitude to one
Take inverse FFT Take inverse FFT Take inverse FFT
(which is real-valued) Keep imaginary part Keep real part
• Original image is from Matlab
http://users.ece.utexas.edu/~bevans/courses/realtime/lectures/05_FIR_Filters/Original%20Image.tif 5 - 23
Finite Impulse Response Filters
• Duration of impulse response h[n] is finite, i.e.
zero-valued for n outside interval [0, M-1]:
 M 1
yn  xn hn   hm xn  m   hm xn  m
m   m 0
Output depends on current input and previous M-1 inputs
Summation to compute y[k] reduces to a vector dot product
between M input samples in the vector
 x[n], x[n 1], ..., x[n  (M 1)] 
and M values of the impulse response in vector
 h[0], h[1], ..., h[M 1] 
• What instruction set architecture features would you
add to accelerate FIR filtering?
5 - 24

You might also like