* Get ride of the useless tag
[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>Calling Sequence</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;omegar=6;A=1/0.2;sample=0.0001:0.05:10;
61 h2=cheb2mag(n,omegar,A,sample);
62 plot(sample,log(h2)/log(10),'frequencies','magnitude in dB')
63
64 //Plotting of frequency edges
65 minval=(-max(-log(h2)))/log(10);
66 plot2d([omegar;omegar],[minval;0],[2],"000");
67
68 //Computation of the attenuation in dB at the stopband edge
69 attenuation=-log(A*A)/log(10);
70 plot2d(sample',attenuation*ones(sample)',[5],"000")
71  ]]></programlisting>
72     </refsection>
73     <refsection role="see also">
74         <title>See Also</title>
75         <simplelist type="inline">
76             <member>
77                 <link linkend="cheb1mag">cheb1mag</link>
78             </member>
79         </simplelist>
80     </refsection>
81 </refentry>