/** * Digital filter design + application (Wave D / remaining). FIR window design * (`firwin`), IIR Butterworth design (`butter`), the direct-form filter (`lfilter`), * and zero-phase filtering (`filtfilt`). Matches `scipy.signal`. `butter` reuses the * core `Complex` type for the analog-pole bilinear-transform pipeline. */ import { Complex } from '@danielsimonjr/mathts-core'; type Vec = readonly number[] | Float64Array; export declare const sinc: (x: number) => number; /** * FIR lowpass filter coefficients by the windowed-sinc method (Hamming window, * normalized to unit DC gain) — `scipy.signal.firwin(numtaps, cutoff)` with the * default window. `cutoff` is normalized to Nyquist (1 = Nyquist). */ export declare function firwin(numtaps: number, cutoff: number): number[]; /** * Apply an IIR/FIR filter with coefficients `b` (numerator), `a` (denominator) to * `x` (direct form II transposed). `a[0]` normalizes. Matches `scipy.signal.lfilter`. */ export declare function lfilter(b: Vec, a: Vec, x: Vec): number[]; /** * Steady-state initial conditions for `lfilter` so a constant input is unchanged at * the boundary — `scipy.signal.lfilter_zi`. Solves `(I − Aᵀ) zi = B` where `A` is the * companion matrix of `a` and `B = b[1:] − a[1:]·b[0]`. Reuses `companion` + `inv`. */ export declare function lfilterZi(b: Vec, a: Vec): number[]; /** * Zero-phase forward–backward filtering (`scipy.signal.filtfilt`), with odd * reflection padding (default pad length `3·max(len a, len b)`). The squared * magnitude response is applied with no phase distortion. */ export declare function filtfilt(b: Vec, a: Vec, x: Vec): number[]; export declare const cAdd: (p: Complex, q: Complex) => Complex; export declare const cSub: (p: Complex, q: Complex) => Complex; export declare const cMul: (p: Complex, q: Complex) => Complex; export declare const cDiv: (p: Complex, q: Complex) => Complex; /** Scale a Complex by a real number (`Complex.mul` only accepts `Scalar`, not `number`). */ export declare const cScale: (p: Complex, s: number) => Complex; /** Real polynomial coefficients (highest degree first) of ∏(x − rₖ). */ export declare function polyFromRoots(roots: Complex[]): number[]; /** Analog lowpass prototype: zeros, poles, gain (cutoff normalized to 1 rad/s). */ export interface AnalogProto { z: Complex[]; p: Complex[]; k: number; } /** Filter band type: lowpass, highpass, bandpass or bandstop. */ export type FilterBtype = 'low' | 'high' | 'bandpass' | 'bandstop'; /** zpk → transfer-function coefficients (scipy `zpk2tf`). */ export declare function zpkToTf(z: Complex[], p: Complex[], k: number): { b: number[]; a: number[]; }; /** * Digital IIR filter design pipeline shared by butter/cheby1/cheby2/ellip: * pre-warp `Wn` → frequency-transform the analog lowpass prototype (`proto`, * cutoff normalized to 1 rad/s) to the requested `btype` → bilinear transform → * zpk2tf. Matches `scipy.signal.iirfilter`'s internal pipeline (fs = 2 convention). */ export declare function analogToDigital(proto: AnalogProto, Wn: number | readonly number[], btype: FilterBtype): { b: number[]; a: number[]; }; /** * Butterworth IIR filter design — returns `{ b, a }` transfer-function coefficients. * `N` is the order, `Wn` the cutoff (scalar) or `[low, high]` band edges, normalized * to Nyquist (0..1). `btype` defaults to `'low'` (matches the original 2-arg call * unchanged). Matches `scipy.signal.butter(N, Wn, btype)`. */ export declare function butter(N: number, Wn: number | readonly number[], btype?: FilterBtype): { b: number[]; a: number[]; }; export {}; //# sourceMappingURL=signal-filter-extra.d.ts.map