Digital Signal Processing Reference
In-Depth Information
Fig. 7.15. Magnitude spectrum
of the Butterworth bandstop
filter designed in Example 7.12.
1
0.7943
0.6
0.4
0.1
0
0
50
100
150
200
250
300
350
400
450
500
with the transfer function of the bandstop filter is given by
H ( s ) =
H ( S )
S = 270 s / s 2 + 3 . 7 10 4
1 . 8640
=
,
3 + 2 . 4641
2 + 3 . 0292
270 s
s 2 + 3 . 7 10 4
270 s
s 2 + 3 . 7 10 4
270 s
s 2 + 3 . 7 10 4
+ 1 . 8640
which reduces to
H ( s ) = s 6 + 1 . 11 10 5 s 4 + 4 . 107 10 9 s 2 + 5 . 065 10 13
s 6 + 4 . 388 10 2 s 5 + 2 . 0737 10 5 s 4 + 4 . 302 10 7 s 3 + 7 . 673 10 9 s 2 + 6 10 11 s + 5 . 065 10 13 .
The magnitude spectrum of the bandstop filter is included in Fig. 7.15, which
confirms that the given specifications are satisfied.
7.4.3.1 M ATL AB code for designing bandstop filters
The M ATLAB code for the design of the bandstop filter required in
Example 7.12 using the Butterworth, Type I Chebyshev, Type II Chebyshev,
and elliptic implementations is as follows:
%M ATLAB code for designing bandstop filter
>> wp=[100 370]; ws=[150 250]; Rp=2; Rs=20;
% Specifications
>> % Butterworth Filter
>> [N, wn] = buttord(wp,ws,Rp,Rs,'s');
>> [num1,den1] = butter(N,wn, 'stop','s');
>> H1 = tf(num1,den1);
>> % Type I Chebyshev filter
>> [N, wn] = cheb1ord(wp,ws,Rp,Rs,'s');
>> [num2,den2] = cheby1(N,Rp,wn, 'stop','s');
>> H2 = tf(num2,den2);
>> % Type II Chebyshev filter
>> [N,wn] = cheb2ord(wp,ws,Rp,Rs,'s');
>> [num3,den3] = cheby2(N,Rs,wn, 'stop','s');
>> H3 = tf(num3,den3);
>> % Elliptic filter
>> [N,wn] = ellipord(wp,ws,Rp,Rs,'s');
>> [num4,den4] = ellip(N,Rp,Rs,wn, 'stop','s');
>> H4 = tf(num4,den4);
Search WWH ::




Custom Search