Splice
Full doxygen reference (auto-generated from the headers): C++ API doxygen
Header: kaldi-native-fbank/csrc/feature-splice.h — the equivalent of
kaldi's splice-feats (SpliceFrames).
knf::SpliceOptions opts; // left_context=3, right_context=3
knf::MatrixF spliced = knf::SpliceFrames(feats, opts);
API (doxygen)
-
struct SpliceOptions
Options for SpliceFrames(); mirrors kaldi's splice-feats flags.
See also
-
MatrixF knf::SpliceFrames(const MatrixF &feats, const SpliceOptions &opts)
Concatenate each frame with its left/right context neighbors.
This is kaldi's
splice-feats(kaldiSpliceFramesin src/feat/feature-functions.cc), same arithmetic: for every frame index \( t \) the output row is\[ y_t = [ x_{\max(0, t-L)}, \ldots, x_{\min(T-1, t+R)} ] \]where \( L = \)
opts.left_context, \( R = \)opts.right_contextand \( T \) is the number of input frames. Edge frames are replicated: out-of-range indices clamp to the first/last frame. The output therefore has the same number of frames as the input anddim * (1 + L + R)dimensions.knf::SpliceOptions opts; // left=3, right=3 -> 7*D dims knf::MatrixF spliced = knf::SpliceFrames(feats, opts);
See also
- Used by:
Pipelines that build xvector/MFA-style features (mfcc -> cmvn -> splice -> lda).
- Parameters:
feats -- [in] Feature matrix of size T x D (T > 0, D > 0).
opts -- [in] Contexts; see SpliceOptions.
- Returns:
The spliced matrix of size T x (D * (1 + L + R)).