torch.STFTOptions
export interface STFTOptions {
hop_length?: number;
win_length?: number;
window?: Tensor;
center?: boolean;
pad_mode?: 'reflect' | 'constant' | 'replicate' | 'circular';
normalized?: boolean;
onesided?: boolean;
return_complex?: boolean;
}hop_length(number)optionalwin_length(number)optionalwindow(Tensor)optionalcenter(boolean)optionalpad_mode('reflect' | 'constant' | 'replicate' | 'circular')optionalnormalized(boolean)optionalonesided(boolean)optionalreturn_complex(boolean)optional
Short-time Fourier Transform.
Computes the STFT of a signal by dividing it into overlapping segments, applying a window function, and computing the FFT of each segment.
Examples
const signal = torch.randn(1000);
const stft_result = torch.stft(signal, 256);
const stft_with_opts = torch.stft(signal, 256, { hop_length: 128, window: hann_window(256) });