Professional Documents
Culture Documents
Ece2610 Chap6 PDF
Ece2610 Chap6 PDF
Frequency Response
of FIR Filters 6
This chapter continues the study of FIR filters from Chapter 5,
but the emphasis is frequency response, which relates to how the
filter responds to an input of the form
0n
j
x n = e n .
A fundamental result we shall soon see, is that the frequency
response and impulse response are related through an operation
known as the Fourier transform. The Fourier transform itself is
not however formally studied in this chapter.
0n M
j j 0 k
j
y n = Ae e
k = 0
bk e
(6.3)
0n
j j 0
j
= Ae e He n
where we have defined for arbitrary
M
j j
k
He = bk e (6.4)
k=0
j
j2
j2
j
j
j2
He = e e +e +3+e +e
j2
= e + 2 cos
2 cos 2 + 3
We have used the inverse Euler formula for cosine twice
For this particular filter we have that
j
H e = 3 + 2 cos
+ 2 cos 2
j
H e = 2
Why?
Magnitude 6
4
3.248
2
0
0 1 2 3 4 5 6 2
2
Phase (rad)
2
-2
0 1 2 3 4 5 6 2
hat() (rad)
j1 n
Example: Find y n for Input x n = 5e
The input frequency is
0 = 1 rad, the amplitude is 5, and
the phase is = 0
Assuming x n is input to the 4-tap FIR filter in the previous
example, the filter output is
j 1 2 j1 n
y n = 3 + 2 cos 1 + 2 cos 2 1 e 5e
j2 jn
= 16.2415e e
0 = 1 is H e j1 =
The amplitude response or gain at
3.248; why?
j
0
0 n + + H e j 0
yn = A He cos
2
Magnitude
1.5
0.4142 0
1
0.5
0
0 0.5
1 1.5 2 2.5 3 3.5
--- ---
4 3
3
Phase (rad)
1
---
0 4
1
2
0 0.5 1 1.5 2 2.5 3 3.5
Digital Frequency
hk
k
0 M
un k
...
k
n 0
>> n = -5:20;
>> x = (10 + 4*cos(pi/4*n+pi/8) + ...
3*cos(pi/3*n-pi/4)).*ustep(n,0);
>> y = filter([1 -1 1],1,x);
>> subplot(211)
>> stem(n,x,'filled')
>> grid
>> ylabel('x[n]')
>> subplot(212)
>> stem(n,y,'filled')
>> hold
Current plot released
>> stem(n,y,'filled')
>> grid
>> ylabel('y[n]')
>> xlabel('Sample Index n')
20
15
x[n]
10
0
5 0 5 10 15 20
Transient
Interval
20
15
10
y[n]
0
Steady-state
5
5 0 5 10 15 20
Sample Index n
x = zeros(size(n));
i_n0 = find(n >= n0);
x(i_n0) = ones(size(i_n0));
If we consider just the steady-state portion of the output we
should be able to discern the same output as obtained from
the frequency domain analysis of the previous example
12
2 1.6568 = 3.3138
11.5
11
10.5
DC = 10
y[n]
10
y[n] peak
lag 1/2
9.5 sample =
/8
9
8.5
8
5 10 15 20
x[n] cos() peak Sample Index n
Suppose that
j
j 2
j 4
H e = 1 + 4e + 4e
We immediately can write that
h n = n + 4 n 2 + 4 n 4
and
y n = x n + 4x n 2 + 4x n 4
It could have been that
j2
j2
j
e
j2 + e -
H e = 1 + 8e ----------------------------
2
j2
= 1 + 8e cos 2
started in this form
2 e j 2
Example: H e j = 2j sin
Periodicity of H e j
k=0 1
(6.20)
This result is consistent with the fact that sinusoidal signals
are insensitive to 2 frequency shifts, i.e.,
j
+ 2 n j
n j2n j
n
x n = Xe = Xe e = Xe
In summary, the frequency response is unique on at most a
2 interval, say in particular the interval
Conjugate Symmetry
j
The frequency response H e is in general a complex
quantity, in most cases obeys certain symmetry properties
1
n0 = 4
0.5
0
0 0.5 1 1.5 2 2.5 3
Phase Response (rad)
Linear Phase
2
0
4 MATLAB
wraps the
2 phase mod2
0 0.5 1 1.5 2 2.5 3
hat()
1.5 2 sin
2
0.5
0
3 2 1 0 1 2 3
2
Phase Response (rad)
1
sin
atan ----------------------
0 1 cos
2
3 2 1 0 1 2 3
hat()
2 2 + 2 cos
0
3 2 1 0 1 2 3
Phase Response (rad)
3 2 1 0 1 2 3
hat()
L
L1
-
1--------------
k , 1
=
1 (6.32)
k=0
L, = 1 (why?)
j
Apply (6.32) to (6.31) by setting = e
j
1 1 e j L
H e = --- ----------------------
L
1e
j
e j L 2 e j L 2 e j L 2
1
= --- ---------------------------------------------------------------- (6.33)
L j 2 j 2 j 2
e e e
sin L 2 j L 1 2
= --------------------------- e
L sin 2
L = 10
2
0.5
= -----
-
L
0
3 2 1 0 1 2 3 4
--- ------ ------ 2 ------ 3
5 5 5 5
Phase Response (rad)
j4.5
2 e on this segment
3 2 1 0 1 2 3
hat()
Suppose that
jt
x t = Xe t (6.34)
We know that after sampling we have
jnT s j
n
x n = x nT s = Xe = Xe (6.35)
The key relationship to connect the continuous-time and the
discrete-time quantities is
= T = 2 --f-
s fs
= ----- =
f
s (6.36)
Ts
f = ------------ = - f s
-----
2T s 2
j
j
n
y n = H e Xe (6.37)
We can write y n in terms of the analog frequency variable
via
= T s
jT s jT s n
yn = He Xe (6.38)
At the output of the D-to-C converter we have the recon-
structed output
jT s jt
yt = He Xe
(6.39)
j2f f s j 2f f s t
= He Xe
>> plot(w,abs(H))
>> axis([-pi pi 0 1]); grid
>> ylabel('Magnitude Response')
>> subplot(212)
>> plot(w,angle(H))
>> axis([-pi pi -pi pi]); grid
>> ylabel('Phase Response (rad)')
>> xlabel('hat(\omega)')
0.5
0
3 2 1 0 1 2 3
Phase Response (rad)
3 2 1 0 1 2 3
hat()
>> subplot(211)
>> plot(w*1000/(2*pi),abs(H))
>> grid
>> ylabel('Magnitude Response')
>> subplot(212)
>> plot(w*1000/(2*pi),angle(H))
>> grid
>> ylabel('Phase Response (rad)')
>> xlabel('f (Hz)')
j2f f s
Magnitude and Phase Plots of H e
1
Magnitude Response
0.5
0
500 400 300 200 100 0 100 200 300 400 500
4
Phase Response (rad)
4
500 400 300 200 100 0 100 200 300 400 500
f (Hz)
j0.2
0.2472e
>> diric(0.2*pi,5)
ans = 0.6472
>> diric(0.6*pi,5)
Interpretation of Delay
In the study of the moving average filter, it was noted that
j
j
L 1 2
j
H e = D L e e
j
where D L e is a purely real function
The pure delay system
y n = x n n0
has impulse response
h n = n n0
and has frequency response
j
jn 0
He = e
We also know that the impulse response of two systems in
cascade is
h n = h1 n * h2 n
j
j
j
H e = H 1 e H 2 e
The L-point moving average filter thus incorporates a delay
of L 1 2 samples
Viewed as a cascade of subsystems
j
j
L 1 2
j
H e = DL e e (6.45)
If L is odd then the delay is an integer
If L is even then the delay is an odd half integer
ECE 2610 Signals and Systems 632