Skip to main content

strongpeak

strongpeak(
@mode 0
) -> llll

Generates audio descriptor to compute the strong peak of a buffer, defined as the ratio between the spectrum's maximum peak's magnitude and the 'bandwidth' of the peak above a threshold—i.e., half its amplitude. This ratio reveals whether the spectrum presents a very 'pronounced' maximum peak—i.e., the thinner and the higher the maximum of the spectrum is, the higher the ratio value. Note that 'bandwidth' is defined as the width of the peak in the log10-frequency domain. Using the log10-frequency domain allows this algorithm to compare strong peaks at lower frequencies with those from higher frequencies. See analyze.

The resulting buffer will be updated with the following keys:

  • strongpeak
info

strongpeak 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

  • @mode [int]: analysis mode. (default: 0).
    • 0: global
    • 1: time series
    • 2: time-tagged time series
    • 3: buffer

Output

strongpeak descriptor [llll]


Usage

strongpeak is meant to be used with the analyze function:

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