spectrum
spectrum(
@size 2048
@mode 0
) -> llll
Generates audio descriptor to compute the magnitude spectrum of a buffer. The resulting magnitude spectrum has a size which is half the size of the input array plus one. Bins contain raw (linear) magnitude values. See analyze
.
The resulting buffer will be updated with the following keys:
spectrum
info
spectrum
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
@size
[int]: frame size. (default:2048
).@mode
[int]: analysis mode. (default:0
).0
: global1
: time series2
: time-tagged time series3
: buffer
Output
spectrum descriptor [llll]
Usage
spectrum
is meant to be used with the analyze
function:
$buffer = importaudio('singing.wav'); ## input buffer
$descr = spectrum(); ## generate spectrum audio descriptor
$buffer.inspect('before analysis');
$buffer = $buffer.analyze($descr); ## apply analysis
$buffer.inspect('after analysis')