* Bug 16365 fixed: median(m,'r'|'c') was wrong after 5dc990
[scilab.git] / scilab / modules / signal_processing / help / en_US / filters / cheb2mag.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="cheb2mag">
3     <refnamediv>
4         <refname>cheb2mag</refname>
5         <refpurpose>response of type 2 Chebyshev filter</refpurpose>
6     </refnamediv>
7     <refsynopsisdiv>
8         <title>Syntax</title>
9         <synopsis>[h2]=cheb2mag(n,omegar,A,sample)</synopsis>
10     </refsynopsisdiv>
11     <refsection>
12         <title>Arguments</title>
13         <variablelist>
14             <varlistentry>
15                 <term>n</term>
16                 <listitem>
17                     <para>integer ; filter order</para>
18                 </listitem>
19             </varlistentry>
20             <varlistentry>
21                 <term>omegar</term>
22                 <listitem>
23                     <para>real scalar : cut-off frequency</para>
24                 </listitem>
25             </varlistentry>
26             <varlistentry>
27                 <term>A</term>
28                 <listitem>
29                     <para>attenuation in stop band</para>
30                 </listitem>
31             </varlistentry>
32             <varlistentry>
33                 <term>sample</term>
34                 <listitem>
35                     <para>vector of frequencies where cheb2mag is evaluated</para>
36                 </listitem>
37             </varlistentry>
38             <varlistentry>
39                 <term>h2</term>
40                 <listitem>
41                     <para>vector of Chebyshev II filter values at sample points</para>
42                 </listitem>
43             </varlistentry>
44         </variablelist>
45     </refsection>
46     <refsection>
47         <title>Description</title>
48         <para>
49             Square magnitude response of a type 2 Chebyshev filter.
50         </para>
51         <para>
52             <literal>omegar</literal> = stopband edge, <literal>sample</literal> = vector of
53             frequencies where the square magnitude <literal>h2</literal> is desired.
54         </para>
55     </refsection>
56     <refsection>
57         <title>Examples</title>
58         <programlisting role="example"><![CDATA[
59 //Chebyshev; ripple in the stopband
60 n=10;
61 omegar=6;
62 A=1/0.2;
63 Samples=0.0001:0.05:10;
64 h2=cheb2mag(n,omegar,A,Samples);
65 plot(Samples,log(h2)/log(10))
66 xtitle("", "frequencies", "magnitude in dB");
67
68 //Plotting of frequency edges
69 minval=(-max(-log(h2)))/log(10);
70 plot2d([omegar;omegar],[minval;0],[2],"000");
71
72 //Computation of the attenuation in dB at the stopband edge
73 attenuation=-log(A*A)/log(10);
74 plot2d(Samples',attenuation*ones(Samples)',[5],"000")
75  ]]></programlisting>
76         <scilab:image><![CDATA[
77 n=10;omegar=6;A=1/0.2;Samples=0.0001:0.05:10;
78 h2=cheb2mag(n,omegar,A,Samples);
79 plot(Samples,log(h2)/log(10))
80 xtitle("", "frequencies", "magnitude in dB");
81
82 minval=(-max(-log(h2)))/log(10);
83 plot2d([omegar;omegar],[minval;0],[2],"000");
84
85 attenuation=-log(A*A)/log(10);
86 plot2d(Samples',attenuation*ones(Samples)',[5],"000")
87 ]]>     </scilab:image>
88     </refsection>
89     <refsection role="see also">
90         <title>See also</title>
91         <simplelist type="inline">
92             <member>
93                 <link linkend="cheb1mag">cheb1mag</link>
94             </member>
95         </simplelist>
96     </refsection>
97 </refentry>