| 1 | |
| 2 | <refentry id="pvslpc"> |
| 3 | <indexterm id="IndexPvslpc"><primary>pvslpc</primary></indexterm> |
| 4 | <refentryinfo><title>Spectral Processing:LPC</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>pvslpc</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>pvslpc</refname> |
| 11 | <refpurpose> |
| 12 | Streaming linear prediction analysis. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | This opcode implements streaming linear prediction analysis from |
| 20 | an input signal and outputs an fsig, which can be used with other |
| 21 | pvs opcodes. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>fsig <command>pvslpc</command> asrc, idftsiz, ihop, iord[,iwin] </synopsis> |
| 28 | </refsect1> |
| 29 | <refsect1> |
| 30 | |
| 31 | <title>Initialization</title> |
| 32 | <para> |
| 33 | <emphasis>idftsiz</emphasis> -- size of lpc input frame in samples |
| 34 | and fsig analysis frame. It needs to be a power-of-two. |
| 35 | </para> |
| 36 | |
| 37 | <para> |
| 38 | <emphasis>iord</emphasis> -- linear predictor order. |
| 39 | </para> |
| 40 | |
| 41 | <para> |
| 42 | <emphasis>ihop</emphasis> -- analysis hop size. |
| 43 | </para> |
| 44 | |
| 45 | <para> |
| 46 | <emphasis>iwin</emphasis> -- window function table number (optional). |
| 47 | </para> |
| 48 | |
| 49 | </refsect1> |
| 50 | |
| 51 | <refsect1> |
| 52 | <title>Performance</title> |
| 53 | <para> |
| 54 | <emphasis>fsig</emphasis> -- fsig output |
| 55 | </para> |
| 56 | |
| 57 | <para> |
| 58 | <emphasis>asrc</emphasis> -- source signal for lpc analysis |
| 59 | </para> |
| 60 | |
| 61 | |
| 62 | </refsect1> |
| 63 | <refsect1> |
| 64 | <para> |
| 65 | This opcode is part of a suite of streaming linear prediction |
| 66 | opcodes. It analyses an input signal and produces a set of |
| 67 | LPC coefficients for an all-pole filter that models the signal's |
| 68 | spectral envelope. The transfer function for this filter is |
| 69 | then computed and its magnitude spectrum is output as |
| 70 | a streaming phase vocoder signal. |
| 71 | </para> |
| 72 | |
| 73 | <para> |
| 74 | The fundamental analysis parameters are input frame size and |
| 75 | filter order. Longer input frames will produce a more accurate |
| 76 | result in terms of frequency resolution, but will also involve |
| 77 | more computation. This is due to the computation of the |
| 78 | autocorrelation function, which is then used in the coefficient |
| 79 | computation. This part is more efficient and depends only |
| 80 | on the linear prediction order, which is also the number of |
| 81 | coefficients computed. Typical lp orders may range from |
| 82 | about 30 to 100 coefficients, but larger values can also |
| 83 | be used. |
| 84 | </para> |
| 85 | |
| 86 | <para> |
| 87 | The analyses are produced every hopsize samples. |
| 88 | Once the signal is extracted from an audio input |
| 89 | then it can be optionally windowed if a function |
| 90 | table is provided. While this is optional, it is a recommended |
| 91 | procedure (GEN20 can provide the most common windows). |
| 92 | The signal is then analysed and coefficients produced. |
| 93 | The fsig produced by this opcode is given in AMP-FREQ format. |
| 94 | The amplitudes contain the spectral envelope of the input |
| 95 | signal, and the frequencies are derived from a fundamental |
| 96 | frequency estimation computed from the autocorrelation |
| 97 | function. These do not represent the frequencies in the |
| 98 | input signal to any level of accuracy; they are only |
| 99 | placeholders. |
| 100 | </para> |
| 101 | |
| 102 | </refsect1> |
| 103 | |
| 104 | <refsect1> |
| 105 | <title>Examples</title> |
| 106 | <para> |
| 107 | Here is an example of the pvslpc opcode using an audio input |
| 108 | signal as lpc source. It uses the file <ulink url="examples/pvslpc.csd"><citetitle>pvslpc.csd</citetitle></ulink>. |
| 109 | <example> |
| 110 | <title>Example of the pvslpc opcode.</title> |
| 111 | <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> |
| 112 | <xi:include href="examples-xml/pvslpc.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 113 | </example> |
| 114 | </para> |
| 115 | </refsect1> |
| 116 | |
| 117 | <refsect1> |
| 118 | <title>See also</title> |
| 119 | <para><link linkend="SpectralLpcresyn"><citetitle>Streaming Linear Predictive Coding (SLPC) Resynthesis</citetitle></link></para> |
| 120 | </refsect1> |
| 121 | |
| 122 | </refentry> |