02.10.2019 Views

UploadFile_6417

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Properties of Linear-phase FIR Filters 313<br />

transformer [23] is an all-pass filter that imparts a 90 ◦ phase shift on the<br />

input signal. It is frequently used in communication systems for modulation<br />

purposes. Differentiators are used in many analog and digital systems<br />

to take the derivative of a signal.<br />

Type-4 linear-phase FIR filter: Antisymmetric impulse response,<br />

M even This case is similar to Type-2. We have (see Problem P7.5)<br />

⎡<br />

M/2<br />

∑<br />

{ (<br />

H(e jω )= ⎣ d(n) sin ω n −<br />

2)} ⎤ 1 ⎦ e j[ π 2 −ω(M−1)/2] (7.15)<br />

where<br />

and<br />

n=1<br />

( ) M<br />

d(n) =2h<br />

2 − n , n =1, 2,..., M 2<br />

M/2<br />

∑<br />

H r (ω) =<br />

n=1<br />

{ (<br />

d(n) sin ω n − 1 )}<br />

2<br />

(7.16)<br />

(7.17)<br />

Note: At ω = 0, H r (0) = 0 and e jπ/2 = j. Hence this type is also<br />

suitable for designing digital Hilbert transformers and differentiators.<br />

7.2.3 MATLAB IMPLEMENTATION<br />

The MATLAB function freqz computes the frequency response from<br />

which we can determine the magnitude response but not the amplitude<br />

response. The SP toolbox now provides the function zerophase that can<br />

compute the amplitude response. However, it easy to write simple functions<br />

to compute amplitude responses for each of the four types. We provide<br />

four functions to do this.<br />

1. Hr type1:<br />

function [Hr,w,a,L] = Hr_Type1(h);<br />

% Computes Amplitude response Hr(w) of a Type-1 LP FIR filter<br />

% -----------------------------------------------------------<br />

% [Hr,w,a,L] = Hr_Type1(h)<br />

% Hr = Amplitude Response<br />

% w = 500 frequencies between [0 pi] over which Hr is computed<br />

% a = Type-1 LP filter coefficients<br />

% L = Order of Hr<br />

% h = Type-1 LP filter impulse response<br />

%<br />

M = length(h); L = (M-1)/2;<br />

a = [h(L+1) 2*h(L:-1:1)]; % 1x(L+1) row vector<br />

n = [0:1:L];<br />

% (L+1)x1 column vector<br />

w = [0:1:500]’*pi/500; Hr = cos(w*n)*a’;<br />

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).<br />

Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!