34#ifndef KALDI_NATIVE_FBANK_CSRC_FEATURE_CMVN_H_
35#define KALDI_NATIVE_FBANK_CSRC_FEATURE_CMVN_H_
207 Eigen::Ref<MatrixF> feats);
254 void Add(int32_t dim,
const float *frame,
float weight = 1.0f);
CmvnAccumulator(int32_t dim=0)
Construct an accumulator for features of dimension dim.
void Add(int32_t dim, const float *frame, float weight=1.0f)
Accumulate stats for one frame of dimension dim, applying the same updates as the free function AccCm...
void Accumulate(const MatrixF &feats)
Accumulate stats for a feature matrix (rows = frames); equivalent to calling Add() for each row with ...
const MatrixD & Stats() const
Return the accumulated 2-row stats: row 0 = [sums, count], row 1 = [sumsq, (unused)]; see InitCmvnSta...
Definition feature-cmvn.h:258
kaldi-native-fbank/kaldi-native-fbank/csrc/feature-matrix.h
This file is part of kaldi-native-fbank.
Definition feature-cmvn.h:42
void InitCmvnStats(int32_t dim, MatrixD *stats)
Initialize cmvn stats to zeros in the FULL 2-row layout.
void ApplyCmvn(const MatrixD &stats, const CmvnOptions &opts, MatrixF *feats)
Apply cmvn to feats in place (kaldi ApplyCmvn / ApplyCmvnReverse).
MatrixD ComputeCmvnStats(const MatrixF &feats)
Compute full 2-row cmvn stats for a whole matrix.
Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > MatrixF
Row-major feature matrix: rows are frames, columns are features.
Definition feature-matrix.h:26
void AccCmvnStats(const float *feat, int32_t dim, float weight, MatrixD *stats)
Accumulate stats for one frame (kaldi AccCmvnStats, same op order).
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > MatrixD
Double-precision accumulator/statistics matrix (e.g.
Definition feature-matrix.h:31
Options matching kaldi's apply-cmvn flags.
Definition feature-cmvn.h:50
bool reverse
If true, undo cmvn instead of applying it: the mean is added back and, if norm_vars is true,...
Definition feature-cmvn.h:59
bool norm_vars
If true, normalize the variances as well: after subtracting the mean, each dimension is divided by it...
Definition feature-cmvn.h:54