Digital Signal Processing Reference
In-Depth Information
cut-off wc frequency for the filter in Step 1 of Algorithm 7.3.1.1 can be deter-
mined using the library function buttord , which has the following calling
syntax:
>> [N,wc] = buttord(wp,ws,Rp,Rs,'s');
where wp is the corner frequency of the pass band, ws is the corner frequency
of the stop band, Rp is the permissible ripple in the pass band in decibels,
and Rs is the permissible attenuation in the stop band in decibels. The last
argument 's' specifies that a CT filter in the Laplace domain is to be designed.
In determining the cut-off frequency, M ATLAB uses the stop-band constraint,
Eq. (7.32).
Having determined the order and the cut-off frequency, the coefficients
of the numerator and denominator polynomials of the Butterworth filter can
be determined using the library function butter with the following calling
syntax:
>> [ num,den] = butter(N,wc,'s');
where num is a vector containing the coefficients of the numerator and den is
a vector containing the coefficients of the denominator in decreasing powers
of s .
Finally, the transfer function H ( s ) can be determined using the library func-
tion tf as follows:
>> H = tf(num,den).
For Example 7.5, the M ATLAB commands for designing the Butterworth filter
are given by
>> wp = 5; ws = 20; Rp = 1.9382; Rs = 13.9794;
% specify design parameters
%Rp = -20*log10(0.8)
% = 1.9382dB
%Rs = -20*log10(0.2)
% = 13.9794dB
>> [N,wc] = buttord (wp,ws,Rp,Rs,'s');
% determine order and
% cut-off freq
>> [num,den] = butter (N,wc,'s');
% determine num and denom
% coeff.
>> Ht = tf(num,den);
% determine transfer
% function
>> [H,w] = freqs(num,den);
% determine magnitude
% spectrum
>> plot(w,abs(H));
% plot magnitude spectrum
Search WWH ::




Custom Search