@min-pack/tfjs-node 2.17.1 → 3.8.1-patch.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 +4 -2
- package/addon-node_modules/onnxruntime-node/bin/{napi-v3/linux/x64/libonnxruntime.so.1.14.0 → napi-v6/linux/arm64/libonnxruntime.so.1} +0 -0
- package/addon-node_modules/onnxruntime-node/bin/napi-v6/linux/arm64/onnxruntime_binding.node +0 -0
- package/addon-node_modules/onnxruntime-node/bin/napi-v6/linux/x64/libonnxruntime.so.1 +0 -0
- package/addon-node_modules/onnxruntime-node/bin/napi-v6/linux/x64/onnxruntime_binding.node +0 -0
- package/index.d.ts +2 -0
- package/index.js +7102 -3371
- package/package.json +1 -10
- package/tfjs-types/backends/onnx.d.ts +37 -0
- package/tfjs-types/base/feature_extraction_utils.d.ts +41 -0
- package/tfjs-types/base/image_processors_utils.d.ts +332 -0
- package/tfjs-types/base/processing_utils.d.ts +89 -0
- package/tfjs-types/configs.d.ts +93 -0
- package/tfjs-types/env.d.ts +112 -0
- package/tfjs-types/generation/configuration_utils.d.ts +326 -0
- package/tfjs-types/generation/logits_process.d.ts +364 -0
- package/tfjs-types/generation/logits_sampler.d.ts +51 -0
- package/tfjs-types/generation/parameters.d.ts +47 -0
- package/tfjs-types/generation/stopping_criteria.d.ts +81 -0
- package/tfjs-types/generation/streamers.d.ts +88 -0
- package/tfjs-types/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.d.ts +25 -0
- package/tfjs-types/models/auto/feature_extraction_auto.d.ts +5 -0
- package/tfjs-types/models/auto/image_processing_auto.d.ts +5 -0
- package/tfjs-types/models/auto/processing_auto.d.ts +39 -0
- package/tfjs-types/models/beit/image_processing_beit.d.ts +4 -0
- package/tfjs-types/models/bit/image_processing_bit.d.ts +4 -0
- package/tfjs-types/models/chinese_clip/image_processing_chinese_clip.d.ts +4 -0
- package/tfjs-types/models/clap/feature_extraction_clap.d.ts +57 -0
- package/tfjs-types/models/clip/image_processing_clip.d.ts +6 -0
- package/tfjs-types/models/convnext/image_processing_convnext.d.ts +12 -0
- package/tfjs-types/models/dac/feature_extraction_dac.d.ts +4 -0
- package/tfjs-types/models/deit/image_processing_deit.d.ts +6 -0
- package/tfjs-types/models/detr/image_processing_detr.d.ts +42 -0
- package/tfjs-types/models/dinov3_vit/image_processing_dinov3_vit.d.ts +4 -0
- package/tfjs-types/models/donut/image_processing_donut.d.ts +7 -0
- package/tfjs-types/models/dpt/image_processing_dpt.d.ts +6 -0
- package/tfjs-types/models/efficientnet/image_processing_efficientnet.d.ts +6 -0
- package/tfjs-types/models/encodec/feature_extraction_encodec.d.ts +13 -0
- package/tfjs-types/models/feature_extractors.d.ts +16 -0
- package/tfjs-types/models/florence2/processing_florence2.d.ts +39 -0
- package/tfjs-types/models/gemma3n/feature_extraction_gemma3n.d.ts +35 -0
- package/tfjs-types/models/gemma3n/processing_gemma3n.d.ts +31 -0
- package/tfjs-types/models/glpn/image_processing_glpn.d.ts +4 -0
- package/tfjs-types/models/grounding_dino/image_processing_grounding_dino.d.ts +20 -0
- package/tfjs-types/models/grounding_dino/processing_grounding_dino.d.ts +27 -0
- package/tfjs-types/models/idefics3/image_processing_idefics3.d.ts +40 -0
- package/tfjs-types/models/idefics3/processing_idefics3.d.ts +19 -0
- package/tfjs-types/models/image_processors.d.ts +44 -0
- package/tfjs-types/models/janus/image_processing_janus.d.ts +7 -0
- package/tfjs-types/models/janus/processing_janus.d.ts +77 -0
- package/tfjs-types/models/jina_clip/image_processing_jina_clip.d.ts +5 -0
- package/tfjs-types/models/jina_clip/processing_jina_clip.d.ts +9 -0
- package/tfjs-types/models/llava/processing_llava.d.ts +12 -0
- package/tfjs-types/models/llava_onevision/image_processing_llava_onevision.d.ts +4 -0
- package/tfjs-types/models/mask2former/image_processing_mask2former.d.ts +4 -0
- package/tfjs-types/models/maskformer/image_processing_maskformer.d.ts +22 -0
- package/tfjs-types/models/mgp_str/processing_mgp_str.d.ts +64 -0
- package/tfjs-types/models/mobilenet_v1/image_processing_mobilenet_v1.d.ts +6 -0
- package/tfjs-types/models/mobilenet_v2/image_processing_mobilenet_v2.d.ts +6 -0
- package/tfjs-types/models/mobilenet_v3/image_processing_mobilenet_v3.d.ts +6 -0
- package/tfjs-types/models/mobilenet_v4/image_processing_mobilenet_v4.d.ts +6 -0
- package/tfjs-types/models/mobilevit/image_processing_mobilevit.d.ts +6 -0
- package/tfjs-types/models/moonshine/feature_extraction_moonshine.d.ts +13 -0
- package/tfjs-types/models/moonshine/processing_moonshine.d.ts +17 -0
- package/tfjs-types/models/nougat/image_processing_nougat.d.ts +4 -0
- package/tfjs-types/models/owlv2/image_processing_owlv2.d.ts +4 -0
- package/tfjs-types/models/owlvit/image_processing_owlvit.d.ts +10 -0
- package/tfjs-types/models/owlvit/processing_owlvit.d.ts +8 -0
- package/tfjs-types/models/paligemma/processing_paligemma.d.ts +12 -0
- package/tfjs-types/models/parakeet/feature_extraction_parakeet.d.ts +22 -0
- package/tfjs-types/models/phi3_v/image_processing_phi3_v.d.ts +17 -0
- package/tfjs-types/models/phi3_v/processing_phi3_v.d.ts +21 -0
- package/tfjs-types/models/pixtral/image_processing_pixtral.d.ts +4 -0
- package/tfjs-types/models/pixtral/processing_pixtral.d.ts +12 -0
- package/tfjs-types/models/processors.d.ts +25 -0
- package/tfjs-types/models/pvt/image_processing_pvt.d.ts +4 -0
- package/tfjs-types/models/pyannote/feature_extraction_pyannote.d.ts +31 -0
- package/tfjs-types/models/pyannote/processing_pyannote.d.ts +19 -0
- package/tfjs-types/models/qwen2_vl/image_processing_qwen2_vl.d.ts +11 -0
- package/tfjs-types/models/qwen2_vl/processing_qwen2_vl.d.ts +17 -0
- package/tfjs-types/models/rt_detr/image_processing_rt_detr.d.ts +8 -0
- package/tfjs-types/models/sam/image_processing_sam.d.ts +103 -0
- package/tfjs-types/models/sam/processing_sam.d.ts +9 -0
- package/tfjs-types/models/sam2/image_processing_sam2.d.ts +2 -0
- package/tfjs-types/models/sam2/processing_sam2.d.ts +6 -0
- package/tfjs-types/models/sam3/image_processing_sam3.d.ts +2 -0
- package/tfjs-types/models/sapiens/image_processing_sapiens.d.ts +10 -0
- package/tfjs-types/models/seamless_m4t/feature_extraction_seamless_m4t.d.ts +34 -0
- package/tfjs-types/models/segformer/image_processing_segformer.d.ts +10 -0
- package/tfjs-types/models/siglip/image_processing_siglip.d.ts +4 -0
- package/tfjs-types/models/smolvlm/image_processing_smolvlm.d.ts +2 -0
- package/tfjs-types/models/smolvlm/processing_smolvlm.d.ts +2 -0
- package/tfjs-types/models/snac/feature_extraction_snac.d.ts +4 -0
- package/tfjs-types/models/speecht5/feature_extraction_speecht5.d.ts +4 -0
- package/tfjs-types/models/speecht5/processing_speecht5.d.ts +14 -0
- package/tfjs-types/models/swin2sr/image_processing_swin2sr.d.ts +5 -0
- package/tfjs-types/models/ultravox/processing_ultravox.d.ts +16 -0
- package/tfjs-types/models/vit/image_processing_vit.d.ts +6 -0
- package/tfjs-types/models/vitmatte/image_processing_vitmatte.d.ts +12 -0
- package/tfjs-types/models/vitpose/image_processing_vitpose.d.ts +26 -0
- package/tfjs-types/models/voxtral/processing_voxtral.d.ts +16 -0
- package/tfjs-types/models/wav2vec2/feature_extraction_wav2vec2.d.ts +19 -0
- package/tfjs-types/models/wav2vec2/processing_wav2vec2.d.ts +14 -0
- package/tfjs-types/models/wav2vec2_with_lm/processing_wav2vec2_with_lm.d.ts +14 -0
- package/tfjs-types/models/wespeaker/feature_extraction_wespeaker.d.ts +23 -0
- package/tfjs-types/models/whisper/common_whisper.d.ts +8 -0
- package/tfjs-types/models/whisper/feature_extraction_whisper.d.ts +23 -0
- package/tfjs-types/models/whisper/generation_whisper.d.ts +76 -0
- package/tfjs-types/models/whisper/processing_whisper.d.ts +17 -0
- package/tfjs-types/models/yolos/image_processing_yolos.d.ts +10 -0
- package/tfjs-types/models.d.ts +4396 -0
- package/tfjs-types/ops/registry.d.ts +13 -0
- package/tfjs-types/pipelines.d.ts +2433 -0
- package/tfjs-types/tokenizers.d.ts +1002 -0
- package/tfjs-types/transformers.d.ts +27 -0
- package/tfjs-types/utils/audio.d.ts +160 -0
- package/tfjs-types/utils/constants.d.ts +8 -0
- package/tfjs-types/utils/core.d.ts +231 -0
- package/tfjs-types/utils/data-structures.d.ts +294 -0
- package/tfjs-types/utils/devices.d.ts +18 -0
- package/tfjs-types/utils/dtypes.d.ts +20 -0
- package/tfjs-types/utils/generic.d.ts +11 -0
- package/tfjs-types/utils/hub.d.ts +175 -0
- package/tfjs-types/utils/image.d.ts +141 -0
- package/tfjs-types/utils/maths.d.ts +282 -0
- package/tfjs-types/utils/tensor.d.ts +490 -0
- package/tfjs-types/utils/video.d.ts +37 -0
- package/addon-node_modules/onnxruntime-node/bin/napi-v3/linux/arm64/libonnxruntime.so.1.14.0 +0 -0
- package/addon-node_modules/onnxruntime-node/bin/napi-v3/linux/arm64/onnxruntime_binding.node +0 -0
- package/addon-node_modules/onnxruntime-node/bin/napi-v3/linux/x64/onnxruntime_binding.node +0 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Helper module for mathematical processing.
|
|
3
|
+
*
|
|
4
|
+
* These functions and classes are only used internally,
|
|
5
|
+
* meaning an end-user shouldn't need to access anything here.
|
|
6
|
+
*
|
|
7
|
+
* @module utils/maths
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float16Array | Float32Array | Float64Array} TypedArray
|
|
11
|
+
* @typedef {BigInt64Array | BigUint64Array} BigTypedArray
|
|
12
|
+
* @typedef {TypedArray | BigTypedArray} AnyTypedArray
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* @param {TypedArray} input
|
|
16
|
+
*/
|
|
17
|
+
export function interpolate_data(input: TypedArray, [in_channels, in_height, in_width]: [any, any, any], [out_height, out_width]: [any, any], mode?: string, align_corners?: boolean): any;
|
|
18
|
+
/**
|
|
19
|
+
* Helper method to permute a `AnyTypedArray` directly
|
|
20
|
+
* @template {AnyTypedArray} T
|
|
21
|
+
* @param {T} array
|
|
22
|
+
* @param {number[]} dims
|
|
23
|
+
* @param {number[]} axes
|
|
24
|
+
* @returns {[T, number[]]} The permuted array and the new shape.
|
|
25
|
+
*/
|
|
26
|
+
export function permute_data<T extends AnyTypedArray>(array: T, dims: number[], axes: number[]): [T, number[]];
|
|
27
|
+
/**
|
|
28
|
+
* Compute the softmax of an array of numbers.
|
|
29
|
+
* @template {TypedArray|number[]} T
|
|
30
|
+
* @param {T} arr The array of numbers to compute the softmax of.
|
|
31
|
+
* @returns {T} The softmax array.
|
|
32
|
+
*/
|
|
33
|
+
export function softmax<T extends TypedArray | number[]>(arr: T): T;
|
|
34
|
+
/**
|
|
35
|
+
* Calculates the logarithm of the softmax function for the input array.
|
|
36
|
+
* @template {TypedArray|number[]} T
|
|
37
|
+
* @param {T} arr The input array to calculate the log_softmax function for.
|
|
38
|
+
* @returns {T} The resulting log_softmax array.
|
|
39
|
+
*/
|
|
40
|
+
export function log_softmax<T extends TypedArray | number[]>(arr: T): T;
|
|
41
|
+
/**
|
|
42
|
+
* Calculates the dot product of two arrays.
|
|
43
|
+
* @param {number[]} arr1 The first array.
|
|
44
|
+
* @param {number[]} arr2 The second array.
|
|
45
|
+
* @returns {number} The dot product of arr1 and arr2.
|
|
46
|
+
*/
|
|
47
|
+
export function dot(arr1: number[], arr2: number[]): number;
|
|
48
|
+
/**
|
|
49
|
+
* Computes the cosine similarity between two arrays.
|
|
50
|
+
*
|
|
51
|
+
* @param {number[]} arr1 The first array.
|
|
52
|
+
* @param {number[]} arr2 The second array.
|
|
53
|
+
* @returns {number} The cosine similarity between the two arrays.
|
|
54
|
+
*/
|
|
55
|
+
export function cos_sim(arr1: number[], arr2: number[]): number;
|
|
56
|
+
/**
|
|
57
|
+
* Calculates the magnitude of a given array.
|
|
58
|
+
* @param {number[]} arr The array to calculate the magnitude of.
|
|
59
|
+
* @returns {number} The magnitude of the array.
|
|
60
|
+
*/
|
|
61
|
+
export function magnitude(arr: number[]): number;
|
|
62
|
+
/**
|
|
63
|
+
* Returns the value and index of the minimum element in an array.
|
|
64
|
+
* @template {number[]|bigint[]|AnyTypedArray} T
|
|
65
|
+
* @param {T} arr array of numbers.
|
|
66
|
+
* @returns {T extends bigint[]|BigTypedArray ? [bigint, number] : [number, number]} the value and index of the minimum element, of the form: [valueOfMin, indexOfMin]
|
|
67
|
+
* @throws {Error} If array is empty.
|
|
68
|
+
*/
|
|
69
|
+
export function min<T extends number[] | bigint[] | AnyTypedArray>(arr: T): T extends bigint[] | BigTypedArray ? [bigint, number] : [number, number];
|
|
70
|
+
/**
|
|
71
|
+
* Returns the value and index of the maximum element in an array.
|
|
72
|
+
* @template {number[]|bigint[]|AnyTypedArray} T
|
|
73
|
+
* @param {T} arr array of numbers.
|
|
74
|
+
* @returns {T extends bigint[]|BigTypedArray ? [bigint, number] : [number, number]} the value and index of the maximum element, of the form: [valueOfMax, indexOfMax]
|
|
75
|
+
* @throws {Error} If array is empty.
|
|
76
|
+
*/
|
|
77
|
+
export function max<T extends number[] | bigint[] | AnyTypedArray>(arr: T): T extends bigint[] | BigTypedArray ? [bigint, number] : [number, number];
|
|
78
|
+
/**
|
|
79
|
+
* Performs median filter on the provided data. Padding is done by mirroring the data.
|
|
80
|
+
* @param {AnyTypedArray} data The input array
|
|
81
|
+
* @param {number} windowSize The window size
|
|
82
|
+
*/
|
|
83
|
+
export function medianFilter(data: AnyTypedArray, windowSize: number): any;
|
|
84
|
+
/**
|
|
85
|
+
* Helper function to round a number to a given number of decimals
|
|
86
|
+
* @param {number} num The number to round
|
|
87
|
+
* @param {number} decimals The number of decimals
|
|
88
|
+
* @returns {number} The rounded number
|
|
89
|
+
*/
|
|
90
|
+
export function round(num: number, decimals: number): number;
|
|
91
|
+
/**
|
|
92
|
+
* Helper function to round a number to the nearest integer, with ties rounded to the nearest even number.
|
|
93
|
+
* Also known as "bankers' rounding". This is the default rounding mode in python. For example:
|
|
94
|
+
* 1.5 rounds to 2 and 2.5 rounds to 2.
|
|
95
|
+
*
|
|
96
|
+
* @param {number} x The number to round
|
|
97
|
+
* @returns {number} The rounded number
|
|
98
|
+
*/
|
|
99
|
+
export function bankers_round(x: number): number;
|
|
100
|
+
/**
|
|
101
|
+
* Measures similarity between two temporal sequences (e.g., input audio and output tokens
|
|
102
|
+
* to generate token-level timestamps).
|
|
103
|
+
* @param {number[][]} matrix
|
|
104
|
+
* @returns {number[][]}
|
|
105
|
+
*/
|
|
106
|
+
export function dynamic_time_warping(matrix: number[][]): number[][];
|
|
107
|
+
export class FFT {
|
|
108
|
+
constructor(fft_length: any);
|
|
109
|
+
fft_length: any;
|
|
110
|
+
isPowerOfTwo: boolean;
|
|
111
|
+
fft: P2FFT | NP2FFT;
|
|
112
|
+
outputBufferSize: number;
|
|
113
|
+
realTransform(out: any, input: any): void;
|
|
114
|
+
transform(out: any, input: any): void;
|
|
115
|
+
}
|
|
116
|
+
export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float16Array | Float32Array | Float64Array;
|
|
117
|
+
export type BigTypedArray = BigInt64Array | BigUint64Array;
|
|
118
|
+
export type AnyTypedArray = TypedArray | BigTypedArray;
|
|
119
|
+
/**
|
|
120
|
+
* Implementation of Radix-4 FFT.
|
|
121
|
+
*
|
|
122
|
+
* P2FFT class provides functionality for performing Fast Fourier Transform on arrays
|
|
123
|
+
* which are a power of two in length.
|
|
124
|
+
* Code adapted from https://www.npmjs.com/package/fft.js
|
|
125
|
+
*/
|
|
126
|
+
declare class P2FFT {
|
|
127
|
+
/**
|
|
128
|
+
* @param {number} size The size of the input array. Must be a power of two larger than 1.
|
|
129
|
+
* @throws {Error} FFT size must be a power of two larger than 1.
|
|
130
|
+
*/
|
|
131
|
+
constructor(size: number);
|
|
132
|
+
size: number;
|
|
133
|
+
_csize: number;
|
|
134
|
+
table: Float64Array<ArrayBuffer>;
|
|
135
|
+
_width: number;
|
|
136
|
+
_bitrev: Int32Array<ArrayBuffer>;
|
|
137
|
+
/**
|
|
138
|
+
* Create a complex number array with size `2 * size`
|
|
139
|
+
*
|
|
140
|
+
* @returns {Float64Array} A complex number array with size `2 * size`
|
|
141
|
+
*/
|
|
142
|
+
createComplexArray(): Float64Array;
|
|
143
|
+
/**
|
|
144
|
+
* Converts a complex number representation stored in a Float64Array to an array of real numbers.
|
|
145
|
+
*
|
|
146
|
+
* @param {Float64Array} complex The complex number representation to be converted.
|
|
147
|
+
* @param {number[]} [storage] An optional array to store the result in.
|
|
148
|
+
* @returns {number[]} An array of real numbers representing the input complex number representation.
|
|
149
|
+
*/
|
|
150
|
+
fromComplexArray(complex: Float64Array, storage?: number[]): number[];
|
|
151
|
+
/**
|
|
152
|
+
* Convert a real-valued input array to a complex-valued output array.
|
|
153
|
+
* @param {Float64Array} input The real-valued input array.
|
|
154
|
+
* @param {Float64Array} [storage] Optional buffer to store the output array.
|
|
155
|
+
* @returns {Float64Array} The complex-valued output array.
|
|
156
|
+
*/
|
|
157
|
+
toComplexArray(input: Float64Array, storage?: Float64Array): Float64Array;
|
|
158
|
+
/**
|
|
159
|
+
* Performs a Fast Fourier Transform (FFT) on the given input data and stores the result in the output buffer.
|
|
160
|
+
*
|
|
161
|
+
* @param {Float64Array} out The output buffer to store the result.
|
|
162
|
+
* @param {Float64Array} data The input data to transform.
|
|
163
|
+
*
|
|
164
|
+
* @throws {Error} Input and output buffers must be different.
|
|
165
|
+
*
|
|
166
|
+
* @returns {void}
|
|
167
|
+
*/
|
|
168
|
+
transform(out: Float64Array, data: Float64Array): void;
|
|
169
|
+
/**
|
|
170
|
+
* Performs a real-valued forward FFT on the given input buffer and stores the result in the given output buffer.
|
|
171
|
+
* The input buffer must contain real values only, while the output buffer will contain complex values. The input and
|
|
172
|
+
* output buffers must be different.
|
|
173
|
+
*
|
|
174
|
+
* @param {Float64Array} out The output buffer.
|
|
175
|
+
* @param {Float64Array} data The input buffer containing real values.
|
|
176
|
+
*
|
|
177
|
+
* @throws {Error} If the input and output buffers are the same.
|
|
178
|
+
*/
|
|
179
|
+
realTransform(out: Float64Array, data: Float64Array): void;
|
|
180
|
+
/**
|
|
181
|
+
* Performs an inverse FFT transformation on the given `data` array, and stores the result in `out`.
|
|
182
|
+
* The `out` array must be a different buffer than the `data` array. The `out` array will contain the
|
|
183
|
+
* result of the transformation. The `data` array will not be modified.
|
|
184
|
+
*
|
|
185
|
+
* @param {Float64Array} out The output buffer for the transformed data.
|
|
186
|
+
* @param {Float64Array} data The input data to transform.
|
|
187
|
+
* @throws {Error} If `out` and `data` refer to the same buffer.
|
|
188
|
+
* @returns {void}
|
|
189
|
+
*/
|
|
190
|
+
inverseTransform(out: Float64Array, data: Float64Array): void;
|
|
191
|
+
/**
|
|
192
|
+
* Performs a radix-4 implementation of a discrete Fourier transform on a given set of data.
|
|
193
|
+
*
|
|
194
|
+
* @param {Float64Array} out The output buffer for the transformed data.
|
|
195
|
+
* @param {Float64Array} data The input buffer of data to be transformed.
|
|
196
|
+
* @param {number} inv A scaling factor to apply to the transform.
|
|
197
|
+
* @returns {void}
|
|
198
|
+
*/
|
|
199
|
+
_transform4(out: Float64Array, data: Float64Array, inv: number): void;
|
|
200
|
+
/**
|
|
201
|
+
* Performs a radix-2 implementation of a discrete Fourier transform on a given set of data.
|
|
202
|
+
*
|
|
203
|
+
* @param {Float64Array} data The input buffer of data to be transformed.
|
|
204
|
+
* @param {Float64Array} out The output buffer for the transformed data.
|
|
205
|
+
* @param {number} outOff The offset at which to write the output data.
|
|
206
|
+
* @param {number} off The offset at which to begin reading the input data.
|
|
207
|
+
* @param {number} step The step size for indexing the input data.
|
|
208
|
+
* @returns {void}
|
|
209
|
+
*/
|
|
210
|
+
_singleTransform2(data: Float64Array, out: Float64Array, outOff: number, off: number, step: number): void;
|
|
211
|
+
/**
|
|
212
|
+
* Performs radix-4 transformation on input data of length 8
|
|
213
|
+
*
|
|
214
|
+
* @param {Float64Array} data Input data array of length 8
|
|
215
|
+
* @param {Float64Array} out Output data array of length 8
|
|
216
|
+
* @param {number} outOff Index of output array to start writing from
|
|
217
|
+
* @param {number} off Index of input array to start reading from
|
|
218
|
+
* @param {number} step Step size between elements in input array
|
|
219
|
+
* @param {number} inv Scaling factor for inverse transform
|
|
220
|
+
*
|
|
221
|
+
* @returns {void}
|
|
222
|
+
*/
|
|
223
|
+
_singleTransform4(data: Float64Array, out: Float64Array, outOff: number, off: number, step: number, inv: number): void;
|
|
224
|
+
/**
|
|
225
|
+
* Real input radix-4 implementation
|
|
226
|
+
* @param {Float64Array} out Output array for the transformed data
|
|
227
|
+
* @param {Float64Array} data Input array of real data to be transformed
|
|
228
|
+
* @param {number} inv The scale factor used to normalize the inverse transform
|
|
229
|
+
*/
|
|
230
|
+
_realTransform4(out: Float64Array, data: Float64Array, inv: number): void;
|
|
231
|
+
/**
|
|
232
|
+
* Performs a single real input radix-2 transformation on the provided data
|
|
233
|
+
*
|
|
234
|
+
* @param {Float64Array} data The input data array
|
|
235
|
+
* @param {Float64Array} out The output data array
|
|
236
|
+
* @param {number} outOff The output offset
|
|
237
|
+
* @param {number} off The input offset
|
|
238
|
+
* @param {number} step The step
|
|
239
|
+
*
|
|
240
|
+
* @returns {void}
|
|
241
|
+
*/
|
|
242
|
+
_singleRealTransform2(data: Float64Array, out: Float64Array, outOff: number, off: number, step: number): void;
|
|
243
|
+
/**
|
|
244
|
+
* Computes a single real-valued transform using radix-4 algorithm.
|
|
245
|
+
* This method is only called for len=8.
|
|
246
|
+
*
|
|
247
|
+
* @param {Float64Array} data The input data array.
|
|
248
|
+
* @param {Float64Array} out The output data array.
|
|
249
|
+
* @param {number} outOff The offset into the output array.
|
|
250
|
+
* @param {number} off The offset into the input array.
|
|
251
|
+
* @param {number} step The step size for the input array.
|
|
252
|
+
* @param {number} inv The value of inverse.
|
|
253
|
+
*/
|
|
254
|
+
_singleRealTransform4(data: Float64Array, out: Float64Array, outOff: number, off: number, step: number, inv: number): void;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* NP2FFT class provides functionality for performing Fast Fourier Transform on arrays
|
|
258
|
+
* which are not a power of two in length. In such cases, the chirp-z transform is used.
|
|
259
|
+
*
|
|
260
|
+
* For more information, see: https://math.stackexchange.com/questions/77118/non-power-of-2-ffts/77156#77156
|
|
261
|
+
*/
|
|
262
|
+
declare class NP2FFT {
|
|
263
|
+
/**
|
|
264
|
+
* Constructs a new NP2FFT object.
|
|
265
|
+
* @param {number} fft_length The length of the FFT
|
|
266
|
+
*/
|
|
267
|
+
constructor(fft_length: number);
|
|
268
|
+
bufferSize: number;
|
|
269
|
+
_a: number;
|
|
270
|
+
_chirpBuffer: Float64Array<ArrayBuffer>;
|
|
271
|
+
_buffer1: Float64Array<ArrayBuffer>;
|
|
272
|
+
_buffer2: Float64Array<ArrayBuffer>;
|
|
273
|
+
_outBuffer1: Float64Array<ArrayBuffer>;
|
|
274
|
+
_outBuffer2: Float64Array<ArrayBuffer>;
|
|
275
|
+
_slicedChirpBuffer: Float64Array<ArrayBuffer>;
|
|
276
|
+
_f: P2FFT;
|
|
277
|
+
_transform(output: any, input: any, real: any): void;
|
|
278
|
+
transform(output: any, input: any): void;
|
|
279
|
+
realTransform(output: any, input: any): void;
|
|
280
|
+
}
|
|
281
|
+
export {};
|
|
282
|
+
//# sourceMappingURL=maths.d.ts.map
|