660 C H A P T E R 11: Introduction to the Design of Discrete Filters
is sampled using the Nyquist frequency and processed with a discrete filterH(z)that is obtained
from a second-order, high-pass analog filter
H(s)=
s^2
s^2 +
√
2 s+ 1
The discrete-time outputy[n] is then converted into analog. Apply MATLAB’sbilinearfunction to
obtain the discrete filter with half-power frequenciesωhp=π/2. Use MATLAB to plot the poles
and the zeros of the discrete filter in thez-plane and the corresponding magnitude and phase
responses. Use the functionplotto plot the sampled input and the filter output and consider these
approximations to the analog signals. Change the frequency scale of the discrete filter intofin
hertz and indicate what is the corresponding half-power frequency in hertz.
Solution
The coefficients of the numerator and denominator of the discrete filter are found fromH(s)using
the MATLAB functionbilinear. The inputFsin this function equalsKb/2 whereKbcorresponds to
the transformation of the discrete half-power frequencyωhpinto the normalized analog half-power
frequencyhp=1. The following script is used.
%%%%%%%%%%%%%%%
% Example 11.6
%%%%%%%%%%%%%%%
b = [1 0 0]; a = [1 sqrt(2) 1]; % coefficients of analog filter
whp = 0.5∗pi; % desired half-power frequency of discrete filter
Kb = 1/tan(whp/2); Fs = Kb/2; [num, den]=bilinear(b,a,Fs); % bilinear transformation
Ts = 1/500; % sampling period
n = 0:499; x1 = cos(2∗pi∗ 20 ∗n∗Ts)+cos(2∗pi∗ 250 ∗n∗Ts); % sampled signal
zplane(num, den) % poles/zeros of discrete filter
[H,w] = freqz(num,den); % frequency response of discrete filter
phi = unwrap(angle(H)); % unwrapped phase of discrete filter
y = filter(num,den,x1); % output of discrete filter with input x1
We find the transfer function of the discrete filter to be
H(z)=
0.2929( 1 −z−^1 )^2
1 +0.1715z−^2
The poles and the zeros ofH(z)can be found with the MATLAB functionrootsand plotted with
zplane. The frequency response is obtained usingfreqz. To have the frequency scale in hertz we
consider thatω=Ts, letting= 2 πf, then
f=
ω
2 πTs
=
(ω
π
)(fs
2