/** * Orthogonal wavelet filter table + a general periodization-boundary filter * bank, shared by `dwt` (`../typed/signal.ts`) and `idwt`/`wavedec`/`waverec` * (`./wavelets.ts`). This module is a dependency-free leaf: it must not * import from `typed/signal.ts` (which imports `dwt` derivatives) to avoid a * cycle. * * Each wavelet is stored as its decomposition low-pass filter (`dec_lo`), * pinned bit-for-bit against PyWavelets 1.8.0 (`pywt.Wavelet(name).dec_lo`). * The other three orthogonal filters are derived by the standard QMF * relations (verified against pywt's `dec_hi`/`rec_lo`/`rec_hi` for every * entry below, tolerance 1e-14): * * dec_hi[k] = -(-1)^k * dec_lo[L-1-k] (alternating flip of the reverse) * rec_lo = reverse(dec_lo) * rec_hi = reverse(dec_hi) * * Boundary mode is **periodization** (matches `pywt.dwt(..., mode='periodization')` * exactly, bit-for-bit, verified against pywt for signal lengths 8/15/16/32): * treating the signal as circularly periodic yields exactly `ceil(N/2)` * coefficients per band and admits an exact analytic inverse. The phase * alignment (derived empirically against pywt, then verified across many * filter lengths and signal lengths) is: * * analysis: cA[n] = sum_k decLo[k] * x[(2n - k + floor(L/2)) mod N] * cD[n] = sum_k decHi[k] * x[(2n - k + floor(L/2)) mod N] * synthesis: x[m] = sum_k recLo[k] * cA[j] + recHi[k] * cD[j] * where idx = mod(m - k + floor(L/2) - 1, N), only when idx is * even (j = idx / 2) — odd idx contributes zero (upsampling). * * @packageDocumentation */ /** Wavelet names supported by `dwt`/`idwt`/`wavedec`/`waverec`. */ export declare const SUPPORTED_WAVELETS: readonly string[]; /** The four orthogonal filters for a wavelet family. */ export interface WaveletFilters { decLo: number[]; decHi: number[]; recLo: number[]; recHi: number[]; } /** * Looks up (and derives) the four orthogonal filters for `wavelet`. * * @throws if `wavelet` is not one of `SUPPORTED_WAVELETS`. */ export declare function getWaveletFilters(wavelet: string): WaveletFilters; /** * Single-level DWT via a general orthogonal filter bank with periodization * boundary handling. Matches `pywt.dwt(x, wavelet, mode='periodization')` * bit-for-bit for every supported family. * * @param x - Input signal (length >= 2) * @param wavelet - One of `SUPPORTED_WAVELETS` * @returns `{ approx, detail }`, each of length `ceil(x.length / 2)` */ export declare function dwtPeriodization(x: number[], wavelet: string): { approx: number[]; detail: number[]; }; /** * Inverse single-level DWT (periodization boundary), the exact analytic * inverse of `dwtPeriodization`. Matches * `pywt.idwt(approx, detail, wavelet, mode='periodization')` bit-for-bit. * * @param approx - Approximation (low-pass) coefficients * @param detail - Detail (high-pass) coefficients, same length as `approx` * @param wavelet - One of `SUPPORTED_WAVELETS` * @returns Reconstructed signal, length `2 * approx.length` */ export declare function idwtPeriodization(approx: number[], detail: number[], wavelet: string): number[]; //# sourceMappingURL=wavelet-filters.d.ts.map