Digital Signal Processing Reference
In-Depth Information
where
nums
and
denums
specify the coefficients of the numerator and denom-
inator of the analog filter and
fs
is the sampling rate in samples/s. For
Example 16.4, the M
ATLAB
code is given by
>> fs = 0.5; % fs = 1/T = k/2 = 0.5
>> nums = [1.1897]; % numerator of the CT filter
>> denums = [1 1.5421 1.1897]; % denominator of CT filter
>> [numz,denumz] = bilinear (nums,denums,fs);
% coefficients of DT filter
which returns the values
numz = [0.3188 0.6376 0.3188];
denumz = [1.0000 0.1017 0.1735],
which are the same as the coefficients obtained in Example 16.4.
Filter design using M
ATLAB
Several additional functions are provided in
M
ATLAB
for directly determining the transfer function of the digital filters. The
buttord
and
butter
functions, introduced in Chapter 7, can also be used to
compute IIR filters in the digital domain. The
buttord
function computes the
order
N
and cut-off frequency
wn
of the Butterworth filter, and the
butter
function computes the coefficients of the numerator and denominator of the
z-transfer function of the Butterworth filter. For lowpass filters, the calling
syntaxes for the
buttord
and
butter
functions are given by
buttord
function:
[N, wn] = buttord(wp, ws, rp, rs)
;
butter
function:
[numz, denumz] = butter(N, wn)
,
where
N
is the order of the lowest-order digital Butterworth filter that loses no
more than
rp
dB in the pass band and has at least
rs
dB of attenuation in the
stop band. The frequencies
wp
and
ws
are the pass-band and stop-band edge
frequencies, normalized between zero and unity, where unity corresponds to
π
radians/s. Similarly,
wn
is the normalized cut-off frequency for the Butter-
worth filter. The matrix
numz
contains the coefficients of the numerator, while
matrix
denumz
contains the coefficients of the denominator of the transfer
function of the Butterworth filter.
For Example 16.4, the M
ATLAB
code is given by
>> [N,wn] = buttord(0.25,0.75,20*log10(0.8),20*log10
(0.20));
>> [numz,denumz] = butter(N,wn);
which results in the following coefficients:
numz = [0.3188 0.6376 0.3188];
denumz = [1.0000 0.1017 0.1735],
which are identical to those obtained analytically in Example 16.4.
Search WWH ::
Custom Search