27#ifndef KALDI_NATIVE_FBANK_CSRC_STFT_H_
28#define KALDI_NATIVE_FBANK_CSRC_STFT_H_
111 std::unique_ptr<Impl> impl_;
Stft(const StftConfig &config)
Construct with the given config.
StftResult Compute(const float *data, int32_t n) const
Compute the STFT of a waveform.
This file is part of kaldi-native-fbank.
Definition feature-cmvn.h:42
Configuration for Stft.
Definition stft.h:40
bool normalized
If true, scale the FFT by 1/sqrt(n_fft) instead of 1.
Definition stft.h:63
bool center
If true, the signal is padded by n_fft/2 on both sides (using pad_mode) and the frames are centered a...
Definition stft.h:57
std::string pad_mode
Padding mode used when center is true; currently only "reflect".
Definition stft.h:60
std::vector< float > window
Explicit window coefficients; if specified, window_type is ignored.
Definition stft.h:66
int32_t hop_length
Number of samples between successive frames.
Definition stft.h:45
std::string ToString() const
Return the config as a string.
std::string window_type
Window type; see GetWindow() in feature-window.h for the supported types and their formulas.
Definition stft.h:53
int32_t win_length
Window size in samples; must be <= n_fft.
Definition stft.h:49
int32_t n_fft
FFT size; should be a power of two.
Definition stft.h:42
Result of Stft::Compute().
Definition stft.h:75
int32_t num_frames
Number of frames in real/imag.
Definition stft.h:85
std::vector< float > real
Real parts of the spectra, [num_frames, n_fft/2+1], flattened in row major.
Definition stft.h:78
std::vector< float > imag
Imaginary parts of the spectra, [num_frames, n_fft/2+1], flattened in row major.
Definition stft.h:82