SuperCollider CLASSES (extension)


Spectral crest measure
Inherits from: UGen : AbstractFunction : Object


Given an FFT chain, this produces the spectral crest measure, which is an indicator of the "peakiness" of the spectral energy distribution. For example, white noise should produce a flat (non-peaky) spectrum, and therefore a low value for the spectral crest.

Optionally, freqlo and freqhi indicate the lower and upper frequency limits of the band to look at; by default, the whole FFT range (excluding DC and nyquist) is analysed.

In pseudo-equation form, the measure is calculated as follows:

Crest = S.maxItem / S.mean

where "S" is a list of the squared magnitudes in the spectral band. Note that this limits the value to being greater than or equal to 1. (Some research uses a logarithmic scale - you can apply the logarithm yourself if required.)

Class Methods

*kr (buffer, freqlo: 0, freqhi: 50000)



FFT chain


Inherited class methods

Instance Methods

Inherited instance methods


b = Buffer.alloc(s,2048,1);

{ // Example - vary mixture of white noise and pure tone with the mouse
var in, chain, crest;
in =,,,1));
chain = FFT(b.bufnum, in);, in.dup * 0.1);

crest =;, crest.poll(10, "crest"));

{ // Same as above but subbands rather than whole spectrum. move mouse up&down too...
var in, chain, crest1, crest2;
in =,, 1, 1)),,1));
chain = FFT(b.bufnum, in);, in.dup * 0.1);

crest1 =, 100, 2000);
crest2 =, 2000, 10000);, [crest1.poll(10, "crest1"), crest2.poll(10, "crest2")]);