| 1 |
|
| 2 |
<refentry id="lpanal"> |
| 3 |
<refentryinfo><title>Utilities</title></refentryinfo> |
| 4 |
<refmeta> |
| 5 |
<refentrytitle>lpanal</refentrytitle> |
| 6 |
</refmeta> |
| 7 |
|
| 8 |
<refnamediv> |
| 9 |
<refname>lpanal</refname> |
| 10 |
<refpurpose> |
| 11 |
Performs both linear predictive and pitch-tracking analysis on a soundfile. |
| 12 |
<indexterm id="IndexLpanal"><primary>lpanal</primary></indexterm> |
| 13 |
</refpurpose> |
| 14 |
</refnamediv> |
| 15 |
|
| 16 |
<refsect1> |
| 17 |
<title>Description</title> |
| 18 |
<para> |
| 19 |
Linear predictive analysis for the Csound <link linkend="SpectralLpcresyn"><citetitle>Linear Predictive Coding (LPC) Resynthesis</citetitle></link> opcodes. |
| 20 |
</para> |
| 21 |
</refsect1> |
| 22 |
|
| 23 |
<refsect1> |
| 24 |
<title>Syntax</title> |
| 25 |
<synopsis><command>csound -U lpanal</command> [flags] infilename outfilename</synopsis> |
| 26 |
|
| 27 |
<synopsis><command>lpanal</command> [flags] infilename outfilename</synopsis> |
| 28 |
</refsect1> |
| 29 |
|
| 30 |
<refsect1> |
| 31 |
<title>Initialization</title> |
| 32 |
<para> |
| 33 |
<emphasis>lpanal</emphasis> performs both lpc and pitch-tracking analysis on a soundfile to produce a time-ordered sequence of <emphasis>frames</emphasis> of control information suitable for Csound resynthesis. Analysis is conditioned by the control flags below. A space is optional between the flag and its value. |
| 34 |
</para> |
| 35 |
|
| 36 |
<para> |
| 37 |
<emphasis>-a</emphasis> -- [alternate storage] asks lpanal to write a file with filter poles values rather than the usual filter coefficient files. When <emphasis>lpread</emphasis> / <emphasis>lpreson</emphasis> are used with pole files, automatic stabilization is performed and the filter should not get wild. (This is the default in the Windows GUI) - Changed by Marc Resibois. |
| 38 |
</para> |
| 39 |
|
| 40 |
<para> |
| 41 |
<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. |
| 42 |
</para> |
| 43 |
|
| 44 |
<para> |
| 45 |
<emphasis>-c channel</emphasis> -- channel number sought. The default is 1. |
| 46 |
</para> |
| 47 |
|
| 48 |
<para> |
| 49 |
<emphasis>-b begin</emphasis> -- beginning time (in seconds) of the audio segment to be analyzed. The default is 0.0 |
| 50 |
</para> |
| 51 |
|
| 52 |
<para> |
| 53 |
<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. |
| 54 |
</para> |
| 55 |
|
| 56 |
<para> |
| 57 |
<emphasis>-p npoles</emphasis> -- number of poles for analysis. The default is 34, the maximum 50. |
| 58 |
</para> |
| 59 |
|
| 60 |
<para> |
| 61 |
<emphasis>-h hopsize</emphasis> -- hop size (in samples) between frames of analysis. This determines the number of frames per second (srate / hopsize) in the output control file. The analysis framesize is hopsize * 2 samples. The default is 200, the maximum 500. |
| 62 |
</para> |
| 63 |
|
| 64 |
<para> |
| 65 |
<emphasis>-C string</emphasis> -- text for the comments field of the lpfile header. The default is the null string. |
| 66 |
</para> |
| 67 |
|
| 68 |
<para> |
| 69 |
<emphasis>-P mincps</emphasis> -- lowest frequency (in Hz) of pitch tracking. -P0 means no pitch tracking. |
| 70 |
</para> |
| 71 |
|
| 72 |
<para> |
| 73 |
<emphasis>-Q maxcps</emphasis> -- highest frequency (in Hz) of pitch tracking. The narrower the pitch range, the more accurate the pitch estimate. The defaults are -P70, -Q200. |
| 74 |
</para> |
| 75 |
|
| 76 |
<para> |
| 77 |
<emphasis>-v verbosity</emphasis> -- level of terminal information during analysis. |
| 78 |
<itemizedlist> |
| 79 |
<listitem><para>0 = none</para></listitem> |
| 80 |
<listitem><para>1 = verbose</para></listitem> |
| 81 |
<listitem><para>2 = debug</para></listitem> |
| 82 |
</itemizedlist> |
| 83 |
|
| 84 |
The default is 0. |
| 85 |
</para> |
| 86 |
|
| 87 |
<para> |
| 88 |
<emphasis>-X</emphasis> -- write machine independent format |
| 89 |
analysis file. |
| 90 |
</para> |
| 91 |
</refsect1> |
| 92 |
|
| 93 |
<refsect2> |
| 94 |
<title>File Format </title> |
| 95 |
<para> |
| 96 |
Output is a file comprised of an identifiable header plus a set of frames of floating point analysis data. Each frame contains four values of pitch and gain information, followed by <emphasis>npoles</emphasis> filter coefficients. The file is readable by Csound's <link linkend="lpread"><citetitle>lpread</citetitle></link>. |
| 97 |
</para> |
| 98 |
|
| 99 |
<para> |
| 100 |
<emphasis>lpanal</emphasis> is an extensive modification of Paul Lanksy's lpc analysis programs. |
| 101 |
</para> |
| 102 |
</refsect2> |
| 103 |
|
| 104 |
<refsect1> |
| 105 |
<title>Examples</title> |
| 106 |
<para> |
| 107 |
|
| 108 |
<programlisting> |
| 109 |
<emphasis>lpanal</emphasis> -a -p26 -d2.5 -P100 -Q400 audiofile.test lpfil22</programlisting> |
| 110 |
|
| 111 |
|
| 112 |
will analyze the first 2.5 seconds of file "audiofile.test", producing srate/200 frames per second, each containing 26-pole filter coefficients and a pitch estimate between 100 and 400 Hertz. Stabilized (<emphasis>-a</emphasis>) output will be placed in "lpfil22" in the current directory. |
| 113 |
</para> |
| 114 |
<para> |
| 115 |
Here is an example of the lpanal utility. It uses the file <ulink url="examples/lpanal.csd"><citetitle>lpanal.csd</citetitle></ulink>. |
| 116 |
|
| 117 |
<example> |
| 118 |
<title>Example of the lpanal utility.</title> |
| 119 |
|
| 120 |
<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> |
| 121 |
<xi:include href="examples-xml/lpanal.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 122 |
|
| 123 |
</example> |
| 124 |
</para> |
| 125 |
</refsect1> |
| 126 |
</refentry> |