27#ifndef KALDI_NATIVE_FBANK_CSRC_ONLINE_NEMO_FBANK_H_
28#define KALDI_NATIVE_FBANK_CSRC_ONLINE_NEMO_FBANK_H_
92 int32_t
Dim()
const {
return opts_.num_mel_bins; }
121 std::vector<float>
GetFrames(int32_t frame_index, int32_t n,
122 bool is_final =
false,
123 int32_t *start_sample_offset =
nullptr);
128 int64_t num_samples_ = 0;
129 int64_t sample_offset_ = 0;
130 bool input_finished_ =
false;
131 std::deque<float> samples_;
132 std::unique_ptr<Stft> stft_;
133 std::unique_ptr<MelBanks> mel_;
OnlineNemoFbank(const NemoFbankOptions &opts)
Construct from the given options.
int32_t Dim() const
Return the number of mel bins.
Definition online-nemo-fbank.h:92
void InputFinished()
Tell the class that no more waveform will be added.
Definition online-nemo-fbank.h:112
float FrameShiftInSeconds() const
Return the frame shift in seconds.
Definition online-nemo-fbank.h:95
int32_t NumTrailingSamples() const
Return the number of buffered samples that do not make up a whole hop.
Definition online-nemo-fbank.h:101
int32_t NumFramesReady() const
Return the number of whole frames that are ready.
Definition online-nemo-fbank.h:98
std::vector< float > GetFrames(int32_t frame_index, int32_t n, bool is_final=false, int32_t *start_sample_offset=nullptr)
Return n row-major frames starting at the absolute frame_index.
void AcceptWaveform(float sampling_rate, const float *waveform, int32_t n)
Add more waveform samples; the sampling rate must match opts.samp_freq.
bool IsLastFrame(int32_t frame) const
Return true if frame is the last frame.
Copyright 2009-2011 Phonexia s.r.o.; Microsoft Corporation 2016 Johns Hopkins University (author: Dan...
This file is part of kaldi-native-fbank.
Definition feature-cmvn.h:42
std::ostream & operator<<(std::ostream &os, const FbankOptions &opts)
Write the options to the stream, one option per line.
Copyright (c) 2025 Xiaomi Corporation (authors: Fangjun Kuang).
Options for OnlineNemoFbank.
Definition online-nemo-fbank.h:43
float samp_freq
Waveform sample frequency.
Definition online-nemo-fbank.h:45
std::string ToString() const
Return the options as a string.
int32_t num_mel_bins
Number of mel bins.
Definition online-nemo-fbank.h:54
float frame_length_ms
Frame length in milliseconds.
Definition online-nemo-fbank.h:51
float high_freq
Upper frequency cutoff for mel bins; non-positive values are offsets from Nyquist.
Definition online-nemo-fbank.h:61
float preemph_coeff
Preemphasis coefficient.
Definition online-nemo-fbank.h:64
float low_freq
Lower frequency cutoff for mel bins.
Definition online-nemo-fbank.h:57
int32_t buffered_capacity
Full-buffer length in frames. Zero disables the final sample-length cap.
Definition online-nemo-fbank.h:67
float frame_shift_ms
Frame shift in milliseconds.
Definition online-nemo-fbank.h:48