rolloff
rolloff(
@cutoff 0.85
@samplerate 44100
@mode 0
) -> llll
Generates an 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.
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
: Global1
: Time series2
: Time-tagged time series3
: 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.view('before analysis');
$buffer = $buffer.analyze($descr); ## apply analysis
$buffer.view('after analysis')