1
cheb2mag Scilab Group Scilab Function cheb2mag
3
cheb2mag - response of type 2 Chebyshev filter
6
[h2]=cheb2mag(n,omegar,A,sample)
8
n : integer ; filter order
10
omegar : real scalar : cut-off frequency
12
A : attenuation in stop band
14
sample : vector of frequencies where cheb2mag is evaluated
16
h2 : vector of Chebyshev II filter values at sample points
19
Square magnitude response of a type 2 Chebyshev filter.
21
omegar = stopband edge, sample = vector of frequencies where the square
22
magnitude h2 is desired.
25
//Chebyshev; ripple in the stopband
26
n=10;omegar=6;A=1/0.2;sample=0.0001:0.05:10;
27
h2=cheb2mag(n,omegar,A,sample);
28
plot(sample,log(h2)/log(10),'frequencies','magnitude in dB')
29
//Plotting of frequency edges
30
minval=(-maxi(-log(h2)))/log(10);
31
plot2d([omegar;omegar],[minval;0],[2],"000");
32
//Computation of the attenuation in dB at the stopband edge
33
attenuation=-log(A*A)/log(10);
34
plot2d(sample',attenuation*ones(sample)',[5],"000")