QUICK-REF - CsoundManual - Top of this section - Previous - Contents - Index - Next Section

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 wsigevery 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:


QUICK-REF - CsoundManual - Top of this section - Previous - Contents - Index - Next Section

HTML Csound Manual - © Jean Piché & Peter J. Nix, 1994-97