| 1 | |
| 2 | <refentry id="pvsfilter"> |
| 3 | <indexterm id="IndexPvsfilter"><primary>pvsfilter</primary></indexterm> |
| 4 | <refentryinfo><title>Spectral Processing:Streaming</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>pvsfilter</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>pvsfilter</refname> |
| 11 | <refpurpose> |
| 12 | Multiply amplitudes of a pvoc stream by those of a second |
| 13 | pvoc stream, with dynamic scaling. |
| 14 | </refpurpose> |
| 15 | </refnamediv> |
| 16 | |
| 17 | <refsect1> |
| 18 | <title>Description</title> |
| 19 | <para> |
| 20 | Multiply amplitudes of a pvoc stream by those of a second |
| 21 | pvoc stream, with dynamic scaling. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>fsig <command>pvsfilter</command> fsigin, fsigfil, kdepth[, igain]</synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Performance</title> |
| 32 | <para> |
| 33 | <emphasis>fsig</emphasis> -- output pv stream |
| 34 | </para> |
| 35 | |
| 36 | <para> |
| 37 | <emphasis>fsigin</emphasis> -- input pv stream. |
| 38 | </para> |
| 39 | |
| 40 | <para> |
| 41 | <emphasis>fsigfil</emphasis> -- filtering pvoc stream. |
| 42 | </para> |
| 43 | |
| 44 | <para> |
| 45 | <emphasis>kdepth</emphasis> -- controls the depth of filtering |
| 46 | of fsigin by fsigfil . |
| 47 | </para> |
| 48 | |
| 49 | <para> |
| 50 | <emphasis>igain</emphasis> -- amplitude scaling (optional, defaults to 1). |
| 51 | </para> |
| 52 | |
| 53 | <para> |
| 54 | Here the input pvoc stream amplitudes are modified by the |
| 55 | filtering stream, keeping its frequencies intact. As usual, both |
| 56 | signals have to be in the same format. |
| 57 | </para> |
| 58 | <warning> |
| 59 | <para> |
| 60 | It is unsafe to use the same f-variable for both input and output of pvs opcodes. Using the same one might lead to undefined behavior on some opcodes. Use a different one on the left and right sides of the opcode. |
| 61 | </para> |
| 62 | </warning> |
| 63 | </refsect1> |
| 64 | |
| 65 | <refsect1> |
| 66 | <title>Examples</title> |
| 67 | <para> |
| 68 | <example> |
| 69 | <title>Example</title> |
| 70 | <programlisting> |
| 71 | kfreq <emphasis role="opc">expon</emphasis> 500, p3, 4000 <emphasis role="comment">; 3-octave sweep</emphasis> |
| 72 | kdepth <emphasis role="opc">linseg</emphasis> 1, p3/2, 0.5, p3/2, 1 <emphasis role="comment">; varying filter depth</emphasis> |
| 73 | |
| 74 | asig <emphasis role="opc">in</emphasis> <emphasis role="comment">; input</emphasis> |
| 75 | afil <emphasis role="opc">oscili</emphasis> 1, kfreq, 1 <emphasis role="comment">; filter t-domain signal</emphasis> |
| 76 | |
| 77 | fim <emphasis role="opc">pvsanal</emphasis> asig,1024,256,1024,0 <emphasis role="comment">; pvoc analysis</emphasis> |
| 78 | fil <emphasis role="opc">pvsanal</emphasis> afil,1024,256,1024,0 |
| 79 | fou <emphasis role="opc">pvsfilter</emphasis> fim, fil, kdepth <emphasis role="comment">; filter signal</emphasis> |
| 80 | aout <emphasis role="opc">pvsynth</emphasis> fou <emphasis role="comment">; pvoc synthesis</emphasis> |
| 81 | </programlisting> |
| 82 | </example> |
| 83 | |
| 84 | </para> |
| 85 | |
| 86 | <para> |
| 87 | In the example above the filter curve will depend on the |
| 88 | spectral envelope of afil; in the simple case of a sinusoid, |
| 89 | it will be equivalent to a narrowband band-pass filter.</para> |
| 90 | <para> |
| 91 | Here is an example of the use of the <emphasis>pvsfilter</emphasis> opcode. It uses the file <ulink url="examples/pvsfilter.csd"><citetitle>pvsfilter.csd</citetitle></ulink>. |
| 92 | <example> |
| 93 | <title>Example of the <emphasis>pvsfilter</emphasis> opcode.</title> |
| 94 | <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> |
| 95 | <xi:include href="examples-xml/pvsfilter.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 96 | </example> |
| 97 | </para> |
| 98 | </refsect1> |
| 99 | |
| 100 | <refsect1> |
| 101 | <title>See also</title> |
| 102 | <para><link linkend="SpectralRealTime"><citetitle>Tools for Real-time Spectral Processing (pvs opcodes)</citetitle></link></para> |
| 103 | </refsect1> |
| 104 | |
| 105 | <refsect1> |
| 106 | <title>Credits</title> |
| 107 | <para> |
| 108 | <simplelist> |
| 109 | <member>Author: &namevictor;</member> |
| 110 | <member>November 2004 </member> |
| 111 | </simplelist> |
| 112 | </para> |
| 113 | |
| 114 | <para>New plugin in version 5</para> |
| 115 | <para>November 2004.</para> |
| 116 | </refsect1> |
| 117 | </refentry> |