Signal Processing First - Konkukkonkuk.ac.kr/~cyim/dsp/Chapter6.pdf · Signal Processing First...
-
Upload
nguyenminh -
Category
Documents
-
view
244 -
download
7
Transcript of Signal Processing First - Konkukkonkuk.ac.kr/~cyim/dsp/Chapter6.pdf · Signal Processing First...
5/3/2018 © 2003, JH McClellan & RW Schafer 1
Signal Processing First
Chapter 6Frequency Response
of FIR Filters
5/3/2018 © 2003, JH McClellan & RW Schafer 2
License Info for SPFirst Slides
This work released under a Creative Commons Licensewith the following terms:
Attribution The licensor permits others to copy, distribute, display, and perform
the work. In return, licensees must give the original authors credit.
Non-Commercial The licensor permits others to copy, distribute, display, and perform
the work. In return, licensees may not use the work for commercial purposes—unless they get the licensor's permission.
Share Alike The licensor permits others to distribute derivative works only under
a license identical to the one that governs the licensor's work. Full Text of the License This (hidden) page should be kept with the presentation
5/3/2018 © 2003, JH McClellan & RW Schafer 3
Lecture Objectives
Sinusoidal input signal Determine the FIR filter output
Frequency response of FIR Plotting vs. Frequency Magnitude vs. Freq. Phase vs. Freq. )(ˆˆ ˆ
)()( jeHjjj eeHeH
MAG
PHASE
5/3/2018 © 2003, JH McClellan & RW Schafer 4
6-1 Sinusoidal Response ofFIR Systems
Input: x[n] = Sinusoid Output: y[n] will also be a Sinusoid Different Amplitude and Phase
SAME Frequency
Amplitude & Phase change vs. frequency Called the FREQUENCY RESPONSE
5/3/2018 © 2003, JH McClellan & RW Schafer 5
Complex Exponential Input
M
k
M
kk knxkhknxbny
00][][][][
FIR DIFFERENCE EQUATION
neAenx njj ˆ][x[n] is the input signal—a complex exponential
5/3/2018 © 2003, JH McClellan & RW Schafer 6
Complex Exponential Output
Use the FIR “Difference Equation”
njj eAeH ˆ)ˆ(
M
k
knjjk
M
kk eAebknxbny
0
)(ˆ
0][][
njjM
k
kjk eAeeb ˆ
0
)(ˆ
5/3/2018 © 2003, JH McClellan & RW Schafer 7
Frequency Response
Complex-valued formula Magnitude vs. frequency Phase vs. frequency
Notation:
FREQUENCYRESPONSE
At each frequency, we can DEFINE
)ˆ(of place in )( ˆ HeH j
kjM
kkebH ˆ
0)ˆ(
kjM
kk
j ebeH ˆ
0
ˆ )(
5/3/2018 © 2003, JH McClellan & RW Schafer 8
Example 6.1
Exploitsymmetry
}1,2,1{}{ kb
)ˆcos22()2(
21)(
ˆ
ˆˆˆ
ˆ2ˆˆ
j
jjj
jjj
eeee
eeeH
ˆ)( is Phaseand
)ˆcos22()( is Magnitude0)ˆcos22( Since
ˆ
ˆ
j
j
eH
eH
5/3/2018 © 2003, JH McClellan & RW Schafer 9
PLOT of FREQ RESPONSE
ˆˆ )ˆcos22()( jj eeH RESPONSE at /3
}1,2,1{}{ kb
(radians)
5/3/2018 © 2003, JH McClellan & RW Schafer 10
Example 6.2
y[n]x[n])( jeH
ˆˆ )ˆcos22()( jj eeH
njj
j
eenxeHny
)3/(4/
ˆ
2][ andknown is )( when][ Find
5/3/2018 © 2003, JH McClellan & RW Schafer 11
njj eenxny )3/(4/2][ when][ Find
Example 6.2 (answer)
3/ˆat )( evaluate-Step One ˆ jeH ˆˆ )ˆcos22()( jj eeH
3/ˆ@3)( 3/ˆ jj eeH
njjj eeeny )3/(4/3/ 23][ njj ee )3/(12/6
5/3/2018 © 2003, JH McClellan & RW Schafer 12
6-2 Superposition and theFrequency Response
)cos(2][ andknown is )( when][ Find
43
ˆ
nnxeHny j
ˆˆ )ˆcos22()( jj eeH
y[n]x[n] )( jeH
5/3/2018 © 2003, JH McClellan & RW Schafer 13
Example 6-3: Cosine Input
)cos(2][ when][ Find 43 nnxny
][][][)cos(2
21
)4/3/()4/3/(43
nxnxnxeen njnj
][][][)(][
)(][
21
)4/3/(3/2
)4/3/(3/1
nynynyeeHny
eeHnynjj
njj
UseLinearity
5/3/2018 © 2003, JH McClellan & RW Schafer 14
Ex: Cosine Input (ans-2)
)cos(2][ when][ Find 43 nnxny
)4/3/()3/()4/3/(3/2
)4/3/()3/()4/3/(3/1
3)(][3)(][
njjnjj
njjnjj
eeeeHnyeeeeHny
)cos(6][33][
123
)12/3/()12/3/(
nnyeeny njnj
ˆˆ )ˆcos22()( jj eeH
5/3/2018 © 2003, JH McClellan & RW Schafer 15
Sinusoid Output of FIR
If Multiply the Magnitudes Add the Phases
))(ˆcos()(][
)ˆcos(][11 ˆ
1ˆ
1
jj eHneHAny
nAnx
)()( ˆˆ* jj eHeH
5/3/2018 © 2003, JH McClellan & RW Schafer 16
LTI Systems
LTI: Linear & Time-Invariant
Completely characterized by: FREQUENCY RESPONSE, or IMPULSE RESPONSE h[n]
Sinusoid Input -----> Sinusoid Output At the SAME Frequency
5/3/2018 © 2003, JH McClellan & RW Schafer 17
6-4 Properties of the FrequencyResponse
Get Frequency Response from h[n] Here is the FIR case:
kjM
k
kjM
kk
j ekhebeH ˆ
0
ˆ
0
ˆ ][)(
IMPULSE RESPONSE
5/3/2018 © 2003, JH McClellan & RW Schafer 18
Block Diagrams
Equivalent Representations
y[n]x[n]
y[n]x[n])( jeH
][nh
5/3/2018 © 2003, JH McClellan & RW Schafer 19
Time & Frequency Domain
FIR DIFFERENCE EQUATION is the TIME-DOMAIN
M
k
M
kk knxkhknxbny
00][][][][
M
k
kjj ekheH0
ˆˆ ][)(
ˆ3ˆ2ˆˆ ]3[]2[]1[]0[)( jjjj ehehehheH
5/3/2018 © 2003, JH McClellan & RW Schafer 20
Unit-Delay System
y[n]x[n] ]1[ n
y[n]x[n] je)( jeH
]1[][for )( and ][ Find ˆ nxnyeHnh j
}1,0{}{ kb
5/3/2018 © 2003, JH McClellan & RW Schafer 21
First Difference System
y[n]x[n] 1 je
y[n]x[n] ]1[][ nn
)( jeH
]1[][][ :Equatione Differencfor the )( and ][ Find ˆ
nxnxnyeHnh j
5/3/2018 © 2003, JH McClellan & RW Schafer 22
Example: Delay by 2 System
y[n]x[n] )( jeH
y[n]x[n] ][nh
]2[][for )( and ][ Find ˆ nxnyeHnh j
]2[][ nnh
}1,0,0{kb
5/3/2018 © 2003, JH McClellan & RW Schafer 23
Delay by 2 System
k = 2 ONLY
y[n]x[n] ]2[ n
]2[][for )( and ][ Find ˆ nxnyeHnh j
M
k
kjj ekeH0
ˆˆ ]2[)(
)( jeHy[n]x[n] 2je
5/3/2018 © 2003, JH McClellan & RW Schafer 24
General Delay Property
Only one non-ZERO termfor k at k = nd
dnjM
k
kjd
j eenkeH ˆ
0
ˆˆ ][)(
][][for )( and ][ Find ˆd
j nnxnyeHnh
][][ dnnnh
5/3/2018 © 2003, JH McClellan & RW Schafer 25
Frequency domain --> Time domain
Start with kj bnheH or find and ][)(
)ˆcos(7)( ˆ2ˆ jj eeH
y[n]x[n] ][nh ?][ nh
y[n]x[n])( jeH
5/3/2018 © 2003, JH McClellan & RW Schafer 26
Euler’s Formula)ˆcos(7)( ˆ2ˆ jj eeH )5.05.0(7 ˆˆˆ2 jjj eee
)5.35.3( ˆ3ˆ jj ee
]3[5.3]1[5.3][ nnnh
}5.3,0,5.3,0{kb
Frequency domain --> Time domain
5/3/2018 © 2003, JH McClellan & RW Schafer 27
6-6 Cascaded LTI Systems
Does the order of S1 & S2 matter? No, LTI systems can be rearranged ! What are the filter coefficients? {bk} What is the overall frequency response?
S1 S2][n ][1 nh ][][ 21 nhnh ][1 nh ][2 nh
5/3/2018 © 2003, JH McClellan & RW Schafer 28
Cascade Equivalent
Multiply the Frequency Responses
y[n]x[n] )( jeH
x[n] )( ˆ1
jeH y[n])( ˆ2
jeH
)()()( ˆ2
ˆ1
ˆ jjj eHeHeH EQUIVALENTSYSTEM
5/3/2018 © 2003, JH McClellan & RW Schafer 29
6-7 Running-Average Filtering
Spectrum of x(t) (Sum of sinusoids) Spectrum of x[n] Is ALIASING a PROBLEM ?
Spectrum y[n] (FIR Gain or Nulls) Output y(t) = Sum of sinusoids
D-to-AA-to-Dx(t) y(t)y[n]x[n] )( jeH
5/3/2018 © 2003, JH McClellan & RW Schafer 30
Frequency Scaling
Time sampling: If NO aliasing: Frequency scaling
D-to-AA-to-Dx(t) y(t)y[n]x[n] )( jeH
sfsT ˆsnTt
5/3/2018 © 2003, JH McClellan & RW Schafer 31
11-point Average Example
D-to-AA-to-Dx(t) y(t)y[n]x[n] )( jeH
?
250 Hz
25 Hz ?))250(2cos())25(2cos()( 2
1 tttx
ˆ5
21
211
ˆ
)ˆsin(11)ˆsin(
)( jj eeH
10
0111 ][][
kknxny
5/3/2018 © 2003, JH McClellan & RW Schafer 32
D-A Frequency Scaling
Reconstruct up to 0.5fs Frequency scaling
D-to-AA-to-Dx(t) y(t)y[n]x[n] )( jeH
Time sampling:
sf ˆ
ss ftnnTt
5/3/2018 © 2003, JH McClellan & RW Schafer 33
Track the Frequencies
D-to-AA-to-Dx(t) y(t)y[n]x[n] )( jeH
Fs = 1000 Hz
0.5
.05
0.5
.05
250 Hz
25 Hz
NO new freqs
250 Hz
25 Hz )(
)(
05.0
5.0
j
j
eH
eH
5/3/2018 © 2003, JH McClellan & RW Schafer 34
11-point Average
NULLS or ZEROS
5.0ˆ 05.0ˆ
5/3/2018 © 2003, JH McClellan & RW Schafer 35
Evaluate Frequency Response
ˆ5
21
211
ˆ
)ˆsin(11)ˆsin(
)( jj eeH
)5.0(5
21
211
ˆ
))5.0(sin(11))5.0(sin(
)(
jj eeH
5.0ˆAt
5.2
)25.0sin(11)75.2sin( je
5.00909.0 je
5/3/2018 © 2003, JH McClellan & RW Schafer 36
Evaluate Frequency Response
fs = 1000MAG SCALE
PHASE CHANGE
)( 1000/)25(2jeH
)( 1000/)250(2jeH
5/3/2018 © 2003, JH McClellan & RW Schafer 37
EFFECTIVE RESPONSE
DIGITAL FILTER
LOW-PASS FILTER
)( jeH
5/3/2018 © 2003, JH McClellan & RW Schafer 38
Filter Types
Low-pass Filter (LPF) Blurring Attenuates high frequencies
High-pass Filter (HPF) Sharpening for images Boots high frequencies Removes DC
Band-pass Filter (BPF)
5/3/2018 © 2003, JH McClellan & RW Schafer 39
Black & White Image
5/3/2018 © 2003, JH McClellan & RW Schafer 40
B&W Image with CosineFILTERED: 11-pt AVG
5/3/2018 © 2003, JH McClellan & RW Schafer 41
Filtered B&W Image
LPF:Blur
5/3/2018 © 2003, JH McClellan & RW Schafer 42
Row of B&W Image
BLACK = 255
WHITE = 0
5/3/2018 © 2003, JH McClellan & RW Schafer 43
Row of Filtered Image
Adjusted Delay by 5 samples