<?xml version="1.0" encoding="UTF-8"?>

<!--
 *
 * This help file was generated from buttord.sci using help_from_sci().
 *
 -->

<refentry version="5.0-subset Scilab" xml:id="buttord" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:scilab="http://www.scilab.org"
          xmlns:db="http://docbook.org/ns/docbook">

  <refnamediv>
    <refname>buttord</refname>
    <refpurpose>Compute the minimum filter order and 3dB cutoff frequency of a Butterworth filter.</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Syntax</title>
   <synopsis>
   n = buttord(Wp, Ws, Rp, Rs)
   [n, Wc] = buttord(Wp, Ws, Rp, Rs)
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
        <varlistentry>
            <term>Wp:</term>
            <listitem><para> Scalar or vector of length 2. Passband edge(s) in the range [0, 1].</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>Ws:</term>
            <listitem><para> Scalar or vector of length 2. Stopband edge(s) in the range [0, 1].</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>Rp:</term>
            <listitem><para> Passband ripple in dB.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>Rs:</term>
            <listitem><para> Stopband attenuation in dB.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>n:</term>
            <listitem><para> Minimum filter order satisfying the specifications.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>Wc:</term>
            <listitem><para> 3dB cutoff frequency/frequencies.</para></listitem>
        </varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para>
This function computes the minimum filter order of a Butterworth filter with the desired response characteristics.
The filter frequency band edges are specified by the passband frequency wp and stopband frequency ws.
Frequencies are normalized to the Nyquist frequency in the range [0,1].
Rp is measured in decibels and is the allowable passband ripple, and Rs is also in decibels and is the minimum attenuation in the stop band.
If ws>wp, the filter is a low pass filter. If wp>ws, the filter is a high pass filter.
If wp and ws are vectors of length 2, then the passband interval is defined by wp the stopband interval is defined by ws.
If wp is contained within the lower and upper limits of ws, the filter is a band-pass filter. If ws is contained within the lower and upper limits of wp the filter is a band-stop or band-reject filter.
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
Wp = 40/500;
Ws = 150/500;
[n, Wc] = buttord(Wp, Ws, 3, 60)

   ]]></programlisting>
</refsection>
</refentry>
