| 1 |
|
| 2 |
<refentry id="cvanal"> |
| 3 |
<refentryinfo><title>Utilities</title></refentryinfo> |
| 4 |
<refmeta> |
| 5 |
<refentrytitle>cvanal</refentrytitle> |
| 6 |
</refmeta> |
| 7 |
|
| 8 |
<refnamediv> |
| 9 |
<refname>cvanal</refname> |
| 10 |
<refpurpose> |
| 11 |
Converts a soundfile into a single Fourier transform frame. |
| 12 |
<indexterm id="IndexCvanal"><primary>cvanal</primary></indexterm> |
| 13 |
</refpurpose> |
| 14 |
</refnamediv> |
| 15 |
|
| 16 |
<refsect1> |
| 17 |
<title>Description</title> |
| 18 |
<para> |
| 19 |
Impulse Response Fourier Analysis for <link linkend="convolve"><citetitle>convolve</citetitle></link> operator |
| 20 |
</para> |
| 21 |
</refsect1> |
| 22 |
|
| 23 |
<refsect1> |
| 24 |
<title>Syntax</title> |
| 25 |
<synopsis><command>csound -U cvanal</command> [flags] infilename outfilename</synopsis> |
| 26 |
<synopsis><command>cvanal</command> [flags] infilename outfilename</synopsis> |
| 27 |
</refsect1> |
| 28 |
|
| 29 |
<refsect1> |
| 30 |
<title>Initialization</title> |
| 31 |
<para> |
| 32 |
<emphasis>cvanal</emphasis> -- converts a soundfile into a single Fourier transform frame. The output file can be used by the <emphasis>convolve</emphasis> operator to perform Fast Convolution between an input signal and the original impulse response. Analysis is conditioned by the flags below. A space is optional between the flag and its argument. |
| 33 |
</para> |
| 34 |
|
| 35 |
<para> |
| 36 |
<emphasis>-s rate</emphasis> -- sampling rate of the audio input file. This will over-ride the srate of the soundfile header, which otherwise applies. If neither is present, the default is 10000. |
| 37 |
</para> |
| 38 |
|
| 39 |
<para> |
| 40 |
<emphasis>-c channel</emphasis> -- channel number sought. If omitted, the default is to process all channels. If a value is given, only the selected channel will be processed. |
| 41 |
</para> |
| 42 |
|
| 43 |
<para> |
| 44 |
<emphasis>-b begin</emphasis> -- beginning time (in seconds) of the audio segment to be analyzed. The default is 0.0 |
| 45 |
</para> |
| 46 |
|
| 47 |
<para> |
| 48 |
<emphasis>-d duration</emphasis> -- duration (in seconds) of the audio segment to be analyzed. The default of 0.0 means to the end of the file. |
| 49 |
</para> |
| 50 |
|
| 51 |
<para> |
| 52 |
<emphasis>-X</emphasis> -- write machine independent format |
| 53 |
analysis file. |
| 54 |
</para> |
| 55 |
</refsect1> |
| 56 |
|
| 57 |
<refsect2> |
| 58 |
<title>Files</title> |
| 59 |
<para> |
| 60 |
The output file has a special <emphasis>convolve</emphasis> header, containing details of the source audio file. The analysis data is stored as <quote>float</quote>, in rectangular (real/imaginary) form. |
| 61 |
</para> |
| 62 |
|
| 63 |
<note> |
| 64 |
<title>Note</title> |
| 65 |
<para> |
| 66 |
The analysis file is <emphasis>not</emphasis> system independent! Ensure that the original impulse recording/data is retained. If/when required, the analysis file can be recreated. |
| 67 |
</para> |
| 68 |
</note> |
| 69 |
</refsect2> |
| 70 |
|
| 71 |
<refsect1> |
| 72 |
<title>Examples</title> |
| 73 |
<para> |
| 74 |
|
| 75 |
<programlisting><emphasis>cvanal</emphasis> asound cvfile</programlisting> |
| 76 |
|
| 77 |
|
| 78 |
will analyze the soundfile "asound" to produce the file "cvfile" for the use with <link linkend="convolve"><citetitle>convolve</citetitle></link>. |
| 79 |
</para> |
| 80 |
|
| 81 |
<para> |
| 82 |
To use data that is not already contained in a soundfile, a soundfile converter that accepts text files may be used to create a standard audio file, e.g., the .DAT format for SOX. This is useful for implementing FIR filters. |
| 83 |
</para> |
| 84 |
|
| 85 |
<para> |
| 86 |
Here is an example of the cvanal utility. It uses the file <ulink url="examples/cvanal.csd"><citetitle>cvanal.csd</citetitle></ulink>. |
| 87 |
<example> |
| 88 |
<title>Example of the cvanal utility.</title> |
| 89 |
<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> |
| 90 |
<xi:include href="examples-xml/cvanal.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 91 |
</example> |
| 92 |
</para> |
| 93 |
|
| 94 |
</refsect1> |
| 95 |
|
| 96 |
<refsect1> |
| 97 |
<title>Credits</title> |
| 98 |
<para>Author: Greg Sullivan</para> |
| 99 |
<para>Based on algorithm given in <emphasis>Elements Of Computer Music</emphasis>, by F. Richard Moore.</para> |
| 100 |
</refsect1> |
| 101 |
</refentry> |