Title: Finite Impulse Response Filters
1Finite Impulse Response Filters
2Discrete-Time Impulse Signal
- Let dk be a discrete-time impulse function,
a.k.a. Kronecker delta function - Impulse response is response of discrete-time LTI
system to discrete impulse function - Example delay by one sample
- Finite impulse response filter
- Non-zero extent of impulse response is finite
- Can be in continuous time or discrete time
- Also called tapped delay line (see slides 3-13,
3-19, 5-3)
3Discrete-time Tapped Delay Line
- Impulse response hk of finite extent k 0,,
M-1 - Block diagram (finite impulse response filter)
Discrete-time convolution
Applications of continuous-time tapped delay
lines?
4Discrete-time Convolution Derivation
- Output yk for input xk
- Any signal can be decomposedinto sum of discrete
impulses - Apply linear properties
- Apply shift-invariance
- Apply change of variables
yk h0 xk h1 xk-1 ( xk
xk-1 ) / 2
5Comparison to Continuous Time
- Continuous-time convolution of x(t) and h(t)
- For each t, compute different (possibly) infinite
integral - In discrete-time, replace integral with summation
- For each k, compute different (possibly) infinite
summation - LTI system
- From impulse response and input, one can
determine output - Impulse response uniquely characterizes LTI system
6Convolution Demos
- Johns Hopkins University Demonstrations
- http//www.jhu.edu/signals (http//www.jhu.edu/s
ignals) - 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(also see Appendix E for
intermediate calculations)
7Linear Time-Invariant Systems
- Complex exponentials zk havea special property
when theyare input into LTI systems - Output will be same complexexponential weighted
by H(z) - When we specialize the z-domain to frequency
domain, magnitude of H(z) will control which
frequencies are attenuated or passed - H(z) is also known as the transfer function
8Linear Time-Invariant Systems
- The Fundamental Theorem of Linear Systems
- If a complex sinusoid were input into an LTI
system, then the output would be a complex
sinusoid of the same frequency that has been
scaled by the frequency response of the LTI
system at that frequency - Scaling may attenuate the signal and shift it in
phase - Example in continuous time see handout F
- Example in discrete time. Let xk e j W k,
-
- H(W) is discrete-time Fourier transform of
hkH(W) is also called the frequency response
H(?)
9Frequency Response
- For continuous-time systems, response to complex
sinusoid is - For discrete-time systems, z-k (r e j w)k
r-k e j w k and the response is - For discrete-time systems, response to complex
sinusoid is
frequency response
frequency response
10Example Ideal Delay
- Continuous Time
- Delay by T seconds
- Impulse response
- Frequency response
- Discrete Time
- Delay by 1 sample
- Impulse response
- Frequency response
yk
xk
w W T
Allpass Filter
Linear Phase
11Frequency Response
- System response to complex sinusoid e j W t for
all possible frequencies W where W 2 p f - Above passes low frequencies, a.k.a. lowpass
filter - FIR filters are only realizable LTI filters that
can have linear phase over all frequencies - Not all FIR filters exhibit linear phase
?H(W)
H(W)
Linearphase
stopband
stopband
W
W
Wp
Ws
-Ws
-Wp
passband
12Linear Time-Invariant Systems
- Any linear time-invariant system (LTI) system,
whether continuous-time or discrete-time, can be
uniquely characterized by its - Impulse response response of system to an
impulse OR - Frequency response response of system to a
complex sinusoid (e j W t or e j w k) for all
possible frequencies OR - Transfer function general transform of impulse
response (Laplace transform for continuous-time
systems and z-transform for discrete-time
systems) - Given one, we can find other two if they exist
- Give an impulse response that has a Laplace
transform but not a Fourier transform? What
about the other way?
13Mandrill Demo (DSP First)
- Five-tap discrete-time averaging FIR filter with
input xk and output yk - Lowpass filter (smooth/blur input signal)
- Impulse response is 1/5, 1/5, 1/5, 1/5, 1/5
- First-order difference FIR filter
- Highpass filter (sharpensinput signal)
- Impulse response is 1, -1
hk
First-order difference impulse response
k
14Mandrill Demo (DSP First)
- DSP First demos http//users.ece.gatech.edu/dspf
irst - 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
15Mandrill Demo (DSP First)
- Precision
- Input is represented as eight-bit numbers 0,255
per image pixel (i.e. fewer than three decimal
digits of accuracy) - Filter coeffients represented by one decimal
digit each - Intermediate computations (filtering) in
double-precision floating-point arithmetic (15-16
decimal digits of accuracy) - Output is represented as eight-bit number -128,
127(i.e. fewer than three decimal digits) - No output precision was harmed in the making of
this demo ?
16Finite Impulse Response Filters
- Duration of impulse response hk is finite, i.e.
zero-valued for k outside interval 0, M-1 - Output depends on current input and previous M-1
inputs - Summation to compute yk reduces to a vector dot
product between M input samples in the vector -
- and M values of the impulse response in
vector - What instruction set architecture features would
you add to accelerate FIR filtering?
17Symmetric FIR Filters
- Impulse response often symmetric about midpoint
- Phase of frequency response is linear (slides 5-9
to 5-11) - Example three-tap FIR filter (M 3) with h0
h2 - Implementation savings
- Reduce number of multiplications from M to M/2
for even-length and to (M1)/2 for odd-length
impulse responses - Reduce storage of impulse response by same amount
- TI TMS320C54 DSP has an accelerator instructor
FIRS to compute h0 ( xk xk-2 ) in one
instruction cycle - On most DSPs, no accelerator instruction is
available
18Filter Design
- Specify a desired piecewise constant magnitude
response - Lowpass filter example
- w ? 0, wp, mag ? 1-dp, 1
- w ? ws, p, mag ? 0, ds
- Transition band unspecified
- Symmetric FIR filter design methods
- Windowing
- Least squares
- Remez (Parks-McClellan)
Lowpass Filter Example
Desired Magnitude Response
forbidden
1
1-dp
forbidden
Achtung!
forbidden
ds
w
wp
ws
p
Passband
Stopband
Transition band
Red region is forbidden
dp passband ripple ds stopband ripple
19Importance of Linear phase
- Speech signals
- Use phase differences to locate a speaker
- Once locked onto a speaker, our ears are
relatively insensitive to phase distortion in
speech from that speaker (underlies speech
compression systems, e.g. digital cell phones)
- Linear phase crucial
- Audio
- Images
- Communication systems
- Linear phase response
- Need FIR filters
- Realizable IIR filters cannot achieve linear
phase response over all frequencies
20Z-transform Definition
- For discrete-time systems, z-transforms play same
role as Laplace transforms do for continuous-time
systems - 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
Bilateral Forward z-transform
Bilateral Inverse z-transform
21 Common Z-transform Pairs
- hk dk
- Region of convergence entire z-plane
- hk dk-1
- Region of convergence entire z-plane
- hn-1 ? z-1 H(z)
- hk ak uk
- Region of convergence z gt a
- z gt a is the complement of a disk
22Region of Convergence
- Region of the complex z-plane for which forward
z-transform converges
- Four possibilities (z0 is a special case that
may or may not be included)
23Stability
- Rule 1 For a causal sequence, poles are inside
the unit circle (applies to z-transform functions
that are ratios of two polynomials) OR - Rule 2 Unit circle is in the region of
convergence. (For continuous-time signal,
imaginary axis would be in region of convergence
of Laplace transform.) - Example
- Stable if a lt 1 by rule 1 or equivalently
- Stable if a lt 1 by rule 2 because zgta and
alt1
pole at za
24Transfer Function
- Transfer function is z-transform of impulse
response e.g. for FIR filter with M taps (slide
5-3) - Region of convergence is entire z-plane
- FIR filters are always stable
- Substitute z e j w into transfer function to
obtain frequency response - Valid when unit circle is in region of
convergence (i.e. for stable systems according to
rule 2 on last slide)