ksum specsum wsig[, interp] specdisp wsig, iprd[, iwtflg]
interp (optional) - if non-zero, interpolate the output signal (koct or ksum). The default value is 0 (repeat the signal value between changes).
iwtflg (optional) - wait flag. If non-zero, hold each display until released by the user. The default value is 0 (no wait).
specsum - sum the magnitudes across all channels of the spectrum. At each new frame of wsig, the magnitudes are summed and released as a scalar ksum 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.
specdisp - display the magnitude values of spectrum wsig every iprd seconds (rounded to some integral number of wsig's originating iprd).
ksum specsum wsig, 1 ; sum the spec bins, and ksmooth if ksum < 2000 kgoto zero ; if sufficient amplitude koct specptrk wsig ; pitch-track the signal kgoto contin zero: koct = 0 ; else output zero contin: