UNPKG

@thi.ng/dsp

Version:

Composable signal generators, oscillators, filters, FFT, spectrum, windowing & related DSP utils

10 lines (9 loc) 308 B
import { HALF_PI } from "@thi.ng/math/api"; const gibbs = (n, i) => Math.cos((i - 1) * HALF_PI / n) ** 2; const fejer = (k, n) => (n - k) / n; const polyBLEP = (dt, t) => t < dt ? (t /= dt, t + t - t * t - 1) : t > 1 - dt ? (t = (t - 1) / dt, t * t + t + t + 1) : 0; export { fejer, gibbs, polyBLEP };