Debian Codegraph @

opcodes/spectrum.xml

raw symbols SCIP
1
2 <refentry id="spectrum">
3 <indexterm id="IndexSpectrum"><primary>spectrum</primary></indexterm>
4 <refentryinfo><title>Spectral Processing:Non-Standard</title></refentryinfo>
5 <refmeta>
6 <refentrytitle>spectrum</refentrytitle>
7 </refmeta>
8
9 <refnamediv>
10 <refname>spectrum</refname>
11 <refpurpose>
12 Generate a constant-Q, exponentially-spaced DFT.
13 </refpurpose>
14 </refnamediv>
15
16 <refsect1>
17 <title>Description</title>
18 <para>
19 Generate a constant-Q, exponentially-spaced DFT across all octaves of a multiply-downsampled control or audio input signal.
20 </para>
21 </refsect1>
22
23 <refsect1>
24 <title>Syntax</title>
25 <synopsis>wsig <command>spectrum</command> xsig, iprd, iocts, ifrqa [, iq] [, ihann] [, idbout] \
26 [, idsprd] [, idsinrs]</synopsis>
27 </refsect1>
28
29 <refsect1>
30 <title>Initialization</title>
31 <para>
32 <emphasis>ihann</emphasis> (optional) -- apply a Hamming or Hanning window to the input. The default is 0 (Hamming window)
33 </para>
34
35 <para>
36 <emphasis>idbout</emphasis> (optional) -- coded conversion of the DFT output:
37 <itemizedlist>
38 <listitem>
39 <para>0 = magnitude</para>
40 </listitem>
41
42 <listitem>
43 <para>1 = dB</para>
44 </listitem>
45
46 <listitem>
47 <para>2 = mag squared</para>
48 </listitem>
49
50 <listitem>
51 <para>3 = root magnitude</para>
52 </listitem>
53 </itemizedlist>
54
55 The default value is 0 (magnitude).
56 </para>
57
58 <para>
59 <emphasis>idisprd</emphasis> (optional) -- if non-zero, display the composite downsampling buffer every <emphasis>idisprd</emphasis> seconds. The default value is 0 (no display).
60 </para>
61
62 <para>
63 <emphasis>idsines</emphasis> (optional) -- if non-zero, display the Hamming or Hanning windowed sinusoids used in DFT filtering. The default value is 0 (no sinusoid display).
64 </para>
65 </refsect1>
66
67 <refsect1>
68 <title>Performance</title>
69 <para>
70 This unit first puts signal <emphasis>asig</emphasis> or <emphasis>ksig</emphasis> through <emphasis>iocts</emphasis> of successive octave decimation and downsampling, and preserves a buffer of down-sampled values in each octave (optionally displayed as a composite buffer every <emphasis>idisprd</emphasis> seconds). Then at every <emphasis>iprd</emphasis> seconds, the preserved samples are passed through a filter bank (<emphasis>ifrqs</emphasis> parallel filters per octave, exponentially spaced, with frequency/bandwidth Q of <emphasis>iq</emphasis>), and the output magnitudes optionally converted (<emphasis>idbout </emphasis>) to produce a band-limited spectrum that can be read by other units.
71 </para>
72
73 <para>
74 The stages in this process are computationally intensive, and computation time varies directly with <emphasis>iocts</emphasis>, <emphasis>ifrqs</emphasis>, <emphasis>iq</emphasis>, and inversely with <emphasis>iprd</emphasis>. Settings of <emphasis>ifrqs</emphasis> = 12, <emphasis>iq</emphasis> = 10, <emphasis>idbout</emphasis> = 3, and <emphasis>iprd</emphasis> = .02 will normally be adequate, but experimentation is encouraged. <emphasis>ifrqs</emphasis> currently has a maximum of 120 divisions per octave. For audio input, the frequency bins are tuned to coincide with A440.
75 </para>
76
77 <para>
78 This unit produces a self-defining spectral datablock <emphasis>wsig</emphasis>, whose characteristics used (<emphasis>iprd</emphasis>, <emphasis>iocts</emphasis>, <emphasis>ifrqs</emphasis>, <emphasis>idbout</emphasis>) are passed via the data block itself to all derivative <emphasis>wsigs</emphasis>. There can be any number of <emphasis>spectrum</emphasis> units in an instrument or orchestra, but all <emphasis>wsig</emphasis> names must be unique.
79 </para>
80 </refsect1>
81
82 <refsect1>
83 <title>Examples</title>
84 <para>
85 <informalexample>
86 <programlisting>
87 asig <emphasis role="opc">in</emphasis> <emphasis role="comment">; get external audio</emphasis>
88 wsig <emphasis role="opc">spectrum</emphasis> asig, 0.02, 6, 12, 33, 0, 1, 1 <emphasis role="comment">; downsample in 6 octs &amp; calc a 72 pt dft</emphasis>
89 <emphasis role="comment">; (Q 33, dB out) every 20 msecs</emphasis></programlisting>
90 </informalexample>
91 </para>
92 </refsect1>
93 </refentry>