summaryrefslogtreecommitdiff
path: root/opcodes/lpfreson.xml
blob: c907761913e9300c1fcbcc491d8e74a3c3ce3d37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<refentry id="lpfreson">
<indexterm id="IndexLpfreson"><primary>lpfreson</primary></indexterm>
  <refentryinfo><title>Spectral Processing:LPC</title></refentryinfo>
  <refmeta>
    <refentrytitle>lpfreson</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>lpfreson</refname>
    <refpurpose>
      Resynthesises a signal from the data passed internally by a previous lpread, applying formant shifting.
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Resynthesises a signal from the data passed internally by a previous <emphasis>lpread</emphasis>, applying formant shifting.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ares <command>lpfreson</command> asig, kfrqratio</synopsis>
 </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>asig</emphasis> -- an audio driving function for resynthesis.
    </para>

    <para>
      <emphasis>kfrqratio</emphasis> -- frequency ratio. Must be greater than 0.
    </para>

    <para>
      <emphasis>lpfreson</emphasis> receives values internally produced by a leading <emphasis>lpread</emphasis>.<emphasis>lpread</emphasis> gets its values from the control file according to the input value <emphasis>ktimpnt</emphasis> (in seconds). If <emphasis>ktimpnt</emphasis> proceeds at the analysis rate, time-normal synthesis will result; proceeding at a faster, slower, or variable rate will result in time-warped synthesis. At each k-period, <emphasis>lpread</emphasis> interpolates between adjacent frames to more accurately determine the parameter values (presented as output) and the filter coefficient settings (passed internally to a subsequent <emphasis>lpreson</emphasis>).
    </para>
    
    <para>The error signal <emphasis>kerr</emphasis> (between 0 and 1) derived during predictive analysis reflects the deterministic/random nature of the analyzed source. This will emerge low for pitched (periodic) material and higher for noisy material. The transition from voiced to unvoiced speech, for example, produces an error signal value of about .3. During synthesis, the error signal value can be used to determine the nature of the <link linkend="lpreson"><citetitle>lpreson</citetitle></link> driving function: for example, by arbitrating between pitched and non-pitched input, or even by determining a mix of the two. In normal speech resynthesis, the pitched input to <link linkend="lpreson"><citetitle>lpreson</citetitle></link> is a wideband periodic signal or pulse train derived from a unit such as <link linkend="buzz"><citetitle>buzz</citetitle></link>, and the nonpitched source is usually derived from <link linkend="rand"><citetitle>rand</citetitle></link>. However, any audio signal can be used as the driving function, the only assumption of the analysis being that it has a flat response.
    </para>
    
    <para><emphasis>lpfreson</emphasis> is a formant shifted <link linkend="lpreson"><citetitle>lpreson</citetitle></link>, in which <emphasis>kfrqratio</emphasis> is the (cps) ratio of shifted to original formant positions. This permits synthesis in which the source object changes its apparent acoustic size. <emphasis>lpfreson</emphasis> with <emphasis>kfrqratio</emphasis> = 1 is equivalent to <link linkend="lpreson"><citetitle>lpreson</citetitle></link>.
    </para>
    
    <para>Generally, <link linkend="lpreson"><citetitle>lpreson</citetitle></link> provides a means whereby the time-varying content and spectral shaping of a composite audio signal can be controlled by the dynamic spectral content of another. There can be any number of <emphasis>lpread/lpreson</emphasis> (or <emphasis>lpfreson</emphasis>) pairs in an instrument or in an orchestra; they can read from the same or different control files independently.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the lpfreson opcode. It uses the file <ulink url="examples/lpfreson.csd"><citetitle>lpfreson.csd</citetitle></ulink>.
      <example>
        <title>Example of the lpfreson opcode.</title>
        <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>
          <xi:include href="examples-xml/lpfreson.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
      </example>
      The audio file <quote>fox.wav</quote> is 2.8 seconds long. So <emphasis>filelen</emphasis>'s output should be a line like this:
      <screen>
fox.wav = 2.756667 seconds
      </screen>
    </para>
  </refsect1>
 
  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="lpread"><citetitle>lpread</citetitle></link>,
      <link linkend="lpreson"><citetitle>lpreson</citetitle></link>
    </para>
  </refsect1>
</refentry>