Digital Signal Processing Reference
In-Depth Information
The MATLAB function freqs() can be used to plot analog filter frequency responses for verifi-
cation with the following syntax:
H [ freqs(B, A, W)
B ¼ the vector containing the numerator coefficients
A ¼ the vector containing the denominator coefficients
W ¼ the vector containing the specified analog frequency points (radians per second)
H ¼ the vector containing the frequency response
The following example verifies the lowpass prototype transformation.
EXAMPLE 8.2
Given a lowpass prototype
H P ðsÞ¼ 1
s þ 1
determine each of the following analog filters and plot their magnitude responses from 0 to 200 radians per
second.
a. A highpass filter with a cutoff frequency of 40 radians per second.
b. A bandpass filter with a center frequency of 100 radians per second and bandwidth of 20 radians per second.
Solution:
a. Applying the lowpass prototype transformation by substituting s ¼ 40/s into the lowpass prototype , we obtain
an analog highpass filter:
1
4 s þ 1
s
s þ 40
H HP ðsÞ¼
¼
b. Similarly, substituting the lowpass-to-bandpass transformation
s ¼ðs 2 þ 100Þ=ð20sÞ into the lowpass
prototype leads to
1
s 2 þ 100
20s þ 1
20s
s 2 þ 20s þ 100
H BP ðsÞ¼
¼
The program for plotting the magnitude responses for the highpass filter and bandpass filter is shown in
Program 8.1, and Figure 8.6 displays the magnitude responses for the highpass filter and bandpass filter,
respectively.
Program 8.1 MATLAB program in Example 8.2.
W ¼ 0:1:200;
% Analog frequency points for computing the
%filter gains
Ha ¼ freqs([1 0],[1 40],W);
% Frequency response for the highpass filter
Hb ¼ freqs([20 0],[1 20 100],W);
%Frequency response for the bandpass filter
subplot(2,1,1);plot(W, abs(Ha), ' k ' ); grid
% The filter gain plot for highpass filter
xlabel( ' (a) Frequency (radians per second) ' )
ylabel( ' Absolute lter gain ' );
subplot(2,1,2);plot(W,abs(Hb), ' k ' );grid
% The filter gain plot for bandpass filter
xlabel(
(b) Frequency (radians per second)
)
'
'
ylabel(
Absolute
lter gain
);
'
'
Search WWH ::




Custom Search