1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
4
<LANGUAGE>eng</LANGUAGE>
5
<TITLE>cheb2mag</TITLE>
6
<TYPE>Scilab Function</TYPE>
7
<DATE>April 1993</DATE>
8
<SHORT_DESCRIPTION name="cheb2mag"> response of type 2 Chebyshev filter</SHORT_DESCRIPTION>
10
<CALLING_SEQUENCE_ITEM>[h2]=cheb2mag(n,omegar,A,sample) </CALLING_SEQUENCE_ITEM>
15
<PARAM_NAME>n</PARAM_NAME>
17
<SP>: integer ; filter order</SP>
21
<PARAM_NAME>omegar</PARAM_NAME>
23
<SP>: real scalar : cut-off frequency</SP>
27
<PARAM_NAME>A</PARAM_NAME>
29
<SP>: attenuation in stop band</SP>
33
<PARAM_NAME>sample</PARAM_NAME>
35
<SP>: vector of frequencies where cheb2mag is evaluated</SP>
39
<PARAM_NAME>h2</PARAM_NAME>
41
<SP>: vector of Chebyshev II filter values at sample points</SP>
48
Square magnitude response of a type 2 Chebyshev filter.</P>
49
<P><VERB>omegar</VERB> = stopband edge, <VERB>sample</VERB> = vector of
50
frequencies where the square magnitude <VERB>h2</VERB> is desired.</P>
54
//Chebyshev; ripple in the stopband
55
n=10;omegar=6;A=1/0.2;sample=0.0001:0.05:10;
56
h2=cheb2mag(n,omegar,A,sample);
57
plot(sample,log(h2)/log(10),'frequencies','magnitude in dB')
58
//Plotting of frequency edges
59
minval=(-maxi(-log(h2)))/log(10);
60
plot2d([omegar;omegar],[minval;0],[2],"000");
61
//Computation of the attenuation in dB at the stopband edge
62
attenuation=-log(A*A)/log(10);
63
plot2d(sample',attenuation*ones(sample)',[5],"000")