dspx 1.3.6 → 1.4.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/README.md +26 -26
- package/binding.gyp +2 -1
- package/dist/bindings.d.ts +74 -0
- package/dist/bindings.d.ts.map +1 -1
- package/dist/bindings.js +94 -0
- package/dist/bindings.js.map +1 -1
- package/package.json +1 -1
- package/prebuilds/win32-x64/dspx.node +0 -0
- package/src/native/DspPipeline.cc +320 -81
- package/src/native/IDspStage.h +2 -10
- package/src/native/adapters/ChannelMergeStage.h +31 -0
- package/src/native/adapters/ChannelSelectStage.h +31 -0
- package/src/native/adapters/ChannelSelectorStage.h +17 -0
- package/src/native/adapters/FftStage.cc +20 -0
- package/src/native/adapters/FftStage.h +2 -0
- package/src/native/adapters/GscPreprocessorStage.h +44 -0
- package/src/native/adapters/MatrixTransformStage.h +48 -0
- package/src/native/adapters/MelSpectrogramStage.h +33 -0
- package/src/native/adapters/MfccStage.h +22 -0
- package/src/native/adapters/TimeAlignmentStage.cc +743 -0
- package/src/native/adapters/TimeAlignmentStage.h +183 -0
- package/src/native/adapters/WaveletTransformStage.h +16 -0
package/README.md
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
[](https://www.typescriptlang.org/)
|
|
6
6
|
[](./LICENSE)
|
|
7
7
|
|
|
8
|
-
> **A high-performance DSP library with native C++ acceleration,
|
|
8
|
+
> **A high-performance DSP library with native C++ acceleration, state persistence, and comprehensive time-series processing. Built for Node.js backends processing real-time biosignals, audio, and sensor data.**
|
|
9
9
|
|
|
10
10
|
** v1.0.0 Release** Fully tested (500+ tests passing), battle-tested architecture, comprehensive documentation. Ready for production workloads.
|
|
11
11
|
|
|
12
|
-
A modern DSP library built for Node.js backends processing real-time biosignals, audio streams, and sensor data. Features native C++ filters with full state serialization to Redis, enabling seamless processing across service restarts and distributed workers.
|
|
12
|
+
A modern DSP library built for Node.js backends processing real-time biosignals, audio streams, and sensor data. Features native C++ filters with full state serialization (to Redis, S3, or any storage backend), enabling seamless processing across service restarts and distributed workers.
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
@@ -39,7 +39,7 @@ graph TB
|
|
|
39
39
|
TS_API["TypeScript API<br/>bindings.ts"]
|
|
40
40
|
TS_TYPES["Type Definitions<br/>types.ts"]
|
|
41
41
|
TS_UTILS["Utilities<br/>CircularLogBuffer, TopicRouter"]
|
|
42
|
-
|
|
42
|
+
TS_PERSIST["Persistence Backends<br/>backends.ts (Redis, S3, etc.)"]
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
subgraph "N-API Bridge Layer"
|
|
@@ -69,12 +69,12 @@ graph TB
|
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
subgraph "External Services"
|
|
72
|
-
|
|
72
|
+
PERSIST_DB[("Storage<br/>(Redis, S3, etc.)")]
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
%% Connections
|
|
76
76
|
TS_API --> NAPI
|
|
77
|
-
|
|
77
|
+
TS_PERSIST --> PERSIST_DB
|
|
78
78
|
NAPI --> PIPELINE
|
|
79
79
|
PIPELINE --> ADAPTER_EXAMPLE
|
|
80
80
|
PIPELINE --> ADAPTER_STATELESS
|
|
@@ -97,13 +97,13 @@ graph TB
|
|
|
97
97
|
classDef cppUtils fill:#a8c5e2,stroke:#7a9fbe,color:#000
|
|
98
98
|
classDef external fill:#dc382d,stroke:#a82820,color:#fff
|
|
99
99
|
|
|
100
|
-
class TS_API,TS_TYPES,TS_UTILS,
|
|
100
|
+
class TS_API,TS_TYPES,TS_UTILS,TS_PERSIST tsLayer
|
|
101
101
|
class CORE_MA,CORE_RMS,CORE_MAV,CORE_VAR,CORE_ZSCORE cppCore
|
|
102
102
|
class CORE_ENGINE cppEngine
|
|
103
103
|
class POLICY_MEAN,POLICY_RMS,POLICY_MAV,POLICY_VAR,POLICY_ZSCORE cppPolicy
|
|
104
104
|
class ADAPTER_MA,ADAPTER_RMS,ADAPTER_RECT,ADAPTER_VAR,ADAPTER_ZSCORE cppAdapter
|
|
105
105
|
class CIRCULAR cppUtils
|
|
106
|
-
class
|
|
106
|
+
class PERSIST_DB external
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
### Key Architectural Principles
|
|
@@ -178,7 +178,7 @@ class MovingAverageFilter {
|
|
|
178
178
|
|
|
179
179
|
**3. Layered Design**
|
|
180
180
|
|
|
181
|
-
- **TypeScript Layer**: User-facing API, type safety,
|
|
181
|
+
- **TypeScript Layer**: User-facing API, type safety, state persistence integration
|
|
182
182
|
- **N-API Bridge**: Zero-copy data marshaling between JS and C++
|
|
183
183
|
- **C++ Core**: High-performance DSP algorithms with optimized memory management
|
|
184
184
|
|
|
@@ -192,7 +192,7 @@ State serialization uses a **layered delegation pattern** (see section 2.1):
|
|
|
192
192
|
|
|
193
193
|
Full state serialization to JSON enables:
|
|
194
194
|
|
|
195
|
-
- ✅
|
|
195
|
+
- ✅ State persistence for distributed processing
|
|
196
196
|
- ✅ Process continuity across restarts
|
|
197
197
|
- ✅ State migration between workers
|
|
198
198
|
- ✅ Data integrity validation on deserialization
|
|
@@ -210,7 +210,7 @@ This separation enables:
|
|
|
210
210
|
- ✅ Reuse of core DSP code in other projects
|
|
211
211
|
- ✅ Type-safe TypeScript API with IntelliSense
|
|
212
212
|
- ✅ Zero-copy performance through N-API
|
|
213
|
-
- ✅ Distributed processing with Redis
|
|
213
|
+
- ✅ Distributed processing with state sharing (Redis, S3, etc.)
|
|
214
214
|
|
|
215
215
|
**6. Native C++ Backend**
|
|
216
216
|
|
|
@@ -219,7 +219,7 @@ This separation enables:
|
|
|
219
219
|
- **Optimized Data Structures**: Circular buffers with O(1) operations
|
|
220
220
|
- **Template-Based**: Generic implementation supports int, float, double
|
|
221
221
|
|
|
222
|
-
**7.
|
|
222
|
+
**7. State Persistence**
|
|
223
223
|
|
|
224
224
|
The state serialization includes:
|
|
225
225
|
|
|
@@ -303,14 +303,14 @@ const output = await pipeline.process(input, {
|
|
|
303
303
|
|
|
304
304
|
## 📊 Comparison with Alternatives
|
|
305
305
|
|
|
306
|
-
| Feature | dspx
|
|
307
|
-
| ------------------ |
|
|
308
|
-
| TypeScript Support | ✅ Native
|
|
309
|
-
| Performance | ⚡⚡⚡ Native C++
|
|
310
|
-
| State Persistence | ✅ Redis
|
|
311
|
-
| Multi-Channel | ✅ Built-in
|
|
312
|
-
| Node.js Backend | ✅ Designed for
|
|
313
|
-
| Observability | ✅ Callbacks
|
|
306
|
+
| Feature | dspx | scipy/numpy | dsp.js | Web Audio API |
|
|
307
|
+
| ------------------ | ---------------------- | ------------------- | ---------- | --------------- |
|
|
308
|
+
| TypeScript Support | ✅ Native | ❌ Python-only | ⚠️ Partial | ✅ Browser-only |
|
|
309
|
+
| Performance | ⚡⚡⚡ Native C++ | ⚡⚡⚡⚡ | ⚡ Pure JS | ⚡⚡⚡ |
|
|
310
|
+
| State Persistence | ✅ Yes (Redis/S3/etc.) | ❌ Manual | ❌ None | ❌ None |
|
|
311
|
+
| Multi-Channel | ✅ Built-in | ✅ NumPy arrays | ⚠️ Limited | ✅ AudioBuffer |
|
|
312
|
+
| Node.js Backend | ✅ Designed for | ❌ Context switch | ✅ Yes | ❌ Browser |
|
|
313
|
+
| Observability | ✅ Callbacks | ❌ Print statements | ❌ None | ⚠️ Limited |
|
|
314
314
|
|
|
315
315
|
---
|
|
316
316
|
|
|
@@ -329,7 +329,7 @@ const output = await pipeline.process(input, {
|
|
|
329
329
|
- Browser-only applications (use Web Audio API)
|
|
330
330
|
- Python-based ML pipelines (use SciPy/NumPy)
|
|
331
331
|
- Hard real-time embedded systems (use bare C/C++)
|
|
332
|
-
- Ultra-low latency (<1ms) requirements (
|
|
332
|
+
- Ultra-low latency (<1ms) requirements (state persistence adds ~1-5ms)
|
|
333
333
|
|
|
334
334
|
---
|
|
335
335
|
|
|
@@ -355,7 +355,7 @@ The DSP pipeline adds ~0.3-0.4ms overhead per operation for:
|
|
|
355
355
|
- N-API boundary crossings
|
|
356
356
|
- Output buffer allocation
|
|
357
357
|
|
|
358
|
-
For **maximum FFT performance** (when you don't need multi-stage processing or
|
|
358
|
+
For **maximum FFT performance** (when you don't need multi-stage processing or state persistence), use the direct `FftProcessor`:
|
|
359
359
|
|
|
360
360
|
```javascript
|
|
361
361
|
// ⚡ FASTER: Direct FFT (no pipeline overhead)
|
|
@@ -372,7 +372,7 @@ const result = pipeline.process(signal); // Still faster than pure JS, but ~0.3m
|
|
|
372
372
|
**When to use each:**
|
|
373
373
|
|
|
374
374
|
- **FftProcessor**: Single FFT operations, maximum speed, batch processing
|
|
375
|
-
- **Pipeline**: Multi-stage processing (filter→FFT→analysis),
|
|
375
|
+
- **Pipeline**: Multi-stage processing (filter→FFT→analysis), stateful processing, complex workflows
|
|
376
376
|
|
|
377
377
|
With recent optimizations (loop unrolling, memcpy, single-channel fast paths), dspx FFT is now **4-14x faster than fft.js** across all sizes when measured correctly. See [FFT_BENCHMARK_FIX.md](docs/FFT_BENCHMARK_FIX.md) for benchmark methodology.
|
|
378
378
|
|
|
@@ -766,7 +766,7 @@ Implements a simple moving average (SMA) filter with two modes:
|
|
|
766
766
|
- **Batch mode**: O(n) computation, no state between calls
|
|
767
767
|
- **Moving mode**: O(1) per sample with circular buffer and running sum
|
|
768
768
|
- Per-channel state for multi-channel processing
|
|
769
|
-
- Full state serialization
|
|
769
|
+
- Full state serialization support
|
|
770
770
|
|
|
771
771
|
**Example:**
|
|
772
772
|
|
|
@@ -948,7 +948,7 @@ Implements an efficient RMS filter with two modes:
|
|
|
948
948
|
- **Batch mode**: O(n) computation, no state between calls
|
|
949
949
|
- **Moving mode**: O(1) per sample with circular buffer and running sum of squares
|
|
950
950
|
- Per-channel state for multi-channel processing
|
|
951
|
-
- Full state serialization
|
|
951
|
+
- Full state serialization support
|
|
952
952
|
- Always positive output (magnitude-based)
|
|
953
953
|
|
|
954
954
|
**Example:**
|
|
@@ -999,7 +999,7 @@ Implements an efficient Mean Absolute Value filter with two modes - commonly use
|
|
|
999
999
|
- **Batch mode**: O(n) computation, no state between calls
|
|
1000
1000
|
- **Moving mode**: O(1) per sample with circular buffer and running sum of absolute values
|
|
1001
1001
|
- Per-channel state for multi-channel EMG processing
|
|
1002
|
-
- Full state serialization
|
|
1002
|
+
- Full state serialization support
|
|
1003
1003
|
- Always non-negative output
|
|
1004
1004
|
- Scale-invariant: MAV(k·x) = k·MAV(x)
|
|
1005
1005
|
|
|
@@ -1115,7 +1115,7 @@ Implements variance calculation to measure data spread and variability. Supports
|
|
|
1115
1115
|
- **Moving mode**: O(1) per-sample computation using circular buffer with running sums
|
|
1116
1116
|
- Maintains running sum and running sum of squares for efficient calculation
|
|
1117
1117
|
- Per-channel state for multi-channel processing
|
|
1118
|
-
- Full state serialization
|
|
1118
|
+
- Full state serialization support including buffer contents and running values
|
|
1119
1119
|
- Variance is always non-negative (uses max(0, calculated) to handle floating-point errors)
|
|
1120
1120
|
|
|
1121
1121
|
**Mathematical Note:**
|
package/binding.gyp
CHANGED
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"src/native/utils/TimeSeriesBuffer.cc",
|
|
30
30
|
"src/native/adapters/FilterStage.cc",
|
|
31
31
|
"src/native/adapters/FilterBankStage.cc",
|
|
32
|
-
"src/native/adapters/FftStage.cc"
|
|
32
|
+
"src/native/adapters/FftStage.cc",
|
|
33
|
+
"src/native/adapters/TimeAlignmentStage.cc"
|
|
33
34
|
],
|
|
34
35
|
"include_dirs": [
|
|
35
36
|
"<!@(node -p \"require('node-addon-api').include\")",
|
package/dist/bindings.d.ts
CHANGED
|
@@ -1082,6 +1082,80 @@ declare class DspProcessor {
|
|
|
1082
1082
|
* });
|
|
1083
1083
|
*/
|
|
1084
1084
|
KalmanFilter(params?: KalmanFilterParams): this;
|
|
1085
|
+
/**
|
|
1086
|
+
* Resample irregular timestamp data to uniform time grid (production-grade).
|
|
1087
|
+
*
|
|
1088
|
+
* This stage solves the problems of irregular sampling:
|
|
1089
|
+
* - Time-based coordinate system (not index-based)
|
|
1090
|
+
* - Gap detection and configurable handling policies
|
|
1091
|
+
* - Clock drift compensation (regression or PLL)
|
|
1092
|
+
* - Multiple interpolation methods (linear, cubic, sinc)
|
|
1093
|
+
* - Proper extrapolation policies
|
|
1094
|
+
*
|
|
1095
|
+
* **Use Cases:**
|
|
1096
|
+
* - IoT sensors with network jitter
|
|
1097
|
+
* - GPS data with dropped packets
|
|
1098
|
+
* - Medical vitals with irregular sampling
|
|
1099
|
+
* - Audio streams with clock drift
|
|
1100
|
+
* - High-frequency trading data with gaps
|
|
1101
|
+
*
|
|
1102
|
+
* @param params - Time alignment parameters
|
|
1103
|
+
* @param params.targetSampleRate - Target uniform sample rate in Hz (required)
|
|
1104
|
+
* @param params.interpolationMethod - Interpolation method: "linear" (default), "cubic", or "sinc"
|
|
1105
|
+
* @param params.gapPolicy - Gap handling: "interpolate" (default), "zero-fill", "hold", "extrapolate", or "error"
|
|
1106
|
+
* @param params.gapThreshold - Gap detection threshold (multiplier of expected interval, default: 2.0)
|
|
1107
|
+
* @param params.driftCompensation - Clock drift compensation: "none" (default), "regression", or "pll"
|
|
1108
|
+
* @returns this instance for method chaining
|
|
1109
|
+
*
|
|
1110
|
+
* @throws {TypeError} If targetSampleRate is not positive
|
|
1111
|
+
* @throws {Error} If gapPolicy="error" and gap is detected during processing
|
|
1112
|
+
*
|
|
1113
|
+
* @example
|
|
1114
|
+
* // IoT sensor with network jitter → uniform 100Hz grid
|
|
1115
|
+
* const pipeline = createDspPipeline();
|
|
1116
|
+
* pipeline
|
|
1117
|
+
* .TimeAlignment({
|
|
1118
|
+
* targetSampleRate: 100, // 100 Hz output
|
|
1119
|
+
* interpolationMethod: "linear", // Fast interpolation
|
|
1120
|
+
* gapPolicy: "interpolate", // Fill gaps with interpolation
|
|
1121
|
+
* gapThreshold: 2.0, // Detect gaps > 2x expected interval
|
|
1122
|
+
* driftCompensation: "regression" // Compensate for clock drift
|
|
1123
|
+
* })
|
|
1124
|
+
* .MovingAverage({ windowDuration: 100 })
|
|
1125
|
+
* .process(irregularSamples, irregularTimestamps, { channels: 1 });
|
|
1126
|
+
*
|
|
1127
|
+
* @example
|
|
1128
|
+
* // GPS tracking with dropped packets → cubic interpolation
|
|
1129
|
+
* const gpsResampler = createDspPipeline();
|
|
1130
|
+
* gpsResampler
|
|
1131
|
+
* .TimeAlignment({
|
|
1132
|
+
* targetSampleRate: 10, // 10 Hz output
|
|
1133
|
+
* interpolationMethod: "cubic", // Smooth interpolation
|
|
1134
|
+
* gapPolicy: "hold", // Hold last value during gaps
|
|
1135
|
+
* gapThreshold: 3.0, // Detect gaps > 300ms
|
|
1136
|
+
* driftCompensation: "pll" // Phase-locked loop compensation
|
|
1137
|
+
* })
|
|
1138
|
+
* .KalmanFilter({ dimensions: 2, processNoise: 1e-5, measurementNoise: 0.01 });
|
|
1139
|
+
*
|
|
1140
|
+
* @example
|
|
1141
|
+
* // High-frequency trading → error on gap detection
|
|
1142
|
+
* const strictResampler = createDspPipeline();
|
|
1143
|
+
* strictResampler
|
|
1144
|
+
* .TimeAlignment({
|
|
1145
|
+
* targetSampleRate: 1000, // 1kHz output
|
|
1146
|
+
* interpolationMethod: "sinc", // Band-limited interpolation
|
|
1147
|
+
* gapPolicy: "error", // Fail if gaps detected
|
|
1148
|
+
* gapThreshold: 1.5, // Strict gap detection
|
|
1149
|
+
* driftCompensation: "none" // Assume perfect clock
|
|
1150
|
+
* });
|
|
1151
|
+
*/
|
|
1152
|
+
TimeAlignment(params: {
|
|
1153
|
+
targetSampleRate: number;
|
|
1154
|
+
interpolationMethod?: "linear" | "cubic" | "sinc";
|
|
1155
|
+
gapPolicy?: "interpolate" | "zero-fill" | "zeroFill" | "hold" | "extrapolate" | "error";
|
|
1156
|
+
gapThreshold?: number;
|
|
1157
|
+
driftCompensation?: "none" | "regression" | "pll";
|
|
1158
|
+
}): this;
|
|
1085
1159
|
/**
|
|
1086
1160
|
* Apply leaky integration (accumulation) using IIR filter.
|
|
1087
1161
|
*
|
package/dist/bindings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../src/ts/bindings.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,8BAA8B,EAC9B,6BAA6B,EAC7B,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EAGf,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,SAAS,EACT,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,UAAU,EACX,MAAM,YAAY,CAAC;AAGpB,OAAO,EAGL,KAAK,aAAa,EAGnB,MAAM,cAAc,CAAC;AAkCtB;;;GAGG;AACH,cAAM,YAAY;IAQJ,OAAO,CAAC,cAAc;IAPlC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,SAAS,CAAC,CAAoB;IACtC,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,YAAY,CACf;IACL,OAAO,CAAC,aAAa,CAA8B;gBAE/B,cAAc,EAAE,GAAG;IAMvC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAgBxB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAyB1B;;OAEG;IACH;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;OAEG;IACH,OAAO,CAAC,OAAO;IAyBf;;OAEG;IACH,OAAO,CAAC,SAAS;IAOjB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,aAAa,C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;;;;;;;OAiBG;IACG,OAAO,CACX,KAAK,EAAE,YAAY,GAAG,YAAY,EAAE,EACpC,mBAAmB,EAAE,YAAY,GAAG,cAAc,EAClD,mBAAmB,CAAC,EAAE,cAAc,GACnC,OAAO,CAAC,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../src/ts/bindings.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,8BAA8B,EAC9B,6BAA6B,EAC7B,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EAGf,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,SAAS,EACT,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,UAAU,EACX,MAAM,YAAY,CAAC;AAGpB,OAAO,EAGL,KAAK,aAAa,EAGnB,MAAM,cAAc,CAAC;AAkCtB;;;GAGG;AACH,cAAM,YAAY;IAQJ,OAAO,CAAC,cAAc;IAPlC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,SAAS,CAAC,CAAoB;IACtC,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,YAAY,CACf;IACL,OAAO,CAAC,aAAa,CAA8B;gBAE/B,cAAc,EAAE,GAAG;IAMvC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAgBxB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAyB1B;;OAEG;IACH;;;OAGG;IACH,OAA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,EAC3B,SAAS,GAAE,MAAa,GACvB,SAAS,CAsBX;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,EAC/C,cAAc,EAAE,MAAM,EACtB,cAAc,GAAE,MAAY,GAC3B,uBAAuB,CA4BzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqGG;AACH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,YAAY,EACxB,UAAU,EAAE,YAAY,EACxB,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,SAAS,CAiCX;AAMD,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,cAAc,GACf,MAAM,uBAAuB,CAAC"}
|
package/dist/bindings.js
CHANGED
|
@@ -1706,6 +1706,96 @@ class DspProcessor {
|
|
|
1706
1706
|
this.stages.push(`kalmanFilter:${dimensions}D`);
|
|
1707
1707
|
return this;
|
|
1708
1708
|
}
|
|
1709
|
+
/**
|
|
1710
|
+
* Resample irregular timestamp data to uniform time grid (production-grade).
|
|
1711
|
+
*
|
|
1712
|
+
* This stage solves the problems of irregular sampling:
|
|
1713
|
+
* - Time-based coordinate system (not index-based)
|
|
1714
|
+
* - Gap detection and configurable handling policies
|
|
1715
|
+
* - Clock drift compensation (regression or PLL)
|
|
1716
|
+
* - Multiple interpolation methods (linear, cubic, sinc)
|
|
1717
|
+
* - Proper extrapolation policies
|
|
1718
|
+
*
|
|
1719
|
+
* **Use Cases:**
|
|
1720
|
+
* - IoT sensors with network jitter
|
|
1721
|
+
* - GPS data with dropped packets
|
|
1722
|
+
* - Medical vitals with irregular sampling
|
|
1723
|
+
* - Audio streams with clock drift
|
|
1724
|
+
* - High-frequency trading data with gaps
|
|
1725
|
+
*
|
|
1726
|
+
* @param params - Time alignment parameters
|
|
1727
|
+
* @param params.targetSampleRate - Target uniform sample rate in Hz (required)
|
|
1728
|
+
* @param params.interpolationMethod - Interpolation method: "linear" (default), "cubic", or "sinc"
|
|
1729
|
+
* @param params.gapPolicy - Gap handling: "interpolate" (default), "zero-fill", "hold", "extrapolate", or "error"
|
|
1730
|
+
* @param params.gapThreshold - Gap detection threshold (multiplier of expected interval, default: 2.0)
|
|
1731
|
+
* @param params.driftCompensation - Clock drift compensation: "none" (default), "regression", or "pll"
|
|
1732
|
+
* @returns this instance for method chaining
|
|
1733
|
+
*
|
|
1734
|
+
* @throws {TypeError} If targetSampleRate is not positive
|
|
1735
|
+
* @throws {Error} If gapPolicy="error" and gap is detected during processing
|
|
1736
|
+
*
|
|
1737
|
+
* @example
|
|
1738
|
+
* // IoT sensor with network jitter → uniform 100Hz grid
|
|
1739
|
+
* const pipeline = createDspPipeline();
|
|
1740
|
+
* pipeline
|
|
1741
|
+
* .TimeAlignment({
|
|
1742
|
+
* targetSampleRate: 100, // 100 Hz output
|
|
1743
|
+
* interpolationMethod: "linear", // Fast interpolation
|
|
1744
|
+
* gapPolicy: "interpolate", // Fill gaps with interpolation
|
|
1745
|
+
* gapThreshold: 2.0, // Detect gaps > 2x expected interval
|
|
1746
|
+
* driftCompensation: "regression" // Compensate for clock drift
|
|
1747
|
+
* })
|
|
1748
|
+
* .MovingAverage({ windowDuration: 100 })
|
|
1749
|
+
* .process(irregularSamples, irregularTimestamps, { channels: 1 });
|
|
1750
|
+
*
|
|
1751
|
+
* @example
|
|
1752
|
+
* // GPS tracking with dropped packets → cubic interpolation
|
|
1753
|
+
* const gpsResampler = createDspPipeline();
|
|
1754
|
+
* gpsResampler
|
|
1755
|
+
* .TimeAlignment({
|
|
1756
|
+
* targetSampleRate: 10, // 10 Hz output
|
|
1757
|
+
* interpolationMethod: "cubic", // Smooth interpolation
|
|
1758
|
+
* gapPolicy: "hold", // Hold last value during gaps
|
|
1759
|
+
* gapThreshold: 3.0, // Detect gaps > 300ms
|
|
1760
|
+
* driftCompensation: "pll" // Phase-locked loop compensation
|
|
1761
|
+
* })
|
|
1762
|
+
* .KalmanFilter({ dimensions: 2, processNoise: 1e-5, measurementNoise: 0.01 });
|
|
1763
|
+
*
|
|
1764
|
+
* @example
|
|
1765
|
+
* // High-frequency trading → error on gap detection
|
|
1766
|
+
* const strictResampler = createDspPipeline();
|
|
1767
|
+
* strictResampler
|
|
1768
|
+
* .TimeAlignment({
|
|
1769
|
+
* targetSampleRate: 1000, // 1kHz output
|
|
1770
|
+
* interpolationMethod: "sinc", // Band-limited interpolation
|
|
1771
|
+
* gapPolicy: "error", // Fail if gaps detected
|
|
1772
|
+
* gapThreshold: 1.5, // Strict gap detection
|
|
1773
|
+
* driftCompensation: "none" // Assume perfect clock
|
|
1774
|
+
* });
|
|
1775
|
+
*/
|
|
1776
|
+
TimeAlignment(params) {
|
|
1777
|
+
const targetSampleRate = params.targetSampleRate;
|
|
1778
|
+
if (targetSampleRate <= 0) {
|
|
1779
|
+
throw new TypeError("TimeAlignment: targetSampleRate must be positive, got " +
|
|
1780
|
+
targetSampleRate);
|
|
1781
|
+
}
|
|
1782
|
+
const interpolationMethod = params.interpolationMethod ?? "linear";
|
|
1783
|
+
const gapPolicy = params.gapPolicy ?? "interpolate";
|
|
1784
|
+
const gapThreshold = params.gapThreshold ?? 2.0;
|
|
1785
|
+
const driftCompensation = params.driftCompensation ?? "none";
|
|
1786
|
+
if (gapThreshold < 1.0) {
|
|
1787
|
+
throw new TypeError("TimeAlignment: gapThreshold must be >= 1.0, got " + gapThreshold);
|
|
1788
|
+
}
|
|
1789
|
+
this.nativeInstance.addStage("timeAlignment", {
|
|
1790
|
+
targetSampleRate,
|
|
1791
|
+
interpolationMethod,
|
|
1792
|
+
gapPolicy,
|
|
1793
|
+
gapThreshold,
|
|
1794
|
+
driftCompensation,
|
|
1795
|
+
});
|
|
1796
|
+
this.stages.push(`timeAlignment:${targetSampleRate}Hz:${interpolationMethod}:${gapPolicy}`);
|
|
1797
|
+
return this;
|
|
1798
|
+
}
|
|
1709
1799
|
/**
|
|
1710
1800
|
* Apply leaky integration (accumulation) using IIR filter.
|
|
1711
1801
|
*
|
|
@@ -2966,6 +3056,10 @@ class DspProcessor {
|
|
|
2966
3056
|
// Sample-based mode: process(samples, options)
|
|
2967
3057
|
// Fix: ensure options is correctly formed even if arg is undefined/null
|
|
2968
3058
|
options = { channels: 1, ...(timestampsOrOptions || {}) };
|
|
3059
|
+
// Check if TimeAlignment stage requires timestamps
|
|
3060
|
+
if (this.stages.some((stage) => stage.startsWith("timeAlignment:"))) {
|
|
3061
|
+
throw new TypeError("TimeAlignment stage requires timestamps. Call process(samples, timestamps, options) instead.");
|
|
3062
|
+
}
|
|
2969
3063
|
// Optimization: Pass undefined timestamps, let C++ generate them
|
|
2970
3064
|
}
|
|
2971
3065
|
// If using planar input, ensure channels option is set correctly
|