594 C H A P T E R 10: Fourier Analysis of Discrete-Time Signals and Systems
linear and continuous. Indeed, the transfer function of this filter is
H 2 (z)=0.5z−^3 +1.1z−^4 +0.5z−^5 =z−^4 (0.5z+1.1+0.5z−^1 )
which gives the frequency response
H 2 (ejω)=e−j^4 ω(1.1+cos(ω))
Since 1.1+cos(ω) >0 for−π≤ω<π, the phase is∠H 2 (ejω)=− 4 ω, which is a line through the
origin with slope−4 (i.e., a linear phase)
The following script is used to compute the frequency responses of the two filters usingfft, their
wrapped phases usingangle, and then unwrapping them usingunwrap. Figure 10.7 displays the
magnitude responses of the two filters, as well as their wrapped and unwrapped phases.
%%%%%%%%%%%%%%%%%%%%%%%%%
% Example 10.11---Phase unwrapping
%%%%%%%%%%%%%%%%%%%%%%%%%
h1 = (1/10)∗ones(1,10); % fir filter 1
h2 = [ zeros(1,3) 0.5 1.1 0.5 zeros(1,3)]; % fir filter 2
H1 = fft(h1,256); % fft of h1
H2 = fft(h2,256); % fft of h2
H1m = abs(H1(1:128)); H1p = angle(H1(1:128)); % magnitude/phase of H1(z)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8
− 3
− 2
− 1
0
1
− 3
− 2
− 1
0
1
(^0) 0.2 0.4 0.6 0.8
|H
(e 1
jω
)|
<H
(e 1
ω) (rad)
<H
1 u
(e
jω) (rad)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
0
0.5
1
1.5
2
ω/πω/π ω/π
0 0.2 0.4 0.6 0.8
− 2
0
2
0 0.2 0.4 0.6 0.8
− 12
− 10
− 8
− 6
− 4
− 2
0
|H
(e 2
jω
)|
<H
(e 2
jω) (rad)
<H
(e 2 u
jω) (rad)
(a)
(b)
FIGURE 10.7
Unwrapping of the phase: (a) first filter magnitude response, and wrapped and unwrapped phase responses;
(b) second filter magnitude response, and wrapped and unwrapped phase (linear phase) responses. Notice that
the phase of the first filter cannot be unwrapped because the zeros of this filter are on the unit circle (see
corresponding magnitude response).