UNPKG

1.55 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2019 Google LLC. All Rights Reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 * =============================================================================
16 */
17import { Tensor, Tensor1D } from '../../tensor';
18/**
19 * Computes the Short-time Fourier Transform of signals
20 * See: https://en.wikipedia.org/wiki/Short-time_Fourier_transform
21 *
22 * ```js
23 * const input = tf.tensor1d([1, 1, 1, 1, 1])
24 * tf.signal.stft(input, 3, 1).print();
25 * ```
26 * @param signal 1-dimensional real value tensor.
27 * @param frameLength The window length of samples.
28 * @param frameStep The number of samples to step.
29 * @param fftLength The size of the FFT to apply.
30 * @param windowFn A callable that takes a window length and returns 1-d tensor.
31 *
32 * @doc {heading: 'Operations', subheading: 'Signal', namespace: 'signal'}
33 */
34declare function stft_(signal: Tensor1D, frameLength: number, frameStep: number, fftLength?: number, windowFn?: (length: number) => Tensor1D): Tensor;
35export declare const stft: typeof stft_;
36export {};