<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>cheb2mag</TITLE>
  <TYPE>Scilab Function</TYPE>
  <DATE>April 1993</DATE>
  <SHORT_DESCRIPTION name="cheb2mag"> response of type 2 Chebyshev filter</SHORT_DESCRIPTION>
  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>[h2]=cheb2mag(n,omegar,A,sample)  </CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>
  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>n</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: integer ; filter order</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>omegar</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: real scalar : cut-off frequency</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>A</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: attenuation in stop band</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>sample</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: vector of frequencies where cheb2mag is evaluated</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>h2</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: vector of Chebyshev II filter values at sample points</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
    </PARAM_INDENT>
  </PARAM>
  <DESCRIPTION>
    <P>
    Square magnitude response of a type 2 Chebyshev filter.</P>
    <P><VERB>omegar</VERB> = stopband edge, <VERB>sample</VERB> = vector of 
    frequencies where the square magnitude <VERB>h2</VERB> is desired.</P>
  </DESCRIPTION>
  <EXAMPLE>
<![CDATA[
//Chebyshev; ripple in the stopband
n=10;omegar=6;A=1/0.2;sample=0.0001:0.05:10;
h2=cheb2mag(n,omegar,A,sample);
plot(sample,log(h2)/log(10),'frequencies','magnitude in dB')
//Plotting of frequency edges
minval=(-maxi(-log(h2)))/log(10);
plot2d([omegar;omegar],[minval;0],[2],"000");
//Computation of the attenuation in dB at the stopband edge
attenuation=-log(A*A)/log(10);
plot2d(sample',attenuation*ones(sample)',[5],"000")
 ]]>
  </EXAMPLE>
  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>cheb1mag</LINK>
    </SEE_ALSO_ITEM>
  </SEE_ALSO>
</MAN>
