@danielsimonjr/mathts-functions 0.38.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/geometry/geometry-extra.d.ts +30 -0
- package/dist/geometry/geometry-extra.d.ts.map +1 -1
- package/dist/geometry/intersect3d.d.ts +57 -0
- package/dist/geometry/intersect3d.d.ts.map +1 -0
- package/dist/graph/community-coloring.d.ts +129 -0
- package/dist/graph/community-coloring.d.ts.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +947 -319
- package/dist/numeric/matrix-functions.d.ts +42 -17
- package/dist/numeric/matrix-functions.d.ts.map +1 -1
- package/dist/signal/wavelet-filters.d.ts +72 -0
- package/dist/signal/wavelet-filters.d.ts.map +1 -0
- package/dist/signal/wavelets.d.ts +13 -11
- package/dist/signal/wavelets.d.ts.map +1 -1
- package/dist/typed/graph.d.ts +12 -2
- package/dist/typed/graph.d.ts.map +1 -1
- package/dist/typed/signal.d.ts +10 -3
- package/dist/typed/signal.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -24,13 +24,23 @@
|
|
|
24
24
|
* any polynomial or entire function `f` (cos, sin, sqrt, exp, log, …)
|
|
25
25
|
* whenever the spectrum is simple.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
27
|
+
* Defective / repeated-eigenvalue matrices (confluent Hermite interpolation):
|
|
28
|
+
* - When eigenvalues repeat (or cluster within `EIGENVALUE_DISTINCT_REL_TOL`),
|
|
29
|
+
* `f(A)` depends on `f` AND its derivatives at each repeated eigenvalue —
|
|
30
|
+
* for a Jordan block `J = λI + N` (N nilpotent, `N^s = 0`),
|
|
31
|
+
* f(J) = Σ_{k=0}^{s-1} f^(k)(λ)/k! · N^k.
|
|
32
|
+
* `funm` builds the confluent node list (each distinct eigenvalue repeated
|
|
33
|
+
* to its multiplicity) and evaluates the Newton divided-difference form
|
|
34
|
+
* f(A) = Σ_k f[z_0,…,z_k] · Π_{i<k}(A − z_i I),
|
|
35
|
+
* where a run of equal nodes contributes the Taylor coefficient
|
|
36
|
+
* `f^(L)(z)/L!`. This subsumes the simple-spectrum Lagrange path.
|
|
37
|
+
* - Derivatives of `f` come from the optional `fDerivs` argument
|
|
38
|
+
* (`fDerivs[k] = f^(k+1)`, machine precision — wired for `cosm`/`sinm`) or,
|
|
39
|
+
* when omitted, from finite-difference stencils (~1e-6 accuracy).
|
|
40
|
+
* - `funm` throws (rather than return a wrong/`NaN` answer) only when `f` or a
|
|
41
|
+
* derivative is genuinely singular at a repeated eigenvalue (e.g.
|
|
42
|
+
* `sqrt`/`log` at 0) or when a needed numerical derivative order exceeds the
|
|
43
|
+
* built-in stencils (multiplicity > 5 with no analytic derivatives).
|
|
34
44
|
*
|
|
35
45
|
* @packageDocumentation
|
|
36
46
|
*/
|
|
@@ -50,25 +60,40 @@ export type ScalarComplexFunction = (z: ComplexValue) => ComplexValue;
|
|
|
50
60
|
* Evaluate the matrix function `f(A)` for a square real matrix `A`, returning
|
|
51
61
|
* a complex matrix `{re, im}`.
|
|
52
62
|
*
|
|
53
|
-
* Supports
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
63
|
+
* Supports:
|
|
64
|
+
* - diagonal matrices unconditionally (exact, elementwise);
|
|
65
|
+
* - diagonalizable matrices with pairwise-distinct eigenvalues
|
|
66
|
+
* (Lagrange-Sylvester interpolation — the fast simple-spectrum branch);
|
|
67
|
+
* - defective / non-diagonalizable matrices with repeated (or numerically
|
|
68
|
+
* clustered) eigenvalues, via **confluent Hermite interpolation** (Newton
|
|
69
|
+
* divided differences over repeated eigenvalue nodes). A matrix function of
|
|
70
|
+
* a defective matrix depends on `f` AND its derivatives at each repeated
|
|
71
|
+
* eigenvalue (for a Jordan block `J = λI + N`, `f(J) = Σ_k f^(k)(λ)/k! · N^k`),
|
|
72
|
+
* so this branch needs derivatives of `f`: pass them analytically via
|
|
73
|
+
* `fDerivs` for machine precision, or they are approximated numerically.
|
|
74
|
+
*
|
|
75
|
+
* Throws (rather than return a wrong/`NaN` answer) when `f` or its derivatives
|
|
76
|
+
* are singular at a repeated eigenvalue (e.g. `sqrt`/`log` at 0), or when a
|
|
77
|
+
* needed numerical derivative order exceeds the built-in stencils.
|
|
59
78
|
*
|
|
60
79
|
* @param A - Square real matrix, as a plain 2-D array.
|
|
61
|
-
* @param f - Scalar function to apply to
|
|
80
|
+
* @param f - Scalar function to apply to the spectrum, e.g. `cos`, `sin`,
|
|
62
81
|
* `sqrt`, `exp`, `log`, extended to complex arguments.
|
|
82
|
+
* @param fDerivs - Optional analytic derivatives of `f`: `fDerivs[k]` is
|
|
83
|
+
* `f^(k+1)`. Needed only for defective matrices; when omitted, derivatives
|
|
84
|
+
* are computed by finite differences (~1e-6 accuracy). Additive and
|
|
85
|
+
* non-breaking — distinct-spectrum inputs never consult it.
|
|
63
86
|
* @returns `{ re, im }` — the (possibly complex) matrix `f(A)`.
|
|
64
87
|
*/
|
|
65
|
-
export declare function funm(A: number[][], f: ScalarComplexFunction): ComplexMatrix;
|
|
88
|
+
export declare function funm(A: number[][], f: ScalarComplexFunction, fDerivs?: ScalarComplexFunction[]): ComplexMatrix;
|
|
66
89
|
/** Complex cosine: `cos(z) = cos(re)cosh(im) - i sin(re)sinh(im)`. */
|
|
67
90
|
export declare function complexCos(z: ComplexValue): ComplexValue;
|
|
68
91
|
/** Complex sine: `sin(z) = sin(re)cosh(im) + i cos(re)sinh(im)`. */
|
|
69
92
|
export declare function complexSin(z: ComplexValue): ComplexValue;
|
|
70
|
-
/** Matrix cosine `cos(A)`, via {@link funm} with {@link complexCos}.
|
|
93
|
+
/** Matrix cosine `cos(A)`, via {@link funm} with {@link complexCos}. Passes
|
|
94
|
+
* exact analytic derivatives so defective matrices are machine-precise. */
|
|
71
95
|
export declare function cosm(A: number[][]): ComplexMatrix;
|
|
72
|
-
/** Matrix sine `sin(A)`, via {@link funm} with {@link complexSin}.
|
|
96
|
+
/** Matrix sine `sin(A)`, via {@link funm} with {@link complexSin}. Passes
|
|
97
|
+
* exact analytic derivatives so defective matrices are machine-precise. */
|
|
73
98
|
export declare function sinm(A: number[][]): ComplexMatrix;
|
|
74
99
|
//# sourceMappingURL=matrix-functions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix-functions.d.ts","sourceRoot":"","sources":["../../src/numeric/matrix-functions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"matrix-functions.d.ts","sourceRoot":"","sources":["../../src/numeric/matrix-functions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAIH,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IACf,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;CAChB;AAED,uEAAuE;AACvE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,EAAE,YAAY,KAAK,YAAY,CAAC;AA0PtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,IAAI,CAClB,CAAC,EAAE,MAAM,EAAE,EAAE,EACb,CAAC,EAAE,qBAAqB,EACxB,OAAO,CAAC,EAAE,qBAAqB,EAAE,GAChC,aAAa,CAmGf;AAED,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,YAAY,CAKxD;AAED,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,YAAY,CAKxD;AAeD;2EAC2E;AAC3E,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,aAAa,CAEjD;AAED;2EAC2E;AAC3E,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,aAAa,CAEjD"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orthogonal wavelet filter table + a general periodization-boundary filter
|
|
3
|
+
* bank, shared by `dwt` (`../typed/signal.ts`) and `idwt`/`wavedec`/`waverec`
|
|
4
|
+
* (`./wavelets.ts`). This module is a dependency-free leaf: it must not
|
|
5
|
+
* import from `typed/signal.ts` (which imports `dwt` derivatives) to avoid a
|
|
6
|
+
* cycle.
|
|
7
|
+
*
|
|
8
|
+
* Each wavelet is stored as its decomposition low-pass filter (`dec_lo`),
|
|
9
|
+
* pinned bit-for-bit against PyWavelets 1.8.0 (`pywt.Wavelet(name).dec_lo`).
|
|
10
|
+
* The other three orthogonal filters are derived by the standard QMF
|
|
11
|
+
* relations (verified against pywt's `dec_hi`/`rec_lo`/`rec_hi` for every
|
|
12
|
+
* entry below, tolerance 1e-14):
|
|
13
|
+
*
|
|
14
|
+
* dec_hi[k] = -(-1)^k * dec_lo[L-1-k] (alternating flip of the reverse)
|
|
15
|
+
* rec_lo = reverse(dec_lo)
|
|
16
|
+
* rec_hi = reverse(dec_hi)
|
|
17
|
+
*
|
|
18
|
+
* Boundary mode is **periodization** (matches `pywt.dwt(..., mode='periodization')`
|
|
19
|
+
* exactly, bit-for-bit, verified against pywt for signal lengths 8/15/16/32):
|
|
20
|
+
* treating the signal as circularly periodic yields exactly `ceil(N/2)`
|
|
21
|
+
* coefficients per band and admits an exact analytic inverse. The phase
|
|
22
|
+
* alignment (derived empirically against pywt, then verified across many
|
|
23
|
+
* filter lengths and signal lengths) is:
|
|
24
|
+
*
|
|
25
|
+
* analysis: cA[n] = sum_k decLo[k] * x[(2n - k + floor(L/2)) mod N]
|
|
26
|
+
* cD[n] = sum_k decHi[k] * x[(2n - k + floor(L/2)) mod N]
|
|
27
|
+
* synthesis: x[m] = sum_k recLo[k] * cA[j] + recHi[k] * cD[j]
|
|
28
|
+
* where idx = mod(m - k + floor(L/2) - 1, N), only when idx is
|
|
29
|
+
* even (j = idx / 2) — odd idx contributes zero (upsampling).
|
|
30
|
+
*
|
|
31
|
+
* @packageDocumentation
|
|
32
|
+
*/
|
|
33
|
+
/** Wavelet names supported by `dwt`/`idwt`/`wavedec`/`waverec`. */
|
|
34
|
+
export declare const SUPPORTED_WAVELETS: readonly string[];
|
|
35
|
+
/** The four orthogonal filters for a wavelet family. */
|
|
36
|
+
export interface WaveletFilters {
|
|
37
|
+
decLo: number[];
|
|
38
|
+
decHi: number[];
|
|
39
|
+
recLo: number[];
|
|
40
|
+
recHi: number[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Looks up (and derives) the four orthogonal filters for `wavelet`.
|
|
44
|
+
*
|
|
45
|
+
* @throws if `wavelet` is not one of `SUPPORTED_WAVELETS`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getWaveletFilters(wavelet: string): WaveletFilters;
|
|
48
|
+
/**
|
|
49
|
+
* Single-level DWT via a general orthogonal filter bank with periodization
|
|
50
|
+
* boundary handling. Matches `pywt.dwt(x, wavelet, mode='periodization')`
|
|
51
|
+
* bit-for-bit for every supported family.
|
|
52
|
+
*
|
|
53
|
+
* @param x - Input signal (length >= 2)
|
|
54
|
+
* @param wavelet - One of `SUPPORTED_WAVELETS`
|
|
55
|
+
* @returns `{ approx, detail }`, each of length `ceil(x.length / 2)`
|
|
56
|
+
*/
|
|
57
|
+
export declare function dwtPeriodization(x: number[], wavelet: string): {
|
|
58
|
+
approx: number[];
|
|
59
|
+
detail: number[];
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Inverse single-level DWT (periodization boundary), the exact analytic
|
|
63
|
+
* inverse of `dwtPeriodization`. Matches
|
|
64
|
+
* `pywt.idwt(approx, detail, wavelet, mode='periodization')` bit-for-bit.
|
|
65
|
+
*
|
|
66
|
+
* @param approx - Approximation (low-pass) coefficients
|
|
67
|
+
* @param detail - Detail (high-pass) coefficients, same length as `approx`
|
|
68
|
+
* @param wavelet - One of `SUPPORTED_WAVELETS`
|
|
69
|
+
* @returns Reconstructed signal, length `2 * approx.length`
|
|
70
|
+
*/
|
|
71
|
+
export declare function idwtPeriodization(approx: number[], detail: number[], wavelet: string): number[];
|
|
72
|
+
//# sourceMappingURL=wavelet-filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wavelet-filters.d.ts","sourceRoot":"","sources":["../../src/signal/wavelet-filters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAmCH,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAA8B,CAAC;AAE/E,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAejE;AAQD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,CAAC,EAAE,MAAM,EAAE,EACX,OAAO,EAAE,MAAM,GACd;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAwBxC;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAwB/F"}
|
|
@@ -2,23 +2,24 @@
|
|
|
2
2
|
* Phase 6 Task 4 — inverse DWT, multilevel wavedec/waverec (perfect
|
|
3
3
|
* reconstruction), and the continuous wavelet transform (CWT).
|
|
4
4
|
*
|
|
5
|
-
* `idwt
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* `
|
|
5
|
+
* `idwt` inverts `dwt` (`../typed/signal.ts`) via the shared periodization
|
|
6
|
+
* filter bank in `./wavelet-filters.ts`, which supports the full family list
|
|
7
|
+
* (`SUPPORTED_WAVELETS`: haar, db1-4, sym2-4, coif1-2) and matches
|
|
8
|
+
* `pywt.idwt(..., mode='periodization')` bit-for-bit. For Haar/db1 this is
|
|
9
|
+
* verified equivalent to the earlier hardcoded closed-form 2-tap inverse
|
|
10
|
+
* (`x[2i] = s*(approx[i]+detail[i])`, `x[2i+1] = s*(approx[i]-detail[i])`,
|
|
11
|
+
* `s = 1/sqrt(2)`) — no behavior change for existing callers.
|
|
12
12
|
*
|
|
13
13
|
* @packageDocumentation
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
16
|
-
* Inverse single-level discrete wavelet transform
|
|
17
|
-
*
|
|
16
|
+
* Inverse single-level discrete wavelet transform (periodization boundary).
|
|
17
|
+
* Exactly inverts `dwt` for every wavelet in `SUPPORTED_WAVELETS`
|
|
18
|
+
* (`./wavelet-filters.ts`): haar, db1-4, sym2-4, coif1-2.
|
|
18
19
|
*
|
|
19
20
|
* @param approx - Approximation (low-pass) coefficients
|
|
20
21
|
* @param detail - Detail (high-pass) coefficients, same length as `approx`
|
|
21
|
-
* @param wavelet - Wavelet name (
|
|
22
|
+
* @param wavelet - Wavelet name (default 'haar'); see `SUPPORTED_WAVELETS`
|
|
22
23
|
* @returns Reconstructed signal, length `2 * approx.length`
|
|
23
24
|
*/
|
|
24
25
|
export declare function idwt(approx: number[], detail: number[], wavelet?: string): number[];
|
|
@@ -27,7 +28,8 @@ export declare function idwt(approx: number[], detail: number[], wavelet?: strin
|
|
|
27
28
|
* approximation coefficients.
|
|
28
29
|
*
|
|
29
30
|
* @param x - Input signal
|
|
30
|
-
* @param wavelet - Wavelet name (passed through to `dwt`)
|
|
31
|
+
* @param wavelet - Wavelet name (passed through to `dwt`); see
|
|
32
|
+
* `SUPPORTED_WAVELETS` in `./wavelet-filters.ts`
|
|
31
33
|
* @param level - Number of decomposition levels (>= 1)
|
|
32
34
|
* @returns `[cA_level, cD_level, cD_{level-1}, ..., cD_1]` (pywt order)
|
|
33
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wavelets.d.ts","sourceRoot":"","sources":["../../src/signal/wavelets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"wavelets.d.ts","sourceRoot":"","sources":["../../src/signal/wavelets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,MAAe,GAAG,MAAM,EAAE,CAM3F;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,MAAe,EAAE,KAAK,GAAE,MAAU,GAAG,MAAM,EAAE,EAAE,CAc5F;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,GAAE,MAAe,GAAG,MAAM,EAAE,CAU9E;AA2BD;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,MAAiB,GAAG,MAAM,EAAE,EAAE,CAYzF"}
|
package/dist/typed/graph.d.ts
CHANGED
|
@@ -252,10 +252,20 @@ export interface BetweennessOptions {
|
|
|
252
252
|
*/
|
|
253
253
|
directed?: boolean;
|
|
254
254
|
/**
|
|
255
|
-
* Normalise by
|
|
256
|
-
*
|
|
255
|
+
* Normalise by `(n-1)(n-2)` (matches `networkx.betweenness_centrality`'s
|
|
256
|
+
* default `endpoints=False` scaling — the same divisor for directed AND
|
|
257
|
+
* undirected graphs, since the raw Brandes accumulation below already
|
|
258
|
+
* naturally double-counts each undirected unordered pair {s,t} by running
|
|
259
|
+
* a source BFS from both s and t). Default: true.
|
|
257
260
|
*/
|
|
258
261
|
normalise?: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* American-spelling alias for `normalise` (matches `networkx.betweenness_centrality`'s
|
|
264
|
+
* `normalized` kwarg). When both are given, `normalized` takes precedence.
|
|
265
|
+
* Default: true — same default/behavior as `normalise`, so existing callers
|
|
266
|
+
* are unaffected.
|
|
267
|
+
*/
|
|
268
|
+
normalized?: boolean;
|
|
259
269
|
}
|
|
260
270
|
/** Result returned by betweennessCentrality. */
|
|
261
271
|
export interface BetweennessResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/typed/graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAMH;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EAAE,EAAE,EACjB,CAAC,EAAE,MAAM,EACT,QAAQ,GAAE,OAAe,GACxB,MAAM,EAAE,EAAE,CAkBZ;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CA+BlF;AAMD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,CAiC/D;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,E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,GAAG,EAAE,YAAY,CAAA;KAAE,CAAC;CAC1D;AA2GD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,MAAM,EAAE,EAAE,EACf,IAAI,CAAC,EAAE,kBAAkB,GAAG,wBAAwB,GACnD,OAAO,CAAC,iBAAiB,GAAG,wBAAwB,CAAC,CAkCvD"}
|
package/dist/typed/signal.d.ts
CHANGED
|
@@ -125,10 +125,17 @@ export declare function dst(x: number[]): number[];
|
|
|
125
125
|
*/
|
|
126
126
|
export declare function idst(X: number[]): number[];
|
|
127
127
|
/**
|
|
128
|
-
*
|
|
128
|
+
* Single-level discrete wavelet transform (periodization boundary).
|
|
129
129
|
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
130
|
+
* Haar/db1 use a dedicated closed-form (and WASM-accelerated) 2-tap path.
|
|
131
|
+
* All other supported families (db2-4, sym2-4, coif1-2) route through the
|
|
132
|
+
* general orthogonal filter bank in `../signal/wavelet-filters.ts`, which is
|
|
133
|
+
* verified to reproduce this same Haar/db1 result bit-for-bit and to match
|
|
134
|
+
* `pywt.dwt(..., mode='periodization')` for every family.
|
|
135
|
+
*
|
|
136
|
+
* @param x - Input signal (length >= 2)
|
|
137
|
+
* @param wavelet - Wavelet name; see `SUPPORTED_WAVELETS` in
|
|
138
|
+
* `../signal/wavelet-filters.ts` for the full list
|
|
132
139
|
* @returns { approx: number[], detail: number[] }
|
|
133
140
|
*/
|
|
134
141
|
export declare function dwt(x: number[], wavelet?: string): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../src/typed/signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,EACL,mBAAmB,EAOpB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../src/typed/signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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