@thi.ng/dsp
Version:
Composable signal generators, oscillators, filters, FFT, spectrum, windowing & related DSP utils
78 lines • 2.3 kB
TypeScript
import type { NumericArray } from "@thi.ng/api";
import type { ComplexArray } from "./api.js";
/**
* Computes the sum of the given array.
*
* @param window -
*/
export declare const integralT: (window: NumericArray) => number;
/**
* Computes the squared sum of given array.
*
* @param window -
*/
export declare const integralTSquared: (window: NumericArray) => number;
/**
* Computes the `sum(|c(i)|)` for given complex array.
*
* @param window -
*/
export declare const integralF: ([real, img]: ComplexArray) => number;
/**
* Computes the `sum(|c(i)|^2)` for given complex array.
*
* @param window -
*/
export declare const integralFSquared: ([real, img]: ComplexArray) => number;
/**
* If `scale` is a number, returns it. Else returns `base / integralT(scale)`.
*
* @param scale -
* @param base -
*/
export declare const powerScale: (scale: number | NumericArray, base?: number) => number;
/**
* If `scale` is a number, returns it. Else returns `integralT(scale) / base`.
*
* @param scale -
* @param base -
*/
export declare const invPowerScale: (scale: number | NumericArray, base?: number) => number;
/**
* Computes sum squared power of given time or frequency domain window.
*
* @remarks
* References:
*
* - http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c13-4.pdf
* - http://www.hep.ucl.ac.uk/~rjn/saltStuff/fftNormalisation.pdf
*
* @param window -
*/
export declare const powerSumSquared: (window: NumericArray | ComplexArray) => number;
/**
* Computes mean squared power of given time or frequency domain window.
*
* @remarks
* References:
*
* - http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c13-4.pdf
* - http://www.hep.ucl.ac.uk/~rjn/saltStuff/fftNormalisation.pdf
*
* @param window -
*/
export declare const powerMeanSquared: (window: NumericArray | ComplexArray) => number;
/**
* Computes time-integral squared power of given time or frequency domain
* window.
*
* @remarks
* References:
*
* - http://www.it.uom.gr/teaching/linearalgebra/NumericalRecipiesInC/c13-4.pdf
* - http://www.hep.ucl.ac.uk/~rjn/saltStuff/fftNormalisation.pdf
*
* @param window -
*/
export declare const powerTimeIntegral: (window: NumericArray | ComplexArray, fs: number) => number;
//# sourceMappingURL=power.d.ts.map