| 1 | |
| 2 | <refentry id="median"> |
| 3 | <indexterm id="IndexMedian"><primary>median</primary></indexterm> |
| 4 | <refentryinfo><title>Signal Modifiers:Standard Filters</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>median</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>median</refname> |
| 13 | <refpurpose> |
| 14 | A median filter, a variant FIR lowpass filter. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Implementation of a median filter. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>ares <command>median</command> asig, ksize, imaxsize [, iskip]</synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Initialization</title> |
| 32 | <para> |
| 33 | <emphasis>imaxsize</emphasis> -- the maximun size of the window used to |
| 34 | select the data. |
| 35 | </para> |
| 36 | <para> |
| 37 | <emphasis>iskip</emphasis> -- initial |
| 38 | disposition of internal data space. A zero value will clear the |
| 39 | space; a non-zero value will allow previous information to |
| 40 | remain. The default value is 0. |
| 41 | </para> |
| 42 | </refsect1> |
| 43 | |
| 44 | <refsect1> |
| 45 | <title>Performance</title> |
| 46 | <para> |
| 47 | <emphasis>asig</emphasis> -- input signal to be filtered |
| 48 | </para> |
| 49 | <para> |
| 50 | <emphasis>ksize</emphasis> -- size of the window over which the |
| 51 | input is to be filtered. It must not exceed the maximum window |
| 52 | size; if it does it is truncated. |
| 53 | </para> |
| 54 | |
| 55 | <para> |
| 56 | <emphasis>median</emphasis> is a simple filter that retuns the |
| 57 | median value of the last <emphasis>ksize</emphasis> values. It |
| 58 | has a lowpass action. The efficiency decreases as the window |
| 59 | size increases. |
| 60 | </para> |
| 61 | </refsect1> |
| 62 | |
| 63 | <refsect1> |
| 64 | <title>Examples</title> |
| 65 | <para> |
| 66 | Here is an example of the median opcode. It uses the file <ulink url="examples/median.csd"><citetitle>median.csd</citetitle></ulink>. |
| 67 | |
| 68 | <example> |
| 69 | <title>Example of the median opcode.</title> |
| 70 | |
| 71 | |
| 72 | |
| 73 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 74 | <xi:include href="examples-xml/median.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 75 | </example> |
| 76 | </para> |
| 77 | </refsect1> |
| 78 | |
| 79 | <refsect1> |
| 80 | <title>See also</title> |
| 81 | <para><link linkend="SigmodStandard"><citetitle>Standard filters: Variant FIR lowpass filter</citetitle></link></para> |
| 82 | </refsect1> |
| 83 | |
| 84 | <refsect1> |
| 85 | <title>Credits</title> |
| 86 | <para> |
| 87 | <simplelist> |
| 88 | <member>Author: &namejohn;</member> |
| 89 | <member>University of Bath</member> |
| 90 | <member>May 2010</member> |
| 91 | </simplelist> |
| 92 | </para> |
| 93 | |
| 94 | <para>New in Csound version 5.13</para> |
| 95 | </refsect1> |
| 96 | </refentry> |