Skip to main content

rolloff

rolloff(
@cutoff 0.85
@samplerate 44100
@mode 0
) -> llll

Generates audio descriptor to compute the roll-off frequency of a spectrum. The roll-off frequency is defined as the frequency under which some percentage—i.e., cutoff—of the total energy of the spectrum is contained. The roll-off frequency can be used to distinguish between harmonic—i.e., below roll-off—and noisy sounds—i.e., above roll-off. See analyze.

The resulting buffer will be updated with the following keys:

  • rolloff
info

rolloff is a mirror implementation of the same algorithm in the Essentia library. For more details on the algorithm, please check the Essentia Algorithms reference.


Arguments

  • @cutoff [float]: the ratio of total energy to attain before yielding the roll-off frequency. (default: 0.85).
  • @samplerate [int]: sampling rate. (default: 44100).
  • @mode [int]: analysis mode. (default: 0).
    • 0: global
    • 1: time series
    • 2: time-tagged time series
    • 3: buffer

Output

rolloff descriptor [llll]


Usage

rolloff is meant to be used with the analyze function:

$buffer = importaudio('singing.wav'); ## input buffer
$descr = rolloff(); ## generate rolloff audio descriptor
$buffer.inspect('before analysis');
$buffer = $buffer.analyze($descr); ## apply analysis
$buffer.inspect('after analysis')