BME 310 Biomedical Computing - J.Schesser 226 Frequency Response of FIR Filters Lecture #9 Chapter 6
BME 310 Biomedical Computing -J.Schesser
226
Frequency Response of FIR Filters
Lecture #9Chapter 6
BME 310 Biomedical Computing -J.Schesser
227
What Is this Course All About ?
• To Gain an Appreciation of the Various Types of Signals and Systems
• To Analyze The Various Types of Systems
• To Learn the Skills and Tools needed to Perform These Analyses.
• To Understand How Computers Process Signals and Systems
BME 310 Biomedical Computing -J.Schesser
228
Frequency Response• Study FIR systems, where the input is a
discrete-time sinusoidal signal, in particular, a discrete-time complex exponential signal with normalized radian frequency
• Let’s substitute this signal into the general expression of a FIR.
ˆ
( )ˆ[ ] ( ) ;
s
j j t
j nTjs s
j j n
x t Ae ex n x nT Ae e T
Ae e n
BME 310 Biomedical Computing -J.Schesser
229
Frequency Response Function ˆ
0
ˆ ( )
0
[ ]
[ ] [ ]
j j n
M
kk
Mj j n k
kk
x n Ae e
y n b x n k
b Ae e
• We define this function as the Frequency Response Function or the Frequency Response
ˆ ˆ
0ˆ
ˆ ˆ
0
[ ] ( )
ˆ( )
ˆ( ) ( )
Mj k j j n
kk
j j n
Mj j k
kk
y n b e Ae e
H Ae e
H H e b e
)( jeH
BME 310 Biomedical Computing -J.Schesser
230
Frequency Response FunctionAnother Approach using Convolution
ˆ ˆ ( )
0
ˆ ˆ ˆ( )
ˆ ˆ ˆ ˆ
0
[ ] [ ]
[ ] [ ] [ ]
[ ] [ ] [ ] [ ] [ ]
( [ ] ) ( [ ] [ ] )
Since [ ] 0 for and
j j n j j n l
M
k
j j n l j j n j l
l l l
Mj l j j n j l j j n
l l k
x n Ae e x n l Ae e
h n h k n k
y n h l x n l h l Ae e h l Ae e e
h l e Ae e h k l k e Ae e
l k l k
ˆ ˆ
0
[ ] 1 for , then the outer summation can be removed.
( [ ] )M
j k j j n
k
l k l k
h k e Ae e
BME 310 Biomedical Computing -J.Schesser
231
Frequency Response of a FIR
1. When the input is a discrete-time complex exponential signal, the output of an FIR filter is also a discrete-time complex exponential signal with a different amplitude but same frequency
2. The Frequency Response Function only applies to inputs which are discrete-time complex exponential signals
3. The Frequency Response is a complex number which can be represented in Cartesian or polar form
4. Therefore, the amplitude of the output is product of the amplitude of the input signal times the amplitude of the Frequency Response (polar form)
5. The phase of the output is the sum of the phase of the input and the phase of the Frequency Response
M
k
kjM
k
kjk
j ekhebeH0
ˆ
0
ˆˆ ][)(
BME 310 Biomedical Computing -J.Schesser
232
Polar Form of the Frequency Responseˆ
ˆ
ˆ
ˆ ˆ ( )
ˆ ˆ
ˆ ˆ( )
ˆ ˆ( ( ) )
( ) ( )
[ ] ( )
( )
( ( ) )
j
j
j
j j j H e
j j j n
j j H e j j n
j j H e j n
H e H e e
y n H e Ae e
H e e Ae e
A H e e e
ˆ
ˆ
Note that this: [ ] ( ) [ ]
is only meaningful for [ ]
j
j j n
y n H e x n
x n Ae e
BME 310 Biomedical Computing -J.Schesser
233
An Example
ˆ)(
ˆcos22)(
)ˆcos22()2(
121
)(
}1 ,2 ,1{}{Let
ˆ
ˆ
ˆ
ˆˆˆ
2ˆˆ
2
0
ˆˆ
j
j
j
jjj
jjk
kjk
j
k
eH
eH
eeee
ee
ebeH
b
BME 310 Biomedical Computing -J.Schesser
234
Example continued
njj
njj
njjjnjjj
j
j
jj
njj
ee
ee
eeeeeeH
nxeHny
e
eeH
eenx
312
3)43(
343343
3
3
33
34
6
6
232)(
][)(][
3
)3cos22()(
,3ˆ since
2][let system For this
BME 310 Biomedical Computing -J.Schesser
235
Using Superposition• We can use superposition to find the outputs of more
complex signals.1 1 1 1
1 1 1 1
1 1 1 1 1 1
1 1
0 1 1 1
ˆ ˆ0 10
ˆ ˆˆ 0 10
ˆ ˆ ˆ ˆ0 0 1 10
ˆ ˆ0 0 10
ˆ[ ] cos( )
( )2
[ ] ( ) { ( )}2
( ) ( ) ( )2 2
( ) ( )2
j j n j j nj n
j j n j j nj j n
j j j n j j j nj j n
j j jj j n
x n A A nAA e e e e e
Ay n H e A e e e e e
A AH e A e H e e e H e e e
AH e A e H e e e
1 1 1 1
ˆ ˆ1 11 1 1 1 1 1
ˆ ˆ1 11 1 1 1 1
1
ˆ ˆ1
ˆ ˆ ˆ ˆ0 0 ( ) ( )1 10
ˆ ˆ ˆ0 ( ) ( )10
ˆ0 10
*( )2
( ) ( ) ( )2 2
( ) ( ) { }2
( ) ( )2
j j
j j
n j j j n
j j j n j j j nj j n j H e j H e
j j j n j j nj j H e j H e
jj
AH e e e
A AH e A e H e e e e H e e e e
AH e A H e e e e e e e
AH e A H e
ˆ ˆ1 1
1 1 1 1
1 1
ˆ ˆ( ( )) ( ( ))
ˆ ˆ00 1 1 1
{ }
ˆ( ) ( ) cos( ( ))
j jj n H e j n H e
j jj
e e
H e A A H e n H e
BME 310 Biomedical Computing -J.Schesser
236
An Example
4 4 4 4
For this system let [ ] 2cos( )4 2
ˆ since ,4
( ) (2 2cos ) (2 2) 3.414
[ ] 2 3.41cos(4
j j j j
x n n
H e e e e
y n
)2 4
6.82cos( ( 1) )4 2
This system is a time shifter
n
n
BME 310 Biomedical Computing -J.Schesser
237
Superposition
• Using superposition, find the output using the frequency response function for each component of the input
• Add up the component outputs to yield the complete output solution.
BME 310 Biomedical Computing -J.Schesser
238
Another Example
))1(87cos(31522.0)2)1(3cos(3344][
1522.0)87cos22()(
3)3cos22()(
4)0cos22()(8
7 ,3 ,0ˆfor
)87cos(3)23cos(34][let system For this
87
87
87
333
00
nnny
eeeH
eeeH
eeH
nnnx
jjj
jjj
jj
BME 310 Biomedical Computing -J.Schesser
239
Cascaded System• Two systems where the output of the first is the
input to the second.
• This states that a cascaded system can be replaced a single system with frequency response,
)( ˆ2
jeHLTI 1 LTI 2x[n]
)( ˆ1
jeH
][)(
][ˆ
1
1
nxeH
nyj
ˆj j nAe e
][)()(
][)(][ˆ
2ˆ
1
1ˆ
2
nxeHeH
nyeHnyjj
j
)()()( ˆ2
ˆ1
ˆ jjj eHeHeH
BME 310 Biomedical Computing -J.Schesser
240
Summary• The Frequency Response is associated a FIR system
with complex exponential signals as inputs• The Frequency Response can be used to calculate the
output signal of a system• Superposition can be used to find the output signal of
each component and the complete response can be obtained by adding the outputs of the components
• This type of analysis is called frequency domain analysis and we can work exclusively in the frequency– Solving for the output in the time domain (the difference
equation or impulse response) is not necessary.
BME 310 Biomedical Computing -J.Schesser
241
The Unit-Step Signal
• Before we continue, let’s define another important sequence called the unit step signal:
• This signal can be used represent real world signals since signals start as some point in time.
• A signal like x[n]=cos(.2πn) is defined for all -∞ < n < ∞ , while x[n]=cos(.2πn) u[n] is more realistic since it is defined only for n ≥ 0
0for 1 ][
0for 0
nnu
n
BME 310 Biomedical Computing -J.Schesser
242
Unit Step Example
cos[.2n]
-15 -10 -5 0 5 10 15 20
cos[.2n]*u[n]
-15 -10 -5 0 5 10 15 20
BME 310 Biomedical Computing -J.Schesser
243
Steady-State and Transient Response
• Let’s examine how systems responds to signals which begin at a particular time.
• We will see that the output show two phases:– A Transient Response or a period of time where the signal
“builds up” from its starting value (usually zero) to its final “state”
– A Steady State Response or the period where the transient response has “completed”
• Examples:– Turning on a light or a motor– Starting a car
BME 310 Biomedical Computing -J.Schesser
244
FIR System Transient and Steady-State Response
• The input to the system is:
• Our FIR system:
• The output:
0for 0 ][][
0for ˆ
ˆ
nnuXenx
nXenj
nj
M
k
kjk
j ebeH0
ˆˆ )(
M
k
knjk
M
kk knuXebknxbny
0
)(ˆ
0][][][
BME 310 Biomedical Computing -J.Schesser
245
FIR System Transient and Steady-State Response
• Let’s study the output:
0}0
000
00{
]}[
)]1([][)]1([
]1[]0[{]0[
]}[
)]1([][)]1([
]1[]0[{
][][
)(ˆ
))1((ˆ1
)(ˆ))1((ˆ1
)1(ˆ1
)0(ˆ0
)(ˆ
))1((ˆ1
)(ˆ))1((ˆ1
)1(ˆ1
)0(ˆ0
)(ˆ
))1((ˆ1
)(ˆ))1((ˆ1
)1(ˆ1
)0(ˆ0
0
)(ˆ
MnjM
lnjl
lnjl
lnjl
njnj
MnjM
lnjl
lnjl
lnjl
njnj
MnjM
lnjl
lnjl
lnjl
njnj
M
k
knjk
eb
ebebeb
ebebX
Mnueb
lnueblnueblnueb
nuebnuebXny
Mnueb
lnueblnueblnueb
nuebnuebX
knuXebny
BME 310 Biomedical Computing -J.Schesser
246
FIR System Transient and Steady-State Response
0at input thestarting toduemainly isIt !!response! transient theis This
}0
011
11{
]}[
)]1([
][
)]1([
]1[][{]0[
0
ˆˆ)(ˆ
))1((ˆ1
)(ˆ))1((ˆ1
)1(ˆ1
)0(ˆ0
)(ˆ
))1((ˆ1
)(ˆ
))1((ˆ1
)1(ˆ1
)0(ˆ0
n
eXebeb
ebebeb
ebebX
Mnueb
lnueb
lnueb
lnueb
nuebnuebXMlny
n
k
njkjk
MnjM
lnjl
lnjl
lnjl
njnj
MnjM
lnjl
lnjl
lnjl
njnj
BME 310 Biomedical Computing -J.Schesser
247
FIR System Transient and Steady-State Response
ˆ ˆ( 0) ( 1)0 1
ˆ ˆ ˆ( ( 1)) ( ) ( ( 1))1 1
ˆ ( )
ˆ0
[ ] { [ 0] [ 1]
[ ( 1)] [ ] [ ( 1)]
[ ]}
{
j n j n
j n l j n l j n ll l l
j n MM
j
y n M X b e u n b e u n
b e u n l b e u n l b e u n l
b e u n M
X b e
ˆ( 0) ( 1)
1ˆ ˆ ˆ( ( 1)) ( ) ( ( 1))
1 1
ˆ ˆ ˆ( )
0
1 1
1 1 1
1}
This is the steady-state response!!!(Looks like the respo
n j n
j n l j n l j n ll l l
Mj n M j k j n
M kk
b e
b e b e b e
b e b Xe e
nse due to the input when the input is non-zero for all .)n
BME 310 Biomedical Computing -J.Schesser
248
An Example of the Transient and Steady State Response
x[n]
-1.5
-1
-0.5
0
0.5
1
1.5
-10 -5 0 5 10 15 20 25
y[n]
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
-10 -5 0 5 10 15 20 25
BME 310 Biomedical Computing -J.Schesser
249
Homework
• Exercises:– 6.1
• Problems:– 6.1, 6.2, – 6.4, 6.6 Use Matlab to plot the Frequency Response; show
your code– 6.7, – 6.12 Use Matlab to plot the Frequency Response; show
your code– 6.13