SuperCollider CLASSES (extension)


Instantaneous spectral power
Inherits from: UGen : AbstractFunction : Object


Outputs a power measurement (sum of squared magnitudes) taken from an FFT chain. It can be used for similar purposes as the Amplitude UGen but has different characteristics since it operates on the frequency-domain rather than time-domain representation.

The output is scaled by dividing by a factor related to the number of bins, meaning that output values occupy a similar dynamic range irrespective of the FFT frame size. To scale the power (e.g.) to lie between 0 and 1, you'll need to find an empirical value that suits the application - note the multipliers used in the examples below.

Note: The first implementation of this UGen summed the magnitudes without squaring them, which is not the ordinary definition of spectral power (it will behave in similar ways for some applications, but will have different characteristics e.g. the effect of noise). By default the UGen does now square the magnitudes, but you can achieve the old behaviour by setting the second "square" argument to false. For most uses you are recommended to leave this at its default.

Class Methods

*kr (buffer, square: true)



Inherited class methods

Instance Methods

Inherited instance methods


Server.default = s = Server.internal.boot;

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

var in, chain;
in =,1));
chain = FFT(b.bufnum, in);, in * 0.1);, ( * 0.05955912289792).poll(label:"Noise power"));


{ // Sine - note how the peak measured power changes with frequency
var in, chain;
in =, 1000, 1), 0,,1));
chain = FFT(b.bufnum, in);, in * 0.1);, ( * 0.66667).poll(label:"Sine power"));


// Let's graph the power of a soundfile
c =, "sounds/a11wlk01.wav");
var in, chain;
in =, c);
chain = FFT(b.bufnum, in);, in * 0.1);

[ * 0.2), in]