kaldi-native-fbank C++ API
Kaldi-compatible feature extraction C++ API
Loading...
Searching...
No Matches
feature-splice.h File Reference

kaldi-native-fbank/kaldi-native-fbank/csrc/feature-splice.h More...

#include <stdint.h>
#include "kaldi-native-fbank/csrc/feature-matrix.h"
Include dependency graph for feature-splice.h:

Go to the source code of this file.

Classes

struct  knf::SpliceOptions
 Options for SpliceFrames(); mirrors kaldi's splice-feats flags. More...

Namespaces

namespace  knf
 This file is part of kaldi-native-fbank.

Functions

MatrixF knf::SpliceFrames (const MatrixF &feats, const SpliceOptions &opts)
 Concatenate each frame with its left/right context neighbors.

Detailed Description

kaldi-native-fbank/kaldi-native-fbank/csrc/feature-splice.h

This file is part of kaldi-native-fbank.

Splice frames with their left/right context neighbors.

This is kaldi's splice-feats (see src/feat/feature-functions.cc): each output frame concatenates the input frame with left_context preceding and right_context following frames. Edge frames are replicated (a frame index below 0 clamps to 0 and an index past the end clamps to the last frame), so the output has the SAME number of frames as the input and dim * (1 + left_context + right_context) dimensions.

knf::SpliceOptions opts; // left_context=3, right_context=3
knf::MatrixF spliced = knf::SpliceFrames(feats, opts);
MatrixF SpliceFrames(const MatrixF &feats, const SpliceOptions &opts)
Concatenate each frame with its left/right context neighbors.
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
Options for SpliceFrames(); mirrors kaldi's splice-feats flags.
Definition feature-splice.h:44