40#ifndef KALDI_NATIVE_FBANK_CSRC_FEATURE_FBANK_H_
41#define KALDI_NATIVE_FBANK_CSRC_FEATURE_FBANK_H_
100 float eps = std::numeric_limits<float>::epsilon();
110 std::ostringstream os;
111 os <<
"frame_opts: \n";
115 os <<
"mel_opts: \n";
124 os <<
"eps: " <<
eps <<
"\n";
125 os <<
"use_power: " <<
use_power <<
"\n";
158 return opts_.mel_opts.num_bins + (opts_.use_energy ? 1 : 0);
167 return opts_.frame_opts;
194 void Compute(
float signal_raw_log_energy,
float vtln_warp,
195 std::vector<float> *signal_frame,
float *feature);
200 const MelBanks *GetMelBanks(
float vtln_warp);
203 float log_energy_floor_;
204 std::map<float, MelBanks *> mel_banks_;
void Compute(float signal_raw_log_energy, float vtln_warp, std::vector< float > *signal_frame, float *feature)
Function that computes one frame of features from one frame of signal.
const FbankOptions & GetOptions() const
Return the options this computer was constructed with.
Definition feature-fbank.h:171
bool NeedRawLogEnergy() const
If true, compute log_energy_pre_window but after dithering and dc removal.
Definition feature-fbank.h:163
FbankComputer(const FbankOptions &opts)
Construct from the given options.
~FbankComputer()
Destructor; frees the cached MelBanks.
int32_t Dim() const
Return the dimension of the output features: num_bins, plus 1 if use_energy is true.
Definition feature-fbank.h:157
FbankOptions Options
Option type accepted by this computer.
Definition feature-fbank.h:147
const FrameExtractionOptions & GetFrameOptions() const
Return the frame-extraction options.
Definition feature-fbank.h:166
Triangular mel-filterbank bins.
Definition mel-computations.h:133
n-point real discrete Fourier transform, where n is even, n >= 2.
Definition rfft.h:44
Waveform windowing and frame extraction.
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) 2022 Xiaomi Corporation (authors: Fangjun Kuang).
Options for computing filter-bank features.
Definition feature-fbank.h:63
bool htk_compat
If true, put energy last (if using energy); if false, put energy first.
Definition feature-fbank.h:86
FbankOptions()
Construct with the default options: 23 mel bins.
Definition feature-fbank.h:106
MelBanksOptions mel_opts
Options for the mel filter banks; see MelBanksOptions.
Definition feature-fbank.h:68
bool raw_energy
If true, compute log energy before preemphasis and windowing; if false, compute it after preemphasis ...
Definition feature-fbank.h:80
bool use_energy
If true, append an extra dimension with energy to the filter banks.
Definition feature-fbank.h:71
std::string ToString() const
Return the options as a string.
Definition feature-fbank.h:109
bool use_power
If true (default), use power in filterbank analysis; else magnitude.
Definition feature-fbank.h:103
FrameExtractionOptions frame_opts
Options for frame extraction; see FrameExtractionOptions.
Definition feature-fbank.h:65
bool use_log_fbank
If true (default), produce log-filterbank; else linear.
Definition feature-fbank.h:89
float eps
Value used by the log-zero guard selected by use_log_floor.
Definition feature-fbank.h:100
float energy_floor
Floor on energy (absolute, not relative) in fbank computation.
Definition feature-fbank.h:76
bool use_log_floor
If true (default), use Kaldi's hard floor before the log, i.e.
Definition feature-fbank.h:95
Options for constructing triangular mel-filterbank bins.
Definition mel-computations.h:58