FrameExtractionOptions Struct Reference

#include <feature-window.h>

Collaboration diagram for FrameExtractionOptions:

Public Member Functions

 FrameExtractionOptions ()
 
void Register (OptionsItf *opts)
 
int32 WindowShift () const
 
int32 WindowSize () const
 
int32 PaddedWindowSize () const
 

Public Attributes

BaseFloat samp_freq
 
BaseFloat frame_shift_ms
 
BaseFloat frame_length_ms
 
BaseFloat dither
 
BaseFloat preemph_coeff
 
bool remove_dc_offset
 
std::string window_type
 
bool round_to_power_of_two
 
BaseFloat blackman_coeff
 
bool snip_edges
 
bool allow_downsample
 
bool allow_upsample
 
int max_feature_vectors
 

Detailed Description

Definition at line 35 of file feature-window.h.

Constructor & Destructor Documentation

◆ FrameExtractionOptions()

Definition at line 53 of file feature-window.h.

53  :
54  samp_freq(16000),
55  frame_shift_ms(10.0),
56  frame_length_ms(25.0),
57  dither(1.0),
58  preemph_coeff(0.97),
59  remove_dc_offset(true),
60  window_type("povey"),
62  blackman_coeff(0.42),
63  snip_edges(true),
64  allow_downsample(false),
65  allow_upsample(false),
67  { }

Member Function Documentation

◆ PaddedWindowSize()

◆ Register()

void Register ( OptionsItf opts)
inline

Definition at line 69 of file feature-window.h.

References OptionsItf::Register().

Referenced by SpectrogramOptions::Register(), MfccOptions::Register(), FbankOptions::Register(), and PlpOptions::Register().

69  {
70  opts->Register("sample-frequency", &samp_freq,
71  "Waveform data sample frequency (must match the waveform file, "
72  "if specified there)");
73  opts->Register("frame-length", &frame_length_ms, "Frame length in milliseconds");
74  opts->Register("frame-shift", &frame_shift_ms, "Frame shift in milliseconds");
75  opts->Register("preemphasis-coefficient", &preemph_coeff,
76  "Coefficient for use in signal preemphasis");
77  opts->Register("remove-dc-offset", &remove_dc_offset,
78  "Subtract mean from waveform on each frame");
79  opts->Register("dither", &dither, "Dithering constant (0.0 means no dither). "
80  "If you turn this off, you should set the --energy-floor "
81  "option, e.g. to 1.0 or 0.1");
82  opts->Register("window-type", &window_type, "Type of window "
83  "(\"hamming\"|\"hanning\"|\"povey\"|\"rectangular\""
84  "|\"sine\"|\"blackmann\")");
85  opts->Register("blackman-coeff", &blackman_coeff,
86  "Constant coefficient for generalized Blackman window.");
87  opts->Register("round-to-power-of-two", &round_to_power_of_two,
88  "If true, round window size to power of two by zero-padding "
89  "input to FFT.");
90  opts->Register("snip-edges", &snip_edges,
91  "If true, end effects will be handled by outputting only frames that "
92  "completely fit in the file, and the number of frames depends on the "
93  "frame-length. If false, the number of frames depends only on the "
94  "frame-shift, and we reflect the data at the ends.");
95  opts->Register("allow-downsample", &allow_downsample,
96  "If true, allow the input waveform to have a higher frequency than "
97  "the specified --sample-frequency (and we'll downsample).");
98  opts->Register("max-feature-vectors", &max_feature_vectors,
99  "Memory optimization. If larger than 0, periodically remove feature "
100  "vectors so that only this number of the latest feature vectors is "
101  "retained.");
102  opts->Register("allow-upsample", &allow_upsample,
103  "If true, allow the input waveform to have a lower frequency than "
104  "the specified --sample-frequency (and we'll upsample).");
105  }

◆ WindowShift()

int32 WindowShift ( ) const
inline

Definition at line 106 of file feature-window.h.

References FrameExtractionOptions::frame_shift_ms.

Referenced by kaldi::FirstSampleOfFrame(), and kaldi::NumFrames().

106  {
107  return static_cast<int32>(samp_freq * 0.001 * frame_shift_ms);
108  }
kaldi::int32 int32

◆ WindowSize()

Member Data Documentation

◆ allow_downsample

bool allow_downsample

Definition at line 50 of file feature-window.h.

◆ allow_upsample

bool allow_upsample

Definition at line 51 of file feature-window.h.

◆ blackman_coeff

BaseFloat blackman_coeff

Definition at line 48 of file feature-window.h.

Referenced by FeatureWindowFunction::FeatureWindowFunction().

◆ dither

◆ frame_length_ms

BaseFloat frame_length_ms

◆ frame_shift_ms

BaseFloat frame_shift_ms

◆ max_feature_vectors

int max_feature_vectors

Definition at line 52 of file feature-window.h.

◆ preemph_coeff

◆ remove_dc_offset

◆ round_to_power_of_two

◆ samp_freq

◆ snip_edges

◆ window_type


The documentation for this struct was generated from the following file: