SpecPcile:

Filter: Find a percentile of FFT magnitude spectrum

Source: MachineListening.sc

Given an FFT chain this calculates the cumulative distribution of the frequency spectrum, and outputs the frequency value which corresponds to the desired percentile.

For example, to find the frequency at which 90% of the spectral energy lies below that frequency, you want the 90-percentile, which means the value of *fraction* should be 0.9. The 90-percentile or 95-percentile is often used as a measure of **spectral roll-off**.

The optional third argument **interpolate** (`ir`

) specifies whether interpolation should be used to try and make the percentile frequency estimate more accurate, at the cost of a little higher CPU usage. Set it to 1 to enable this.

Optional fourth argument is **binout** (`ir`

) specifies whether to output the bin number instead of the frequency (default 0, set to 1 to enable). If interpolate is enabled, linear interpolation on the bin number is performed.

buffer |
an FFT chain. |

fraction | |

interpolate | |

binout |

helpfile source: https://github.com/supercollider/supercollider/tree/3.13/HelpSource/Classes/SpecPcile.schelp

link::Classes/SpecPcile::

link::Classes/SpecPcile::