SPBCOEFS - compute spectral band coefficients
SPBCOEFS x f f1 f2 n w r
|x||value vector (amplitude spectrum)|
|f||argument vector (frequency scale)|
|f1, f2||integration range (must be inside the values of scale f)|
|n||number of integration coefficients (number of bands). This parameter is ignored if f1 and f2 are vectors.|
|w||type of integration window:||'Rectangle'||(non overlapping)|
|'XTriangle'||(50% overlapping, + last/first half window)|
|r||relative values (divide integration result by sum of integration weights)|
Compute spectral band coefficients.
1) The frequency scale f must be in the same unit in which the bands should be equally spaced (E.g. to compute the Mel spectral coefficients, the scale must be transformed to Mel) and must have the same length as x.
2) f1 and f2 must use the same scale as f.
3) The frequency range is split into n bands. For every band
-1, a coefficient y
[i] is calculated.
4) The calculation of the
bi for all n bands (
-1) depends on w:
|w = Rectangle|
|w = Triangle|
|w = XTriangle|
5) If r is
1 (On/Yes), the sum of the x values in a band is divided by the sum of the weightings (i.e. the area of the window function).
6) The inputs x and f are normally amplitude spectrum (linear, power or log) and a frequency scale (Hz, Mel, Bark etc.). Using x and f, the weighted sums can be computed for any function x