Debian Codegraph @

utility/pvanal.xml

raw symbols SCIP
1
2 <refentry id="pvanal">
3 <refentryinfo><title>Utilities</title></refentryinfo>
4 <refmeta>
5 <refentrytitle>pvanal</refentrytitle>
6 </refmeta>
7
8 <refnamediv>
9 <refname>pvanal</refname>
10 <refpurpose>
11 Converts a soundfile into a series of short-time Fourier transform frames.
12 <indexterm id="IndexPvanal"><primary>pvanal</primary></indexterm>
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 Fourier analysis for the Csound <link linkend="pvoc"><citetitle>pvoc</citetitle></link> generator
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis><command>csound -U pvanal</command> [flags] infilename outfilename</synopsis>
26
27 <synopsis><command>pvanal</command> [flags] infilename outfilename</synopsis>
28 </refsect1>
29
30 <refsect1>
31 <title>Pvanal extension to create a PVOC-EX file.</title>
32 <para>
33 The standard Csound utility program pvanal has been extended to enable a PVOC-EX format file to be created, using the existing interface. To create a PVOC-EX file, the file name must be given the required extension, <quote>.pvx</quote>, e.g <quote>test.pvx</quote>. The requirement for the FFT size to be a power of two is here relaxed, and any positive value is accepted; odd numbers are rounded up internally. However, power-of-two sizes are still to be preferred for all normal applications.
34 </para>
35
36 <para>
37 The channel select flags are ignored, and all source channels will be analysed and written to the output file, up to a compiler-set limit of eight channels. The analysis window size (iwinsize) is set internally to double the FFT size.
38 </para>
39 </refsect1>
40
41 <refsect1>
42 <title>Initialization</title>
43 <para>
44 <emphasis>pvanal</emphasis> converts a soundfile into a series of short-time Fourier transform (STFT) frames at regular timepoints (a frequency-domain representation). The output file can be used by <link linkend="pvoc"><citetitle>pvoc</citetitle></link> to generate audio fragments based on the original sample, with timescales and pitches arbitrarily and dynamically modified. Analysis is conditioned by the flags below. A space is optional between the flag and its argument.
45 </para>
46
47 <para>
48 <emphasis>-s srate</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.
49 </para>
50
51 <para>
52 <emphasis>-c channel</emphasis> -- channel number sought. The default is 1.
53 </para>
54
55 <para>
56 <emphasis>-b begin</emphasis> -- beginning time (in seconds) of the audio segment to be analyzed. The default is 0.0
57 </para>
58
59 <para>
60 <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.
61 </para>
62
63 <para>
64 <emphasis>-n frmsiz</emphasis> -- STFT frame size, the number of samples in each Fourier analysis frame. Must be a power of two, in the range 16 to 16384. For clean results, a frame must be larger than the longest pitch period of the sample. However, very long frames result in temporal &quot;smearing&quot; or reverberation. The bandwidth of each STFT bin is determined by sampling rate / frame size. The default framesize is the smallest power of two that corresponds to more than 20 milliseconds of the source (e.g. 256 points at 10 kHz sampling, giving a 25.6 ms frame).
65 </para>
66
67 <para>
68 <emphasis>-w windfact</emphasis> -- Window overlap factor. This controls the number of Fourier transform frames per second. Csound's <link linkend="pvoc"><citetitle>pvoc</citetitle></link> will interpolate between frames, but too few frames will generate audible distortion; too many frames will result in a huge analysis file. A good compromise for windfact is 4, meaning that each input point occurs in 4 output windows, or conversely that the offset between successive STFT frames is framesize/4. The default value is 4. Do not use this flag with <emphasis>-h</emphasis>.
69 </para>
70
71 <para>
72 <emphasis>-h hopsize</emphasis> -- STFT frame offset. Converse of above, specifying the increment in samples between successive frames of analysis (see also <link linkend="lpanal"><citetitle>lpanal</citetitle></link>). Do not use with <emphasis>-w</emphasis>.
73 </para>
74
75 <para>
76 <emphasis>-H</emphasis> -- Use a Hamming window instead of the
77 default von Hann window.
78 </para>
79
80 <para>
81 <emphasis>-K</emphasis> -- Use a Kaiser window instead of the
82 default von Hann window. The Kaiser parameter default is 6.8, but
83 can be set with the <emphasis>-B</emphasis> option.
84 </para>
85
86 <para>
87 <emphasis>-B beta</emphasis> -- Set the beta parameter for any
88 Kaiser window used to the floating point value beta.
89 </para>
90
91 </refsect1>
92
93 <refsect1>
94 <refsect2>
95 <title>Files</title>
96 <para>
97 The output file has a special <emphasis>pvoc</emphasis> header containing details of the source audio file, the analysis frame rate and overlap. Frames of analysis data are stored as float, with the magnitude and <quote>frequency</quote> (in Hz) for the first N/2 + 1 Fourier bins of each frame in turn. <quote>Frequency</quote> encodes the phase increment in such a way that for strong harmonics it gives a good indication of the true frequency. For low amplitude or rapidly moving harmonics it is less meaningful.
98 </para>
99 </refsect2>
100
101 <refsect2>
102 <title>Diagnostics</title>
103 <para>
104 Prints total number of frames, and frames completed every 20th frame.
105 </para>
106 </refsect2>
107 </refsect1>
108
109 <refsect1>
110 <title>Examples</title>
111 <para>
112 <!-- <informalexample> -->
113 <programlisting><emphasis>pvanal</emphasis> asound pvfile</programlisting>
114 <!-- </informalexample> -->
115
116 will analyze the soundfile &quot;asound&quot; using the default frmsiz and windfact to produce the file &quot;pvfile&quot; suitable for use with pvoc.
117 </para>
118 <para>
119 Here is an example of the pvanal utility. It uses the file <ulink url="examples/pvanal.csd"><citetitle>pvanal.csd</citetitle></ulink>.
120
121 <example>
122 <title>Example of the pvanal utility.</title>
123
124 <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>
125 <xi:include href="examples-xml/pvanal.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
126 </example>
127 </para>
128 </refsect1>
129
130 <refsect1>
131 <title>Credits</title>
132 <para>Author: Dan Ellis</para>
133 <para>MIT Media Lab</para>
134 <para>Cambridge, Massachussetts</para>
135 <para>1990</para>
136 </refsect1>
137 </refentry>