runmat 0.5.4-dev.0 → 0.5.4-dev.2
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/artifacts/stdlib.snapshot +0 -0
- package/dist/generated/builtin-examples-catalog.d.ts.map +1 -1
- package/dist/generated/builtin-examples-catalog.js +1 -1
- package/dist/generated/builtin-examples-catalog.js.map +1 -1
- package/dist/generated/builtins/filtfilt.d.ts +4 -0
- package/dist/generated/builtins/filtfilt.d.ts.map +1 -0
- package/dist/generated/builtins/filtfilt.js +106 -0
- package/dist/generated/builtins/filtfilt.js.map +1 -0
- package/dist/generated/builtins/fir1.d.ts +4 -0
- package/dist/generated/builtins/fir1.d.ts.map +1 -0
- package/dist/generated/builtins/fir1.js +105 -0
- package/dist/generated/builtins/fir1.js.map +1 -0
- package/dist/generated/builtins/freqz.d.ts +4 -0
- package/dist/generated/builtins/freqz.d.ts.map +1 -0
- package/dist/generated/builtins/freqz.js +94 -0
- package/dist/generated/builtins/freqz.js.map +1 -0
- package/dist/generated/builtins-manifest.d.ts.map +1 -1
- package/dist/generated/builtins-manifest.js +66 -0
- package/dist/generated/builtins-manifest.js.map +1 -1
- package/dist/lsp/runmat_lsp.d.ts +2 -2
- package/dist/lsp/runmat_lsp.js +4 -4
- package/dist/lsp/runmat_lsp_bg.wasm +0 -0
- package/dist/lsp/runmat_lsp_bg.wasm.d.ts +2 -2
- package/dist/pkg-web/runmat_wasm_web.d.ts +3 -3
- package/dist/pkg-web/runmat_wasm_web.js +7 -7
- package/dist/pkg-web/runmat_wasm_web_bg.wasm +0 -0
- package/dist/pkg-web/runmat_wasm_web_bg.wasm.d.ts +3 -3
- package/dist/runtime/stdlib.snapshot +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filtfilt.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/filtfilt.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAqGjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "filtfilt",
|
|
5
|
+
"category": "math/signal",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"filtfilt",
|
|
8
|
+
"filter",
|
|
9
|
+
"zero phase",
|
|
10
|
+
"FIR",
|
|
11
|
+
"IIR",
|
|
12
|
+
"gpu"
|
|
13
|
+
],
|
|
14
|
+
"summary": "Apply zero-phase forward-backward digital filtering.",
|
|
15
|
+
"references": [
|
|
16
|
+
"title: \"MATLAB filtfilt documentation\""
|
|
17
|
+
],
|
|
18
|
+
"gpu_support": {
|
|
19
|
+
"elementwise": false,
|
|
20
|
+
"reduction": false,
|
|
21
|
+
"precisions": [
|
|
22
|
+
"f32",
|
|
23
|
+
"f64"
|
|
24
|
+
],
|
|
25
|
+
"broadcasting": "none",
|
|
26
|
+
"notes": "RunMat uses the provider `iir_filter` hook for real gpuArray inputs when available, with transparent host fallback for complex values or unavailable providers."
|
|
27
|
+
},
|
|
28
|
+
"fusion": {
|
|
29
|
+
"elementwise": false,
|
|
30
|
+
"reduction": false,
|
|
31
|
+
"max_inputs": 3,
|
|
32
|
+
"constants": "inline"
|
|
33
|
+
},
|
|
34
|
+
"requires_feature": null,
|
|
35
|
+
"tested": {
|
|
36
|
+
"unit": "builtins::math::signal::filtfilt::tests",
|
|
37
|
+
"gpu": "builtins::math::signal::filtfilt::tests::gpu_matches_cpu"
|
|
38
|
+
},
|
|
39
|
+
"description": "`filtfilt(b, a, x)` filters a vector forward and backward to remove phase delay. Coefficients follow the same digital-filter convention as `filter`: `b` is the numerator, `a` is the denominator, and `a(1)` is normalized internally.",
|
|
40
|
+
"behaviors": [
|
|
41
|
+
"The v1 implementation supports vector signals and preserves row or column orientation.",
|
|
42
|
+
"RunMat uses odd reflection at both signal edges with `3 * (max(numel(a), numel(b)) - 1)` samples, matching the common MATLAB-compatible zero-phase filtering path.",
|
|
43
|
+
"Input length must be greater than the reflection length unless the filter has zero state.",
|
|
44
|
+
"Real gpuArray inputs use provider-backed filter passes when available; complex inputs fall back to the host reference path."
|
|
45
|
+
],
|
|
46
|
+
"examples": [
|
|
47
|
+
{
|
|
48
|
+
"description": "Compare causal filtering with zero-phase filtering",
|
|
49
|
+
"input": "b = ones(1, 3) / 3;\na = 1;\nx = 1:20;\ny_causal = filter(b, a, x);\ny_zero = filtfilt(b, a, x);\nfprintf('%.4f %.4f\\n', y_causal(8), y_zero(8));",
|
|
50
|
+
"output": "7.0000 8.0000"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"description": "Filter with FIR coefficients from fir1",
|
|
54
|
+
"input": "b = fir1(10, 0.25, 'low');\nx = 1:40;\ny = filtfilt(b, 1, x);"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"description": "Run zero-phase filtering on a gpuArray",
|
|
58
|
+
"input": "g = gpuArray(1:40);\nb = ones(1, 3) / 3;\ny_gpu = filtfilt(b, 1, g);\ny = gather(y_gpu);"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"faqs": [
|
|
62
|
+
{
|
|
63
|
+
"question": "How is `filtfilt` different from `filter`?",
|
|
64
|
+
"answer": "`filter` is causal and introduces phase delay. `filtfilt` applies the filter forward and backward, cancelling that phase delay while doubling the magnitude response order."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"question": "Does `filtfilt` support matrices?",
|
|
68
|
+
"answer": "This initial implementation supports vector inputs. Matrix and explicit-dimension support should be added as a separate compatibility expansion."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"question": "Can I use Butterworth or FIR coefficients?",
|
|
72
|
+
"answer": "Yes. Coefficients from `butter`, `fir1`, or hand-written digital filters can be used as long as `a(1)` is non-zero."
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"links": [
|
|
76
|
+
{
|
|
77
|
+
"label": "filter",
|
|
78
|
+
"url": "./filter"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"label": "fir1",
|
|
82
|
+
"url": "./fir1"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"label": "butter",
|
|
86
|
+
"url": "./butter"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"source": {
|
|
90
|
+
"label": "`crates/runmat-runtime/src/builtins/math/signal/filtfilt.rs`",
|
|
91
|
+
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/math/signal/filtfilt.rs"
|
|
92
|
+
},
|
|
93
|
+
"gpu_behavior": [
|
|
94
|
+
"Real gpuArray signal inputs are eligible for provider-backed forward and reverse filter passes through the existing `iir_filter` hook.",
|
|
95
|
+
"If provider execution is unavailable or inputs are complex, RunMat gathers to the host and evaluates the MATLAB-compatible reference path."
|
|
96
|
+
],
|
|
97
|
+
"key": "filtfilt",
|
|
98
|
+
"slug": "filtfilt",
|
|
99
|
+
"aliases": [],
|
|
100
|
+
"categoryPath": [
|
|
101
|
+
"math",
|
|
102
|
+
"signal"
|
|
103
|
+
]
|
|
104
|
+
};
|
|
105
|
+
export default builtinDoc;
|
|
106
|
+
//# sourceMappingURL=filtfilt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filtfilt.js","sourceRoot":"","sources":["../../../src/generated/builtins/filtfilt.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE;QACV,UAAU;QACV,QAAQ;QACR,YAAY;QACZ,KAAK;QACL,KAAK;QACL,KAAK;KACN;IACD,SAAS,EAAE,sDAAsD;IACjE,YAAY,EAAE;QACZ,0CAA0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;IACD,cAAc,EAAE;QACd,wIAAwI;QACxI,4IAA4I;KAC7I;IACD,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,MAAM;QACN,QAAQ;KACT;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fir1.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/fir1.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAoGjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "fir1",
|
|
5
|
+
"category": "math/signal",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"fir1",
|
|
8
|
+
"FIR",
|
|
9
|
+
"windowed sinc",
|
|
10
|
+
"lowpass",
|
|
11
|
+
"highpass",
|
|
12
|
+
"bandpass",
|
|
13
|
+
"bandstop"
|
|
14
|
+
],
|
|
15
|
+
"summary": "Design windowed-sinc FIR filters.",
|
|
16
|
+
"references": [
|
|
17
|
+
"title: \"MATLAB fir1 documentation\""
|
|
18
|
+
],
|
|
19
|
+
"gpu_support": {
|
|
20
|
+
"elementwise": false,
|
|
21
|
+
"reduction": false,
|
|
22
|
+
"precisions": [],
|
|
23
|
+
"broadcasting": "none",
|
|
24
|
+
"notes": "Coefficient design runs on the host. The returned coefficients can be passed to GPU-aware filtering functions."
|
|
25
|
+
},
|
|
26
|
+
"fusion": {
|
|
27
|
+
"elementwise": false,
|
|
28
|
+
"reduction": false,
|
|
29
|
+
"max_inputs": 5,
|
|
30
|
+
"constants": "inline"
|
|
31
|
+
},
|
|
32
|
+
"requires_feature": null,
|
|
33
|
+
"tested": {
|
|
34
|
+
"unit": "builtins::math::signal::fir1::tests"
|
|
35
|
+
},
|
|
36
|
+
"description": "`fir1(n, Wn)` designs an order-`n` FIR filter using a Hamming-windowed sinc response. Scalar `Wn` creates a low-pass filter by default; a two-element `Wn` creates a band-pass filter by default. Add a filter type string for high-pass or stop-band designs.",
|
|
37
|
+
"behaviors": [
|
|
38
|
+
"Returns a row vector with `n + 1` coefficients.",
|
|
39
|
+
"`Wn` uses MATLAB's normalized digital convention where `1` is Nyquist.",
|
|
40
|
+
"Supported filter types are `low`, `high`, `bandpass`, and `stop`.",
|
|
41
|
+
"A custom window vector of length `n + 1` may be supplied.",
|
|
42
|
+
"Filters are scaled by default; pass `noscale` to skip passband normalization."
|
|
43
|
+
],
|
|
44
|
+
"examples": [
|
|
45
|
+
{
|
|
46
|
+
"description": "Design a low-pass FIR filter",
|
|
47
|
+
"input": "b = fir1(4, 0.5);\nfprintf('%d %.4f\\n', length(b), sum(b));",
|
|
48
|
+
"output": "5 1.0000"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"description": "Design coefficients for a FIR low-pass response plot",
|
|
52
|
+
"input": "fs = 1000;\nfc = 100;\nN = 51;\nwn = fc / (fs/2);\nb = fir1(N-1, wn, 'low');\n[H, w] = freqz(b, 1, 512, fs);\nfprintf('%d %.1f %.1f\\n', length(b), w(1), w(end));",
|
|
53
|
+
"output": "51 0.0 499.0"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"description": "Use a custom rectangular window without scaling",
|
|
57
|
+
"input": "w = ones(1, 11);\nb = fir1(10, 0.3, w, 'noscale');"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"faqs": [
|
|
61
|
+
{
|
|
62
|
+
"question": "What window does `fir1` use by default?",
|
|
63
|
+
"answer": "RunMat uses a symmetric Hamming window, matching MATLAB's default FIR design workflow."
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"question": "Can the coefficients be used with `filtfilt`?",
|
|
67
|
+
"answer": "Yes. Use `filtfilt(b, 1, x)` for zero-phase FIR filtering."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"question": "Does `fir1` run on the GPU?",
|
|
71
|
+
"answer": "No. It generates a small coefficient vector on the host. GPU acceleration applies when those coefficients are used by filtering builtins with gpuArray signals."
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"links": [
|
|
75
|
+
{
|
|
76
|
+
"label": "filtfilt",
|
|
77
|
+
"url": "./filtfilt"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"label": "freqz",
|
|
81
|
+
"url": "./freqz"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"label": "hamming",
|
|
85
|
+
"url": "./hamming"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"source": {
|
|
89
|
+
"label": "`crates/runmat-runtime/src/builtins/math/signal/fir1.rs`",
|
|
90
|
+
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/math/signal/fir1.rs"
|
|
91
|
+
},
|
|
92
|
+
"gpu_behavior": [
|
|
93
|
+
"Host-side coefficient design only.",
|
|
94
|
+
"The resulting coefficient vector can be passed to `filter` or `filtfilt` with gpuArray signal data."
|
|
95
|
+
],
|
|
96
|
+
"key": "fir1",
|
|
97
|
+
"slug": "fir1",
|
|
98
|
+
"aliases": [],
|
|
99
|
+
"categoryPath": [
|
|
100
|
+
"math",
|
|
101
|
+
"signal"
|
|
102
|
+
]
|
|
103
|
+
};
|
|
104
|
+
export default builtinDoc;
|
|
105
|
+
//# sourceMappingURL=fir1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fir1.js","sourceRoot":"","sources":["../../../src/generated/builtins/fir1.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,aAAa;IACzB,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jB;QACD;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,0DAA0D;QACnE,KAAK,EAAE,uGAAuG;KAC/G;IACD,cAAc,EAAE;QACd,oCAAoC;QACpC,qGAAqG;KACtG;IACD,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,MAAM;QACN,QAAQ;KACT;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"freqz.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/freqz.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAyFjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "freqz",
|
|
5
|
+
"category": "math/signal",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"freqz",
|
|
8
|
+
"frequency response",
|
|
9
|
+
"filter",
|
|
10
|
+
"FIR",
|
|
11
|
+
"IIR"
|
|
12
|
+
],
|
|
13
|
+
"summary": "Evaluate digital filter frequency response.",
|
|
14
|
+
"references": [
|
|
15
|
+
"title: \"MATLAB freqz documentation\""
|
|
16
|
+
],
|
|
17
|
+
"gpu_support": {
|
|
18
|
+
"elementwise": false,
|
|
19
|
+
"reduction": false,
|
|
20
|
+
"precisions": [],
|
|
21
|
+
"broadcasting": "none",
|
|
22
|
+
"notes": "Frequency-response analysis is host-side. GPU coefficient inputs are gathered automatically."
|
|
23
|
+
},
|
|
24
|
+
"fusion": {
|
|
25
|
+
"elementwise": false,
|
|
26
|
+
"reduction": false,
|
|
27
|
+
"max_inputs": 4,
|
|
28
|
+
"constants": "inline"
|
|
29
|
+
},
|
|
30
|
+
"requires_feature": null,
|
|
31
|
+
"tested": {
|
|
32
|
+
"unit": "builtins::math::signal::freqz::tests"
|
|
33
|
+
},
|
|
34
|
+
"description": "`freqz(b, a, n)` evaluates the complex frequency response of a digital filter at `n` points between 0 and Nyquist. With `fs`, returned frequencies are in Hz instead of radians/sample.",
|
|
35
|
+
"behaviors": [
|
|
36
|
+
"Default response length is 512 samples.",
|
|
37
|
+
"`[H, w] = freqz(...)` returns complex response `H` and frequency vector `w` as column vectors.",
|
|
38
|
+
"Without `fs`, `w` is in radians/sample over `[0, pi)`.",
|
|
39
|
+
"With `fs`, `w` is in Hz over `[0, fs/2)`."
|
|
40
|
+
],
|
|
41
|
+
"examples": [
|
|
42
|
+
{
|
|
43
|
+
"description": "Evaluate a simple FIR response",
|
|
44
|
+
"input": "[H, w] = freqz([1 1], 1, 4);\nfprintf('%.1f %.1f %.4f\\n', real(H(1)), imag(H(3)), w(3));",
|
|
45
|
+
"output": "2.0 -1.0 1.5708"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"description": "Evaluate a response in Hz",
|
|
49
|
+
"input": "b = fir1(20, 0.25);\n[H, f] = freqz(b, 1, 8, 1000);\nfprintf('%.1f %.1f\\n', f(1), f(end));",
|
|
50
|
+
"output": "0.0 437.5"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"faqs": [
|
|
54
|
+
{
|
|
55
|
+
"question": "Does `freqz` include the Nyquist point?",
|
|
56
|
+
"answer": "The supported numeric `n` form samples `n` points over `[0, pi)`, matching the common one-sided response grid used by MATLAB's `freqz(b,a,n)` form."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"question": "Can `freqz` analyze IIR filters?",
|
|
60
|
+
"answer": "Yes. Pass numerator `b` and denominator `a`; `freqz` evaluates the transfer function directly on the unit circle."
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"links": [
|
|
64
|
+
{
|
|
65
|
+
"label": "filter",
|
|
66
|
+
"url": "./filter"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"label": "fir1",
|
|
70
|
+
"url": "./fir1"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"label": "filtfilt",
|
|
74
|
+
"url": "./filtfilt"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"source": {
|
|
78
|
+
"label": "`crates/runmat-runtime/src/builtins/math/signal/freqz.rs`",
|
|
79
|
+
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/math/signal/freqz.rs"
|
|
80
|
+
},
|
|
81
|
+
"gpu_behavior": [
|
|
82
|
+
"Host-side analysis only.",
|
|
83
|
+
"GPU coefficient inputs are gathered before evaluation."
|
|
84
|
+
],
|
|
85
|
+
"key": "freqz",
|
|
86
|
+
"slug": "freqz",
|
|
87
|
+
"aliases": [],
|
|
88
|
+
"categoryPath": [
|
|
89
|
+
"math",
|
|
90
|
+
"signal"
|
|
91
|
+
]
|
|
92
|
+
};
|
|
93
|
+
export default builtinDoc;
|
|
94
|
+
//# sourceMappingURL=freqz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"freqz.js","sourceRoot":"","sources":["../../../src/generated/builtins/freqz.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE;QACV,OAAO;QACP,oBAAoB;QACpB,QAAQ;QACR,KAAK;QACL,KAAK;KACN;IACD,SAAS,EAAE,6CAA6C;IACxD,YAAY,EAAE;QACZ,uCAAuC;KACxC;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,8FAA8F;KACxG;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,QAAQ;KACtB;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,sCAAsC;KAC/C;IACD,aAAa,EAAE,yLAAyL;IACxM,WAAW,EAAE;QACX,yCAAyC;QACzC,gGAAgG;QAChG,wDAAwD;QACxD,2CAA2C;KAC5C;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,gCAAgC;YAC/C,OAAO,EAAE,2FAA2F;YACpG,QAAQ,EAAE,iBAAiB;SAC5B;QACD;YACE,aAAa,EAAE,2BAA2B;YAC1C,OAAO,EAAE,6FAA6F;YACtG,QAAQ,EAAE,WAAW;SACtB;KACF;IACD,MAAM,EAAE;QACN;YACE,UAAU,EAAE,yCAAyC;YACrD,QAAQ,EAAE,qJAAqJ;SAChK;QACD;YACE,UAAU,EAAE,kCAAkC;YAC9C,QAAQ,EAAE,mHAAmH;SAC9H;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,UAAU;SAClB;QACD;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,UAAU;YACnB,KAAK,EAAE,YAAY;SACpB;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,2DAA2D;QACpE,KAAK,EAAE,wGAAwG;KAChH;IACD,cAAc,EAAE;QACd,0BAA0B;QAC1B,wDAAwD;KACzD;IACD,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,OAAO;IACf,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,MAAM;QACN,QAAQ;KACT;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,EAw7RjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAqc9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,sEAC0C,CAAC"}
|
|
@@ -2411,6 +2411,27 @@ export const builtinManifest = [
|
|
|
2411
2411
|
"summary": "Apply 2-D correlation/convolution filters in MATLAB and RunMat.",
|
|
2412
2412
|
"exampleCount": 5
|
|
2413
2413
|
},
|
|
2414
|
+
{
|
|
2415
|
+
"key": "filtfilt",
|
|
2416
|
+
"title": "filtfilt",
|
|
2417
|
+
"slug": "filtfilt",
|
|
2418
|
+
"aliases": [],
|
|
2419
|
+
"category": "math/signal",
|
|
2420
|
+
"categoryPath": [
|
|
2421
|
+
"math",
|
|
2422
|
+
"signal"
|
|
2423
|
+
],
|
|
2424
|
+
"keywords": [
|
|
2425
|
+
"filtfilt",
|
|
2426
|
+
"filter",
|
|
2427
|
+
"zero phase",
|
|
2428
|
+
"FIR",
|
|
2429
|
+
"IIR",
|
|
2430
|
+
"gpu"
|
|
2431
|
+
],
|
|
2432
|
+
"summary": "Apply zero-phase forward-backward digital filtering.",
|
|
2433
|
+
"exampleCount": 3
|
|
2434
|
+
},
|
|
2414
2435
|
{
|
|
2415
2436
|
"key": "find",
|
|
2416
2437
|
"title": "find",
|
|
@@ -2432,6 +2453,28 @@ export const builtinManifest = [
|
|
|
2432
2453
|
"summary": "Locate nonzero indices and values in MATLAB and RunMat.",
|
|
2433
2454
|
"exampleCount": 5
|
|
2434
2455
|
},
|
|
2456
|
+
{
|
|
2457
|
+
"key": "fir1",
|
|
2458
|
+
"title": "fir1",
|
|
2459
|
+
"slug": "fir1",
|
|
2460
|
+
"aliases": [],
|
|
2461
|
+
"category": "math/signal",
|
|
2462
|
+
"categoryPath": [
|
|
2463
|
+
"math",
|
|
2464
|
+
"signal"
|
|
2465
|
+
],
|
|
2466
|
+
"keywords": [
|
|
2467
|
+
"fir1",
|
|
2468
|
+
"FIR",
|
|
2469
|
+
"windowed sinc",
|
|
2470
|
+
"lowpass",
|
|
2471
|
+
"highpass",
|
|
2472
|
+
"bandpass",
|
|
2473
|
+
"bandstop"
|
|
2474
|
+
],
|
|
2475
|
+
"summary": "Design windowed-sinc FIR filters.",
|
|
2476
|
+
"exampleCount": 3
|
|
2477
|
+
},
|
|
2435
2478
|
{
|
|
2436
2479
|
"key": "fix",
|
|
2437
2480
|
"title": "fix",
|
|
@@ -2642,6 +2685,26 @@ export const builtinManifest = [
|
|
|
2642
2685
|
"summary": "Read binary data from file identifiers in MATLAB and RunMat.",
|
|
2643
2686
|
"exampleCount": 7
|
|
2644
2687
|
},
|
|
2688
|
+
{
|
|
2689
|
+
"key": "freqz",
|
|
2690
|
+
"title": "freqz",
|
|
2691
|
+
"slug": "freqz",
|
|
2692
|
+
"aliases": [],
|
|
2693
|
+
"category": "math/signal",
|
|
2694
|
+
"categoryPath": [
|
|
2695
|
+
"math",
|
|
2696
|
+
"signal"
|
|
2697
|
+
],
|
|
2698
|
+
"keywords": [
|
|
2699
|
+
"freqz",
|
|
2700
|
+
"frequency response",
|
|
2701
|
+
"filter",
|
|
2702
|
+
"FIR",
|
|
2703
|
+
"IIR"
|
|
2704
|
+
],
|
|
2705
|
+
"summary": "Evaluate digital filter frequency response.",
|
|
2706
|
+
"exampleCount": 2
|
|
2707
|
+
},
|
|
2645
2708
|
{
|
|
2646
2709
|
"key": "frewind",
|
|
2647
2710
|
"title": "frewind",
|
|
@@ -9202,7 +9265,9 @@ export const builtinDocLoaders = {
|
|
|
9202
9265
|
"fill3": () => import("./builtins/fill3.js").then((mod) => mod.default),
|
|
9203
9266
|
"filter": () => import("./builtins/filter.js").then((mod) => mod.default),
|
|
9204
9267
|
"filter2": () => import("./builtins/filter2.js").then((mod) => mod.default),
|
|
9268
|
+
"filtfilt": () => import("./builtins/filtfilt.js").then((mod) => mod.default),
|
|
9205
9269
|
"find": () => import("./builtins/find.js").then((mod) => mod.default),
|
|
9270
|
+
"fir1": () => import("./builtins/fir1.js").then((mod) => mod.default),
|
|
9206
9271
|
"fix": () => import("./builtins/fix.js").then((mod) => mod.default),
|
|
9207
9272
|
"flip": () => import("./builtins/flip.js").then((mod) => mod.default),
|
|
9208
9273
|
"fliplr": () => import("./builtins/fliplr.js").then((mod) => mod.default),
|
|
@@ -9213,6 +9278,7 @@ export const builtinDocLoaders = {
|
|
|
9213
9278
|
"format": () => import("./builtins/format.js").then((mod) => mod.default),
|
|
9214
9279
|
"fprintf": () => import("./builtins/fprintf.js").then((mod) => mod.default),
|
|
9215
9280
|
"fread": () => import("./builtins/fread.js").then((mod) => mod.default),
|
|
9281
|
+
"freqz": () => import("./builtins/freqz.js").then((mod) => mod.default),
|
|
9216
9282
|
"frewind": () => import("./builtins/frewind.js").then((mod) => mod.default),
|
|
9217
9283
|
"fsolve": () => import("./builtins/fsolve.js").then((mod) => mod.default),
|
|
9218
9284
|
"fspecial": () => import("./builtins/fspecial.js").then((mod) => mod.default),
|