<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>specsum</title> <link rel="stylesheet" href="csound.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /> <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" /> <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" /> <link rel="prev" href="specscal.html" title="specscal" /> <link rel="next" href="spectrum.html" title="spectrum" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">specsum</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="specscal.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="spectrum.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="specsum"> <a id="specsum"></a> <div class="titlepage"></div> <a id="IndexSpecsum" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">specsum</span> </h2> <p>specsum — Sums the magnitudes across all channels of the spectrum. </p> </div> <div class="refsect1" title="Description"> <a id="id3231350"></a> <h2>Description</h2> <p> Sums the magnitudes across all channels of the spectrum. </p> </div> <div class="refsect1" title="Syntax"> <a id="id3231362"></a> <h2>Syntax</h2> <pre class="synopsis">ksum <span class="command"><strong>specsum</strong></span> wsig [, interp]</pre> </div> <div class="refsect1" title="Initialization"> <a id="id3232172"></a> <h2>Initialization</h2> <p> <span class="emphasis"><em>interp</em></span> (optional, default-0) -- if non-zero, interpolate the output signal (<span class="emphasis"><em>koct </em></span>or <span class="emphasis"><em>ksum</em></span>). The default value is 0 (repeat the signal value between changes). </p> </div> <div class="refsect1" title="Performance"> <a id="id3232196"></a> <h2>Performance</h2> <p> <span class="emphasis"><em>ksum</em></span> -- the output signal. </p> <p> <span class="emphasis"><em>wsig</em></span> -- the input spectrum. </p> <p> Sums the magnitudes across all channels of the spectrum. At each new frame of <span class="emphasis"><em>wsig</em></span>, the magnitudes are summed and released as a scalar <span class="emphasis"><em>ksum</em></span> 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. </p> </div> <div class="refsect1" title="Examples"> <a id="id3232234"></a> <h2>Examples</h2> <p> </p> <div class="informalexample"> <pre class="programlisting"> ksum <span class="emphasis"><em>specsum</em></span> wsig, 1 ; sum the spec bins, and ksmooth <span class="emphasis"><em>if</em></span> ksum < 2000 <span class="emphasis"><em>kgoto</em></span> zero ; if sufficient amplitude koct <span class="emphasis"><em>specptrk</em></span> wsig ; pitch-track the signal <span class="emphasis"><em>kgoto</em></span> contin zero: koct = 0 ; else output zero contin: </pre> </div> <p> </p> </div> <div class="refsect1" title="See Also"> <a id="id3232276"></a> <h2>See Also</h2> <p> <a class="link" href="specdisp.html" title="specdisp"><em class="citetitle">specdisp</em></a> </p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="specscal.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="OpcodesTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="spectrum.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">specscal </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> spectrum</td> </tr> </table> </div> </body> </html>