PitchExtractionOptions Struct Reference

#include <pitch-functions.h>

Collaboration diagram for PitchExtractionOptions:

Public Member Functions

 PitchExtractionOptions ()
 
void Register (OptionsItf *opts)
 
int32 NccfWindowSize () const
 Returns the window-size in samples, after resampling. More...
 
int32 NccfWindowShift () const
 Returns the window-shift in samples, after resampling. More...
 

Public Attributes

BaseFloat samp_freq
 
BaseFloat frame_shift_ms
 
BaseFloat frame_length_ms
 
BaseFloat preemph_coeff
 
BaseFloat min_f0
 
BaseFloat max_f0
 
BaseFloat soft_min_f0
 
BaseFloat penalty_factor
 
BaseFloat lowpass_cutoff
 
BaseFloat resample_freq
 
BaseFloat delta_pitch
 
BaseFloat nccf_ballast
 
int32 lowpass_filter_width
 
int32 upsample_filter_width
 
int32 max_frames_latency
 
int32 frames_per_chunk
 
bool simulate_first_pass_online
 
int32 recompute_frame
 
bool nccf_ballast_online
 
bool snip_edges
 

Detailed Description

Definition at line 42 of file pitch-functions.h.

Constructor & Destructor Documentation

◆ PitchExtractionOptions()

Definition at line 113 of file pitch-functions.h.

113  :
114  samp_freq(16000),
115  frame_shift_ms(10.0),
116  frame_length_ms(25.0),
117  preemph_coeff(0.0),
118  min_f0(50),
119  max_f0(400),
120  soft_min_f0(10.0),
121  penalty_factor(0.1),
122  lowpass_cutoff(1000),
123  resample_freq(4000),
124  delta_pitch(0.005),
125  nccf_ballast(7000),
129  frames_per_chunk(0),
131  recompute_frame(500),
132  nccf_ballast_online(false),
133  snip_edges(true) { }

Member Function Documentation

◆ NccfWindowShift()

int32 NccfWindowShift ( ) const
inline

Returns the window-shift in samples, after resampling.

Definition at line 207 of file pitch-functions.h.

Referenced by OnlinePitchFeatureImpl::AcceptWaveform(), OnlinePitchFeatureImpl::NumFramesAvailable(), and OnlinePitchFeatureImpl::UpdateRemainder().

207  {
208  return static_cast<int32>(resample_freq * frame_shift_ms / 1000.0);
209  }
kaldi::int32 int32

◆ NccfWindowSize()

int32 NccfWindowSize ( ) const
inline

Returns the window-size in samples, after resampling.

This is the "basic window size", not the full window size after extending by max-lag.

Definition at line 203 of file pitch-functions.h.

Referenced by OnlinePitchFeatureImpl::AcceptWaveform(), OnlinePitchFeatureImpl::NumFramesAvailable(), OnlinePitchFeatureImpl::RecomputeBacktraces(), and OnlinePitchFeatureImpl::UpdateRemainder().

203  {
204  return static_cast<int32>(resample_freq * frame_length_ms / 1000.0);
205  }
kaldi::int32 int32

◆ Register()

void Register ( OptionsItf opts)
inline

Definition at line 135 of file pitch-functions.h.

References OptionsItf::Register().

Referenced by main().

