<- C I ->

specptrk, specsum, specdisp

     koct      specptrk  wsig, inptls, irolloff, iodd[, interp, ifprd, iwtflg]
     ksum      specsum   wsig[, interp]
               specdisp  wsig, iprd[, iwtflg]

INITIALIZATION

interp (optional) - if non-zero, interpolate the output signal (koct or ksum). The default value is 0 (repeat the signal value between changes).

ifprd (optional) - if non-zero, display the internally computed fundamental spectrum. The default value is 0 (no display).

iwtflg (optional) - wait flag. If non-zero, hold each display until released by the user. The default value is 0 (no wait).

PERFORMANCE

specptrk - estimate the pitch of the most prominent complex tone in the spectrum. At note initialization this unit creates a set of inptls harmonically related partials (odd if iodd non-zero) with amplitude rolloff to the fraction irolloff per octave. Then at each new frame of wsig, the spectrum is cross-correlated with this set, and the result at each point added to an internal copy of the spectrum (optionally displayed). A pitch is then estimated, and the result is released in decimal octave form. Between frames, the output is either repeated or interpolated at the K-rate.

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).

Example:


     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:
<- C I ->
Prepared from the MIT Media Lab Csound Manual, PJN, Nov 1994.