Debian Codegraph @

opcodes/lpread.xml

raw symbols SCIP
1
2 <refentry id="lpread">
3 <indexterm id="IndexLpread"><primary>lpread</primary></indexterm>
4 <refentryinfo><title>Spectral Processing:LPC</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>lpread</refentrytitle>
7 </refmeta>
8
9
10
11 <refnamediv>
12 <refname>lpread</refname>
13 <refpurpose>
14 Reads a control file of time-ordered information frames.
15 </refpurpose>
16 </refnamediv>
17
18 <refsect1>
19 <title>Description</title>
20 <para>
21 Reads a control file of time-ordered information frames.
22 </para>
23 </refsect1>
24
25 <refsect1>
26 <title>Syntax</title>
27 <synopsis>krmsr, krmso, kerr, kcps <command>lpread</command> ktimpnt, ifilcod [, inpoles] [, ifrmrate]</synopsis>
28 </refsect1>
29
30 <refsect1>
31 <title>Initialization</title>
32 <para>
33 <emphasis>ifilcod</emphasis> -- integer or character-string denoting a control-file (reflection coefficients and four parameter values) derived from n-pole linear predictive spectral analysis of a source audio signal. An integer denotes the suffix of a file <emphasis>lp.m</emphasis>; a character-string (in double quotes) gives a filename, optionally a full pathname. If not fullpath, the file is sought first in the current directory, then in that of the environment variable SADIR (if defined). Memory usage depends on the size of the file, which is held entirely in memory during computation but shared by multiple calls (see also <emphasis>adsyn</emphasis>, <link linkend="pvoc"><citetitle>pvoc</citetitle></link>).
34 </para>
35
36 <para>
37 <emphasis>inpoles</emphasis> (optional, default=0) -- number of poles in the lpc analysis. It is required only when the control file does not have a header; it is ignored when a header is detected.
38 </para>
39
40 <para>
41 <emphasis>ifrmrate</emphasis> (optional, default=0) -- frame rate per second in the lpc analysis. It is required only when the control file does not have a header; it is ignored when a header is detected.
42 </para>
43 </refsect1>
44
45 <refsect1>
46 <title>Performance</title>
47 <para>
48 <emphasis>lpread</emphasis> accesses a control file of time-ordered information frames, each containing n-pole filter coefficients derived from linear predictive analysis of a source signal at fixed time intervals (e.g. 1/100 of a second), plus four parameter values:
49 </para>
50
51 <para>
52 <emphasis>krmsr</emphasis> -- root-mean-square (rms) of the residual of analysis
53 </para>
54
55 <para>
56 <emphasis>krmso</emphasis> -- rms of the original signal
57 </para>
58
59 <para>
60 <emphasis>kerr</emphasis> -- the normalized error signal
61 </para>
62
63 <para>
64 <emphasis>kcps</emphasis> -- pitch in Hz
65 </para>
66
67 <para>
68 <emphasis>ktimpnt</emphasis> -- The passage of time, in seconds, through the analysis file. <emphasis>ktimpnt</emphasis> must always be positive, but can move forwards or backwards in time, be stationary or discontinuous, as a pointer into the analysis file.
69 </para>
70
71 <para>
72 <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 <link linkend="lpreson"><citetitle>lpreson</citetitle></link>).
73 </para>
74 <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.
75 </para>
76 <para><link linkend="lpfreson"><citetitle>lpfreson</citetitle></link> 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. <link linkend="lpfreson"><citetitle>lpfreson</citetitle></link> with <emphasis>kfrqratio</emphasis> = 1 is equivalent to <link linkend="lpreson"><citetitle>lpreson</citetitle></link>.
77 </para>
78 <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 lpread/lpreson (or lpfreson) pairs in an instrument or in an orchestra; they can read from the same or different control files independently.
79 </para>
80 </refsect1>
81
82 <refsect1>
83 <title>Examples</title>
84 <para>
85 Here is an example of the lpread opcode. It uses the file <ulink url="examples/lpread.csd"><citetitle>lpread.csd</citetitle></ulink>.
86 <example>
87 <title>Example of the lpread opcode.</title>
88 <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>
89 <xi:include href="examples-xml/lpread.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
90 </example>
91 </para>
92 </refsect1>
93
94 <refsect1>
95 <title>See also</title>
96 <para><link linkend="SpectralLpcresyn"><citetitle>Linear Predictive Coding (LPC) Resynthesis</citetitle></link></para>
97 </refsect1>
98
99 </refentry>