Skip to main content

temporalflatness

temporalflatness() -> llll

Generates audio descriptor to calculate the temporal flatness of a buffer, defined as the ratio between the buffer envelope's geometric mean and arithmetic mean. Flatness is undefined for empty input and negative values, therefore an exception is thrown in any both cases. See analyze.

The resulting buffer will be updated with the following keys:

  • temporalflatness
info

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


Output

temporalflatness descriptor [llll]


Usage

temporalflatness is meant to be used with the analyze function:

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