135  {
136  opts->Register("sample-frequency", &samp_freq,
137  "Waveform data sample frequency (must match the waveform "
138  "file, if specified there)");
139  opts->Register("frame-length", &frame_length_ms, "Frame length in "
140  "milliseconds");
141  opts->Register("frame-shift", &frame_shift_ms, "Frame shift in "
142  "milliseconds");
143  opts->Register("preemphasis-coefficient", &preemph_coeff,
144  "Coefficient for use in signal preemphasis (deprecated)");
145  opts->Register("min-f0", &min_f0,
146  "min. F0 to search for (Hz)");
147  opts->Register("max-f0", &max_f0,
148  "max. F0 to search for (Hz)");
149  opts->Register("soft-min-f0", &soft_min_f0,
150  "Minimum f0, applied in soft way, must not exceed min-f0");
151  opts->Register("penalty-factor", &penalty_factor,
152  "cost factor for FO change.");
153  opts->Register("lowpass-cutoff", &lowpass_cutoff,
154  "cutoff frequency for LowPass filter (Hz) ");
155  opts->Register("resample-frequency", &resample_freq,
156  "Frequency that we down-sample the signal to. Must be "
157  "more than twice lowpass-cutoff");
158  opts->Register("delta-pitch", &delta_pitch,
159  "Smallest relative change in pitch that our algorithm "
160  "measures");
161  opts->Register("nccf-ballast", &nccf_ballast,
162  "Increasing this factor reduces NCCF for quiet frames");
163  opts->Register("nccf-ballast-online", &nccf_ballast_online,
164  "This is useful mainly for debug; it affects how the NCCF "
165  "ballast is computed.");
166  opts->Register("lowpass-filter-width", &lowpass_filter_width,
167  "Integer that determines filter width of "
168  "lowpass filter, more gives sharper filter");
169  opts->Register("upsample-filter-width", &upsample_filter_width,
170  "Integer that determines filter width when upsampling NCCF");
171  opts->Register("frames-per-chunk", &frames_per_chunk, "Only relevant for "
172  "offline pitch extraction (e.g. compute-kaldi-pitch-feats), "
173  "you can set it to a small nonzero value, such as 10, for "
174  "better feature compatibility with online decoding (affects "
175  "energy normalization in the algorithm)");
176  opts->Register("simulate-first-pass-online", &simulate_first_pass_online,
177  "If true, compute-kaldi-pitch-feats will output features "
178  "that correspond to what an online decoder would see in the "
179  "first pass of decoding-- not the final version of the "
180  "features, which is the default. Relevant if "
181  "--frames-per-chunk > 0");
182  opts->Register("recompute-frame", &recompute_frame, "Only relevant for "
183  "online pitch extraction, or for compatibility with online "
184  "pitch extraction. A non-critical parameter; the frame at "
185  "which we recompute some of the forward pointers, after "
186  "revising our estimate of the signal energy. Relevant if"
187  "--frames-per-chunk > 0");
188  opts->Register("max-frames-latency", &max_frames_latency, "Maximum number "
189  "of frames of latency that we allow pitch tracking to "
190  "introduce into the feature processing (affects output only "
191  "if --frames-per-chunk > 0 and "
192  "--simulate-first-pass-online=true");
193  opts->Register("snip-edges", &snip_edges, "If this is set to false, the "
194  "incomplete frames near the ending edge won't be snipped, "
195  "so that the number of frames is the file size divided by "
196  "the frame-shift. This makes different types of features "
197  "give the same number of frames.");
198  }

Member Data Documentation

◆ delta_pitch

BaseFloat delta_pitch

Definition at line 56 of file pitch-functions.h.

Referenced by PitchFrameInfo::ComputeBacktraces(), and kaldi::SelectLags().

◆ frame_length_ms

BaseFloat frame_length_ms

Definition at line 46 of file pitch-functions.h.

Referenced by kaldi::UnitTestSnipEdges().

◆ frame_shift_ms

◆ frames_per_chunk

◆ lowpass_cutoff

◆ lowpass_filter_width

int32 lowpass_filter_width

Definition at line 60 of file pitch-functions.h.

Referenced by OnlinePitchFeatureImpl::OnlinePitchFeatureImpl().

◆ max_f0

◆ max_frames_latency

int32 max_frames_latency

◆ min_f0

◆ nccf_ballast

◆ nccf_ballast_online

◆ penalty_factor

BaseFloat penalty_factor

◆ preemph_coeff

BaseFloat preemph_coeff

Definition at line 47 of file pitch-functions.h.

Referenced by OnlinePitchFeatureImpl::ExtractFrame().

◆ recompute_frame

◆ resample_freq

BaseFloat resample_freq

Definition at line 54 of file pitch-functions.h.

Referenced by OnlinePitchFeatureImpl::OnlinePitchFeatureImpl().

◆ samp_freq

◆ simulate_first_pass_online

bool simulate_first_pass_online

◆ snip_edges

◆ soft_min_f0

BaseFloat soft_min_f0

Definition at line 50 of file pitch-functions.h.

Referenced by kaldi::ComputeLocalCost().

◆ upsample_filter_width

int32 upsample_filter_width

Definition at line 62 of file pitch-functions.h.

Referenced by OnlinePitchFeatureImpl::OnlinePitchFeatureImpl().


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