| 1 | |
| 2 | <refentry id="specsum"> |
| 3 | <indexterm id="IndexSpecsum"><primary>specsum</primary></indexterm> |
| 4 | <refentryinfo><title>Spectral Processing:Non-Standard</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>specsum</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | <refnamediv> |
| 10 | <refname>specsum</refname> |
| 11 | <refpurpose> |
| 12 | Sums the magnitudes across all channels of the spectrum. |
| 13 | </refpurpose> |
| 14 | </refnamediv> |
| 15 | |
| 16 | <refsect1> |
| 17 | <title>Description</title> |
| 18 | <para> |
| 19 | Sums the magnitudes across all channels of the spectrum. |
| 20 | </para> |
| 21 | </refsect1> |
| 22 | |
| 23 | <refsect1> |
| 24 | <title>Syntax</title> |
| 25 | <synopsis>ksum <command>specsum</command> wsig [, interp]</synopsis> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Initialization</title> |
| 30 | <para> |
| 31 | <emphasis>interp</emphasis> (optional, default-0) -- if non-zero, interpolate the output signal (<emphasis>koct </emphasis>or <emphasis>ksum</emphasis>). The default value is 0 (repeat the signal value between changes). |
| 32 | </para> |
| 33 | </refsect1> |
| 34 | |
| 35 | <refsect1> |
| 36 | <title>Performance</title> |
| 37 | <para> |
| 38 | <emphasis>ksum</emphasis> -- the output signal. |
| 39 | </para> |
| 40 | |
| 41 | <para> |
| 42 | <emphasis>wsig</emphasis> -- the input spectrum. |
| 43 | </para> |
| 44 | |
| 45 | <para> |
| 46 | Sums the magnitudes across all channels of the spectrum. At each new frame of <emphasis>wsig</emphasis>, the magnitudes are summed and released as a scalar <emphasis>ksum</emphasis> signal. Between frames, the output is either repeated or interpolated at the k-rate. This unit produces a k-signal summation of the magnitudes present in the spectral data, and is thereby a running measure of its moment-to-moment overall strength. |
| 47 | </para> |
| 48 | </refsect1> |
| 49 | |
| 50 | <refsect1> |
| 51 | <title>Examples</title> |
| 52 | <para> |
| 53 | <informalexample> |
| 54 | <programlisting> |
| 55 | ksum <emphasis role="opc">specsum</emphasis> wsig, 1 <emphasis role="comment">; sum the spec bins, and ksmooth</emphasis> |
| 56 | <emphasis role="octrl">if</emphasis> ksum <emphasis role="op"><</emphasis> 2000 <emphasis role="octrl">kgoto</emphasis> <emphasis role="olabel">zero</emphasis> <emphasis role="comment">; if sufficient amplitude</emphasis> |
| 57 | koct <emphasis role="opc">specptrk</emphasis> wsig <emphasis role="comment">; pitch-track the signal</emphasis> |
| 58 | <emphasis role="octrl">kgoto</emphasis> <emphasis role="olabel">contin</emphasis> |
| 59 | <emphasis role="olabel">zero:</emphasis> |
| 60 | koct <emphasis role="op">=</emphasis> 0 <emphasis role="comment">; else output zero</emphasis> |
| 61 | <emphasis role="olabel">contin:</emphasis></programlisting> |
| 62 | </informalexample> |
| 63 | </para> |
| 64 | </refsect1> |
| 65 | |
| 66 | <refsect1> |
| 67 | <title>See Also</title> |
| 68 | <para> |
| 69 | <link linkend="specdisp"><citetitle>specdisp</citetitle></link> |
| 70 | </para> |
| 71 | </refsect1> |
| 72 | </refentry> |