/** * WASM dispatch bridge for spectral signal kernels — Slice 5.6. * * Kernels covered: * - `apply_window_f64` — in-place window multiplication * - `welch_psd_f64` — Welch's overlapped-segment-averaging PSD * - `bartlett_psd_f64` — Bartlett's non-overlapped segment-averaging PSD * - `goertzel_f64` — Goertzel single-bin DFT (returns |X[k]|²) * - `chirp_z_transform_f64` — Bluestein chirp-Z transform * * Dispatch (for arrays ≥ WASM_SIGNAL_THRESHOLD = 4096 samples): * 1. AS managed kernel (the binary the functions package bundles). * 2. Fall back to pure-JS implementation. * * The legacy native-pointer path was removed from this bridge in the * migration Phase 5 functions cutover. * * Window-type encoding: * 0 = Hann, 1 = Hamming, 2 = Blackman, 3 = Rectangular (no-op) * * Any thrown error is swallowed and the JS fallback runs — the WASM tier * is an optimisation, not a correctness requirement. */ /** Minimum sample count for WASM acceleration. */ export declare const WASM_SIGNAL_THRESHOLD = 4096; /** JS fallback: apply a window to `samples` in-place. */ export declare function applyWindowJS(samples: Float64Array, windowType: number): void; /** JS fallback: Goertzel algorithm, returns |X[k]|² at `targetFreq`. */ export declare function goertzelJS(samples: Float64Array, targetFreq: number, sampleRate: number): number; /** JS fallback: Welch's PSD. */ export declare function welchPSDJS(samples: Float64Array, frameLength: number, overlap: number, windowType: number): Float64Array; /** JS fallback: Bartlett's PSD (Welch with rectangular window, overlap=0). */ export declare function bartlettPSDJS(samples: Float64Array, frameLength: number): Float64Array; /** JS fallback: Chirp-Z Transform (Bluestein). */ export declare function chirpZTransformJS(samples: Float64Array, m: number, phiStartRe: number, phiStartIm: number, phiStepRe: number, phiStepIm: number): { re: Float64Array; im: Float64Array; }; /** * Apply a window function to `samples` in-place. * Always runs (no threshold — small arrays benefit too). */ export declare function applyWindowDispatch(samples: Float64Array, windowName: string): void; /** * Welch's PSD with WASM acceleration above threshold. */ export declare function welchPSDDispatch(samples: Float64Array, frameLength: number, overlap: number, windowName: string): Float64Array; /** * Bartlett's PSD with WASM acceleration above threshold. */ export declare function bartlettPSDDispatch(samples: Float64Array, frameLength: number): Float64Array; /** * Goertzel single-bin DFT with WASM acceleration above threshold. */ export declare function goertzelDispatch(samples: Float64Array, targetFreq: number, sampleRate: number): number; /** * Chirp-Z Transform with WASM acceleration above threshold. */ export declare function chirpZTransformDispatch(samples: Float64Array, m: number, phiStartRe: number, phiStartIm: number, phiStepRe: number, phiStepIm: number): { re: Float64Array; im: Float64Array; }; //# sourceMappingURL=wasm-bridge.d.ts.map