Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Abdelwahab HEBA
kaldi_2015
Commits
f8b9515a
Commit
f8b9515a
authored
Aug 02, 2015
by
Daniel Povey
Browse files
Merge pull request #44 from vdp/po-to-opts
Cosmetic variable name change: OptionsItf po -> OptionsItf opts
parents
5c01929a
28d28b07
Changes
79
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
385 additions
and
385 deletions
+385
-385
src/decoder/decoder-wrappers.h
src/decoder/decoder-wrappers.h
+7
-7
src/decoder/faster-decoder.h
src/decoder/faster-decoder.h
+9
-9
src/decoder/lattice-faster-decoder.h
src/decoder/lattice-faster-decoder.h
+16
-16
src/decoder/lattice-simple-decoder.h
src/decoder/lattice-simple-decoder.h
+9
-9
src/decoder/lattice-tracking-decoder.h
src/decoder/lattice-tracking-decoder.h
+17
-17
src/decoder/nbest-decoder.h
src/decoder/nbest-decoder.h
+8
-8
src/decoder/training-graph-compiler.h
src/decoder/training-graph-compiler.h
+8
-8
src/feat/feature-fbank.h
src/feat/feature-fbank.h
+14
-14
src/feat/feature-functions.h
src/feat/feature-functions.h
+55
-55
src/feat/feature-mfcc.h
src/feat/feature-mfcc.h
+17
-17
src/feat/feature-plp.h
src/feat/feature-plp.h
+23
-23
src/feat/feature-spectrogram.h
src/feat/feature-spectrogram.h
+6
-6
src/feat/pitch-functions.h
src/feat/pitch-functions.h
+99
-99
src/feat/sinusoid-detection.h
src/feat/sinusoid-detection.h
+24
-24
src/featbin/interpolate-pitch.cc
src/featbin/interpolate-pitch.cc
+21
-21
src/gmm/am-diag-gmm.h
src/gmm/am-diag-gmm.h
+15
-15
src/gmm/ebw-diag-gmm.h
src/gmm/ebw-diag-gmm.h
+8
-8
src/gmm/mle-diag-gmm.h
src/gmm/mle-diag-gmm.h
+13
-13
src/gmm/mle-full-gmm.h
src/gmm/mle-full-gmm.h
+6
-6
src/hmm/hmm-utils.h
src/hmm/hmm-utils.h
+10
-10
No files found.
src/decoder/decoder-wrappers.h
View file @
f8b9515a
...
...
@@ -38,13 +38,13 @@ struct AlignConfig {
AlignConfig
()
:
beam
(
200.0
),
retry_beam
(
0.0
),
careful
(
false
)
{
}
void
Register
(
OptionsItf
*
p
o
)
{
p
o
->
Register
(
"beam"
,
&
beam
,
"Decoding beam used in alignment"
);
p
o
->
Register
(
"retry-beam"
,
&
retry_beam
,
"Decoding beam for second try at alignment"
);
p
o
->
Register
(
"careful"
,
&
careful
,
"If true, do 'careful' alignment, which is better at detecting "
"alignment failure (involves loop to start of decoding graph)."
);
void
Register
(
OptionsItf
*
o
pts
)
{
o
pts
->
Register
(
"beam"
,
&
beam
,
"Decoding beam used in alignment"
);
o
pts
->
Register
(
"retry-beam"
,
&
retry_beam
,
"Decoding beam for second try at alignment"
);
o
pts
->
Register
(
"careful"
,
&
careful
,
"If true, do 'careful' alignment, which is better at detecting "
"alignment failure (involves loop to start of decoding graph)."
);
}
};
...
...
src/decoder/faster-decoder.h
View file @
f8b9515a
...
...
@@ -42,18 +42,18 @@ struct FasterDecoderOptions {
// alignment, use small default.
beam_delta
(
0.5
),
hash_ratio
(
2.0
)
{
}
void
Register
(
OptionsItf
*
p
o
,
bool
full
)
{
/// if "full", use obscure
void
Register
(
OptionsItf
*
o
pts
,
bool
full
)
{
/// if "full", use obscure
/// options too.
/// Depends on program.
p
o
->
Register
(
"beam"
,
&
beam
,
"Decoder beam"
);
p
o
->
Register
(
"max-active"
,
&
max_active
,
"Decoder max active states."
);
p
o
->
Register
(
"min-active"
,
&
min_active
,
"Decoder min active states (don't prune if #active less than this)."
);
o
pts
->
Register
(
"beam"
,
&
beam
,
"Decoder beam"
);
o
pts
->
Register
(
"max-active"
,
&
max_active
,
"Decoder max active states."
);
o
pts
->
Register
(
"min-active"
,
&
min_active
,
"Decoder min active states (don't prune if #active less than this)."
);
if
(
full
)
{
p
o
->
Register
(
"beam-delta"
,
&
beam_delta
,
"Increment used in decoder [obscure setting]"
);
p
o
->
Register
(
"hash-ratio"
,
&
hash_ratio
,
"Setting used in decoder to control hash behavior"
);
o
pts
->
Register
(
"beam-delta"
,
&
beam_delta
,
"Increment used in decoder [obscure setting]"
);
o
pts
->
Register
(
"hash-ratio"
,
&
hash_ratio
,
"Setting used in decoder to control hash behavior"
);
}
}
};
...
...
src/decoder/lattice-faster-decoder.h
View file @
f8b9515a
...
...
@@ -64,22 +64,22 @@ struct LatticeFasterDecoderConfig {
beam_delta
(
0.5
),
hash_ratio
(
2.0
),
prune_scale
(
0.1
)
{
}
void
Register
(
OptionsItf
*
p
o
)
{
det_opts
.
Register
(
p
o
);
p
o
->
Register
(
"beam"
,
&
beam
,
"Decoding beam."
);
p
o
->
Register
(
"max-active"
,
&
max_active
,
"Decoder max active states."
);
p
o
->
Register
(
"min-active"
,
&
min_active
,
"Decoder minimum #active states."
);
p
o
->
Register
(
"lattice-beam"
,
&
lattice_beam
,
"Lattice generation beam"
);
p
o
->
Register
(
"prune-interval"
,
&
prune_interval
,
"Interval (in frames) at "
"which to prune tokens"
);
p
o
->
Register
(
"determinize-lattice"
,
&
determinize_lattice
,
"If true, "
"determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence)."
);
p
o
->
Register
(
"beam-delta"
,
&
beam_delta
,
"Increment used in decoding-- this "
"parameter is obscure and relates to a speedup in the way the "
"max-active constraint is applied. Larger is more accurate."
);
p
o
->
Register
(
"hash-ratio"
,
&
hash_ratio
,
"Setting used in decoder to control"
" hash behavior"
);
void
Register
(
OptionsItf
*
o
pts
)
{
det_opts
.
Register
(
o
pts
);
o
pts
->
Register
(
"beam"
,
&
beam
,
"Decoding beam."
);
o
pts
->
Register
(
"max-active"
,
&
max_active
,
"Decoder max active states."
);
o
pts
->
Register
(
"min-active"
,
&
min_active
,
"Decoder minimum #active states."
);
o
pts
->
Register
(
"lattice-beam"
,
&
lattice_beam
,
"Lattice generation beam"
);
o
pts
->
Register
(
"prune-interval"
,
&
prune_interval
,
"Interval (in frames) at "
"which to prune tokens"
);
o
pts
->
Register
(
"determinize-lattice"
,
&
determinize_lattice
,
"If true, "
"determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence)."
);
o
pts
->
Register
(
"beam-delta"
,
&
beam_delta
,
"Increment used in decoding-- this "
"parameter is obscure and relates to a speedup in the way the "
"max-active constraint is applied. Larger is more accurate."
);
o
pts
->
Register
(
"hash-ratio"
,
&
hash_ratio
,
"Setting used in decoder to control"
" hash behavior"
);
}
void
Check
()
const
{
KALDI_ASSERT
(
beam
>
0.0
&&
max_active
>
1
&&
lattice_beam
>
0.0
...
...
src/decoder/lattice-simple-decoder.h
View file @
f8b9515a
...
...
@@ -53,15 +53,15 @@ struct LatticeSimpleDecoderConfig {
determinize_lattice
(
true
),
beam_ratio
(
0.9
),
prune_scale
(
0.1
)
{
}
void
Register
(
OptionsItf
*
p
o
)
{
det_opts
.
Register
(
p
o
);
p
o
->
Register
(
"beam"
,
&
beam
,
"Decoding beam."
);
p
o
->
Register
(
"lattice-beam"
,
&
lattice_beam
,
"Lattice generation beam"
);
p
o
->
Register
(
"prune-interval"
,
&
prune_interval
,
"Interval (in frames) at "
"which to prune tokens"
);
p
o
->
Register
(
"determinize-lattice"
,
&
determinize_lattice
,
"If true, "
"determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence)."
);
void
Register
(
OptionsItf
*
o
pts
)
{
det_opts
.
Register
(
o
pts
);
o
pts
->
Register
(
"beam"
,
&
beam
,
"Decoding beam."
);
o
pts
->
Register
(
"lattice-beam"
,
&
lattice_beam
,
"Lattice generation beam"
);
o
pts
->
Register
(
"prune-interval"
,
&
prune_interval
,
"Interval (in frames) at "
"which to prune tokens"
);
o
pts
->
Register
(
"determinize-lattice"
,
&
determinize_lattice
,
"If true, "
"determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence)."
);
}
void
Check
()
const
{
KALDI_ASSERT
(
beam
>
0.0
&&
lattice_beam
>
0.0
&&
prune_interval
>
0
);
...
...
src/decoder/lattice-tracking-decoder.h
View file @
f8b9515a
...
...
@@ -54,23 +54,23 @@ struct LatticeTrackingDecoderConfig {
hash_ratio
(
2.0
),
extra_beam
(
4.0
),
max_beam
(
40.0
)
{
}
void
Register
(
OptionsItf
*
p
o
)
{
det_opts
.
Register
(
p
o
);
p
o
->
Register
(
"beam"
,
&
beam
,
"Decoding beam."
);
p
o
->
Register
(
"max-active"
,
&
max_active
,
"Decoder max active states."
);
p
o
->
Register
(
"lattice-beam"
,
&
lattice_beam
,
"Lattice generation beam"
);
p
o
->
Register
(
"prune-interval"
,
&
prune_interval
,
"Interval (in frames) at "
"which to prune tokens"
);
p
o
->
Register
(
"determinize-lattice"
,
&
determinize_lattice
,
"If true, "
"determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence)."
);
p
o
->
Register
(
"beam-delta"
,
&
beam_delta
,
"Increment used in decoding"
);
p
o
->
Register
(
"hash-ratio"
,
&
hash_ratio
,
"Setting used in decoder to control"
" hash behavior"
);
p
o
->
Register
(
"extra-beam"
,
&
extra_beam
,
"Increment used in decoding (added "
"to worst tracked token from first pass)"
);
p
o
->
Register
(
"max-beam"
,
&
max_beam
,
"Maximum beam (in case tracked tokens "
"go too far from beam)"
);
void
Register
(
OptionsItf
*
o
pts
)
{
det_opts
.
Register
(
o
pts
);
o
pts
->
Register
(
"beam"
,
&
beam
,
"Decoding beam."
);
o
pts
->
Register
(
"max-active"
,
&
max_active
,
"Decoder max active states."
);
o
pts
->
Register
(
"lattice-beam"
,
&
lattice_beam
,
"Lattice generation beam"
);
o
pts
->
Register
(
"prune-interval"
,
&
prune_interval
,
"Interval (in frames) at "
"which to prune tokens"
);
o
pts
->
Register
(
"determinize-lattice"
,
&
determinize_lattice
,
"If true, "
"determinize the lattice (in a special sense, keeping only "
"best pdf-sequence for each word-sequence)."
);
o
pts
->
Register
(
"beam-delta"
,
&
beam_delta
,
"Increment used in decoding"
);
o
pts
->
Register
(
"hash-ratio"
,
&
hash_ratio
,
"Setting used in decoder to control"
" hash behavior"
);
o
pts
->
Register
(
"extra-beam"
,
&
extra_beam
,
"Increment used in decoding (added "
"to worst tracked token from first pass)"
);
o
pts
->
Register
(
"max-beam"
,
&
max_beam
,
"Maximum beam (in case tracked tokens "
"go too far from beam)"
);
}
void
Check
()
const
{
...
...
src/decoder/nbest-decoder.h
View file @
f8b9515a
...
...
@@ -41,17 +41,17 @@ struct NBestDecoderOptions {
max_active
(
std
::
numeric_limits
<
int32
>::
max
()),
n_best
(
1
),
beam_delta
(
0.5
),
hash_ratio
(
2.0
)
{
}
void
Register
(
OptionsItf
*
p
o
,
bool
full
)
{
/// if "full", use obscure
void
Register
(
OptionsItf
*
o
pts
,
bool
full
)
{
/// if "full", use obscure
/// options too.
/// Depends on program.
p
o
->
Register
(
"beam"
,
&
beam
,
"Decoder beam"
);
p
o
->
Register
(
"max-active"
,
&
max_active
,
"Decoder max active states."
);
p
o
->
Register
(
"n-best"
,
&
n_best
,
"Decoder number of best tokens."
);
o
pts
->
Register
(
"beam"
,
&
beam
,
"Decoder beam"
);
o
pts
->
Register
(
"max-active"
,
&
max_active
,
"Decoder max active states."
);
o
pts
->
Register
(
"n-best"
,
&
n_best
,
"Decoder number of best tokens."
);
if
(
full
)
{
p
o
->
Register
(
"beam-delta"
,
&
beam_delta
,
"Increment used in decoder [obscure setting]"
);
p
o
->
Register
(
"hash-ratio"
,
&
hash_ratio
,
"Setting used in decoder to control hash behavior"
);
o
pts
->
Register
(
"beam-delta"
,
&
beam_delta
,
"Increment used in decoder [obscure setting]"
);
o
pts
->
Register
(
"hash-ratio"
,
&
hash_ratio
,
"Setting used in decoder to control hash behavior"
);
}
}
};
...
...
src/decoder/training-graph-compiler.h
View file @
f8b9515a
...
...
@@ -42,14 +42,14 @@ struct TrainingGraphCompilerOptions {
rm_eps
(
false
),
reorder
(
b
)
{
}
void
Register
(
OptionsItf
*
p
o
)
{
p
o
->
Register
(
"transition-scale"
,
&
transition_scale
,
"Scale of transition "
"probabilities (excluding self-loops)"
);
p
o
->
Register
(
"self-loop-scale"
,
&
self_loop_scale
,
"Scale of self-loop vs. "
"non-self-loop probability mass "
);
p
o
->
Register
(
"reorder"
,
&
reorder
,
"Reorder transition ids for greater decoding efficiency."
);
p
o
->
Register
(
"rm-eps"
,
&
rm_eps
,
"Remove [most] epsilons before minimization (only applicable "
"if disambig symbols present)"
);
void
Register
(
OptionsItf
*
o
pts
)
{
o
pts
->
Register
(
"transition-scale"
,
&
transition_scale
,
"Scale of transition "
"probabilities (excluding self-loops)"
);
o
pts
->
Register
(
"self-loop-scale"
,
&
self_loop_scale
,
"Scale of self-loop vs. "
"non-self-loop probability mass "
);
o
pts
->
Register
(
"reorder"
,
&
reorder
,
"Reorder transition ids for greater decoding efficiency."
);
o
pts
->
Register
(
"rm-eps"
,
&
rm_eps
,
"Remove [most] epsilons before minimization (only applicable "
"if disambig symbols present)"
);
}
};
...
...
src/feat/feature-fbank.h
View file @
f8b9515a
...
...
@@ -53,20 +53,20 @@ struct FbankOptions {
htk_compat
(
false
),
use_log_fbank
(
true
)
{}
void
Register
(
OptionsItf
*
p
o
)
{
frame_opts
.
Register
(
p
o
);
mel_opts
.
Register
(
p
o
);
p
o
->
Register
(
"use-energy"
,
&
use_energy
,
"Add an extra dimension with energy to the FBANK output."
);
p
o
->
Register
(
"energy-floor"
,
&
energy_floor
,
"Floor on energy (absolute, not relative) in FBANK computation"
);
p
o
->
Register
(
"raw-energy"
,
&
raw_energy
,
"If true, compute energy before preemphasis and windowing"
);
p
o
->
Register
(
"htk-compat"
,
&
htk_compat
,
"If true, put energy last. "
"Warning: not sufficient to get HTK compatible features (need "
"to change other parameters)."
);
p
o
->
Register
(
"use-log-fbank"
,
&
use_log_fbank
,
"If true, produce log-filterbank, else produce linear."
);
void
Register
(
OptionsItf
*
o
pts
)
{
frame_opts
.
Register
(
o
pts
);
mel_opts
.
Register
(
o
pts
);
o
pts
->
Register
(
"use-energy"
,
&
use_energy
,
"Add an extra dimension with energy to the FBANK output."
);
o
pts
->
Register
(
"energy-floor"
,
&
energy_floor
,
"Floor on energy (absolute, not relative) in FBANK computation"
);
o
pts
->
Register
(
"raw-energy"
,
&
raw_energy
,
"If true, compute energy before preemphasis and windowing"
);
o
pts
->
Register
(
"htk-compat"
,
&
htk_compat
,
"If true, put energy last. "
"Warning: not sufficient to get HTK compatible features (need "
"to change other parameters)."
);
o
pts
->
Register
(
"use-log-fbank"
,
&
use_log_fbank
,
"If true, produce log-filterbank, else produce linear."
);
}
};
...
...
src/feat/feature-functions.h
View file @
f8b9515a
...
...
@@ -52,20 +52,20 @@ struct MelBanksOptions {
:
num_bins
(
num_bins
),
low_freq
(
20
),
high_freq
(
0
),
vtln_low
(
100
),
vtln_high
(
-
500
),
debug_mel
(
false
),
htk_mode
(
false
)
{}
void
Register
(
OptionsItf
*
p
o
)
{
p
o
->
Register
(
"num-mel-bins"
,
&
num_bins
,
"Number of triangular mel-frequency bins"
);
p
o
->
Register
(
"low-freq"
,
&
low_freq
,
"Low cutoff frequency for mel bins"
);
p
o
->
Register
(
"high-freq"
,
&
high_freq
,
"High cutoff frequency for mel bins (if < 0, offset from Nyquist)"
);
p
o
->
Register
(
"vtln-low"
,
&
vtln_low
,
"Low inflection point in piecewise linear VTLN warping function"
);
p
o
->
Register
(
"vtln-high"
,
&
vtln_high
,
"High inflection point in piecewise linear VTLN warping function"
" (if negative, offset from high-mel-freq"
);
p
o
->
Register
(
"debug-mel"
,
&
debug_mel
,
"Print out debugging information for mel bin computation"
);
void
Register
(
OptionsItf
*
o
pts
)
{
o
pts
->
Register
(
"num-mel-bins"
,
&
num_bins
,
"Number of triangular mel-frequency bins"
);
o
pts
->
Register
(
"low-freq"
,
&
low_freq
,
"Low cutoff frequency for mel bins"
);
o
pts
->
Register
(
"high-freq"
,
&
high_freq
,
"High cutoff frequency for mel bins (if < 0, offset from Nyquist)"
);
o
pts
->
Register
(
"vtln-low"
,
&
vtln_low
,
"Low inflection point in piecewise linear VTLN warping function"
);
o
pts
->
Register
(
"vtln-high"
,
&
vtln_high
,
"High inflection point in piecewise linear VTLN warping function"
" (if negative, offset from high-mel-freq"
);
o
pts
->
Register
(
"debug-mel"
,
&
debug_mel
,
"Print out debugging information for mel bin computation"
);
}
};
...
...
@@ -95,26 +95,26 @@ struct FrameExtractionOptions {
round_to_power_of_two
(
true
),
snip_edges
(
true
){
}
void
Register
(
OptionsItf
*
p
o
)
{
p
o
->
Register
(
"sample-frequency"
,
&
samp_freq
,
"Waveform data sample frequency (must match the waveform file, "
"if specified there)"
);
p
o
->
Register
(
"frame-length"
,
&
frame_length_ms
,
"Frame length in milliseconds"
);
p
o
->
Register
(
"frame-shift"
,
&
frame_shift_ms
,
"Frame shift in milliseconds"
);
p
o
->
Register
(
"preemphasis-coefficient"
,
&
preemph_coeff
,
"Coefficient for use in signal preemphasis"
);
p
o
->
Register
(
"remove-dc-offset"
,
&
remove_dc_offset
,
"Subtract mean from waveform on each frame"
);
p
o
->
Register
(
"dither"
,
&
dither
,
"Dithering constant (0.0 means no dither)"
);
p
o
->
Register
(
"window-type"
,
&
window_type
,
"Type of window "
"(
\"
hamming
\"
|
\"
hanning
\"
|
\"
povey
\"
|
\"
rectangular
\"
)"
);
p
o
->
Register
(
"round-to-power-of-two"
,
&
round_to_power_of_two
,
"If true, round window size to power of two."
);
p
o
->
Register
(
"snip-edges"
,
&
snip_edges
,
"If true, end effects will be handled by outputting only frames that "
"completely fit in the file, and the number of frames depends on the "
"frame-length. If false, the number of frames depends only on the "
"frame-shift, and we reflect the data at the ends."
);
void
Register
(
OptionsItf
*
o
pts
)
{
o
pts
->
Register
(
"sample-frequency"
,
&
samp_freq
,
"Waveform data sample frequency (must match the waveform file, "
"if specified there)"
);
o
pts
->
Register
(
"frame-length"
,
&
frame_length_ms
,
"Frame length in milliseconds"
);
o
pts
->
Register
(
"frame-shift"
,
&
frame_shift_ms
,
"Frame shift in milliseconds"
);
o
pts
->
Register
(
"preemphasis-coefficient"
,
&
preemph_coeff
,
"Coefficient for use in signal preemphasis"
);
o
pts
->
Register
(
"remove-dc-offset"
,
&
remove_dc_offset
,
"Subtract mean from waveform on each frame"
);
o
pts
->
Register
(
"dither"
,
&
dither
,
"Dithering constant (0.0 means no dither)"
);
o
pts
->
Register
(
"window-type"
,
&
window_type
,
"Type of window "
"(
\"
hamming
\"
|
\"
hanning
\"
|
\"
povey
\"
|
\"
rectangular
\"
)"
);
o
pts
->
Register
(
"round-to-power-of-two"
,
&
round_to_power_of_two
,
"If true, round window size to power of two."
);
o
pts
->
Register
(
"snip-edges"
,
&
snip_edges
,
"If true, end effects will be handled by outputting only frames that "
"completely fit in the file, and the number of frames depends on the "
"frame-length. If false, the number of frames depends only on the "
"frame-shift, and we reflect the data at the ends."
);
}
int32
WindowShift
()
const
{
return
static_cast
<
int32
>
(
samp_freq
*
0.001
*
frame_shift_ms
);
...
...
@@ -197,11 +197,11 @@ struct DeltaFeaturesOptions {
DeltaFeaturesOptions
(
int32
order
=
2
,
int32
window
=
2
)
:
order
(
order
),
window
(
window
)
{
}
void
Register
(
OptionsItf
*
p
o
)
{
p
o
->
Register
(
"delta-order"
,
&
order
,
"Order of delta computation"
);
p
o
->
Register
(
"delta-window"
,
&
window
,
"Parameter controlling window for delta computation (actual window"
" size for each delta order is 1 + 2*delta-window-size)"
);
void
Register
(
OptionsItf
*
o
pts
)
{
o
pts
->
Register
(
"delta-order"
,
&
order
,
"Order of delta computation"
);
o
pts
->
Register
(
"delta-window"
,
&
window
,
"Parameter controlling window for delta computation (actual window"
" size for each delta order is 1 + 2*delta-window-size)"
);
}
};
...
...
@@ -233,11 +233,11 @@ struct ShiftedDeltaFeaturesOptions {
ShiftedDeltaFeaturesOptions
()
:
window
(
1
),
num_blocks
(
7
),
block_shift
(
3
)
{
}
void
Register
(
OptionsItf
*
p
o
)
{
p
o
->
Register
(
"delta-window"
,
&
window
,
"Size of delta advance and delay."
);
p
o
->
Register
(
"num-blocks"
,
&
num_blocks
,
"Number of delta blocks in advance"
" of each frame to be concatenated"
);
p
o
->
Register
(
"block-shift"
,
&
block_shift
,
"Distance between each block"
);
void
Register
(
OptionsItf
*
o
pts
)
{
o
pts
->
Register
(
"delta-window"
,
&
window
,
"Size of delta advance and delay."
);
o
pts
->
Register
(
"num-blocks"
,
&
num_blocks
,
"Number of delta blocks in advance"
" of each frame to be concatenated"
);
o
pts
->
Register
(
"block-shift"
,
&
block_shift
,
"Distance between each block"
);
}
};
...
...
@@ -320,17 +320,17 @@ struct SlidingWindowCmnOptions {
normalize_variance
(
false
),
center
(
false
)
{
}
void
Register
(
OptionsItf
*
p
o
)
{
p
o
->
Register
(
"cmn-window"
,
&
cmn_window
,
"Window in frames for running "
"average CMN computation"
);
p
o
->
Register
(
"min-cmn-window"
,
&
min_window
,
"Minimum CMN window "
"used at start of decoding (adds latency only at start). "
"Only applicable if center == false, ignored if center==true"
);
p
o
->
Register
(
"norm-vars"
,
&
normalize_variance
,
"If true, normalize "
"variance to one."
);
// naming this as in apply-cmvn.cc
p
o
->
Register
(
"center"
,
&
center
,
"If true, use a window centered on the "
"current frame (to the extent possible, modulo end effects). "
"If false, window is to the left."
);
void
Register
(
OptionsItf
*
o
pts
)
{
o
pts
->
Register
(
"cmn-window"
,
&
cmn_window
,
"Window in frames for running "
"average CMN computation"
);
o
pts
->
Register
(
"min-cmn-window"
,
&
min_window
,
"Minimum CMN window "
"used at start of decoding (adds latency only at start). "
"Only applicable if center == false, ignored if center==true"
);
o
pts
->
Register
(
"norm-vars"
,
&
normalize_variance
,
"If true, normalize "
"variance to one."
);
// naming this as in apply-cmvn.cc
o
pts
->
Register
(
"center"
,
&
center
,
"If true, use a window centered on the "
"current frame (to the extent possible, modulo end effects). "
"If false, window is to the left."
);
}
void
Check
()
const
;
};
...
...
src/feat/feature-mfcc.h
View file @
f8b9515a
...
...
@@ -57,23 +57,23 @@ struct MfccOptions {
cepstral_lifter
(
22.0
),
htk_compat
(
false
)
{}
void
Register
(
OptionsItf
*
p
o
)
{
frame_opts
.
Register
(
p
o
);
mel_opts
.
Register
(
p
o
);
p
o
->
Register
(
"num-ceps"
,
&
num_ceps
,
"Number of cepstra in MFCC computation (including C0)"
);
p
o
->
Register
(
"use-energy"
,
&
use_energy
,
"Use energy (not C0) in MFCC computation"
);
p
o
->
Register
(
"energy-floor"
,
&
energy_floor
,
"Floor on energy (absolute, not relative) in MFCC computation"
);
p
o
->
Register
(
"raw-energy"
,
&
raw_energy
,
"If true, compute energy before preemphasis and windowing"
);
p
o
->
Register
(
"cepstral-lifter"
,
&
cepstral_lifter
,
"Constant that controls scaling of MFCCs"
);
p
o
->
Register
(
"htk-compat"
,
&
htk_compat
,
"If true, put energy or C0 last and use a factor of sqrt(2) on "
"C0. Warning: not sufficient to get HTK compatible features "
"(need to change other parameters)."
);
void
Register
(
OptionsItf
*
o
pts
)
{
frame_opts
.
Register
(
o
pts
);
mel_opts
.
Register
(
o
pts
);
o
pts
->
Register
(
"num-ceps"
,
&
num_ceps
,
"Number of cepstra in MFCC computation (including C0)"
);
o
pts
->
Register
(
"use-energy"
,
&
use_energy
,
"Use energy (not C0) in MFCC computation"
);
o
pts
->
Register
(
"energy-floor"
,
&
energy_floor
,
"Floor on energy (absolute, not relative) in MFCC computation"
);
o
pts
->
Register
(
"raw-energy"
,
&
raw_energy
,
"If true, compute energy before preemphasis and windowing"
);
o
pts
->
Register
(
"cepstral-lifter"
,
&
cepstral_lifter
,
"Constant that controls scaling of MFCCs"
);
o
pts
->
Register
(
"htk-compat"
,
&
htk_compat
,
"If true, put energy or C0 last and use a factor of sqrt(2) on "
"C0. Warning: not sufficient to get HTK compatible features "
"(need to change other parameters)."
);
}
};
...
...
src/feat/feature-plp.h
View file @
f8b9515a
...
...
@@ -66,29 +66,29 @@ struct PlpOptions {
cepstral_scale
(
1.0
),
htk_compat
(
false
)
{}
void
Register
(
OptionsItf
*
p
o
)
{
frame_opts
.
Register
(
p
o
);
mel_opts
.
Register
(
p
o
);
p
o
->
Register
(
"lpc-order"
,
&
lpc_order
,
"Order of LPC analysis in PLP computation"
);
p
o
->
Register
(
"num-ceps"
,
&
num_ceps
,
"Number of cepstra in PLP computation (including C0)"
);
p
o
->
Register
(
"use-energy"
,
&
use_energy
,
"Use energy (not C0) for zeroth PLP feature"
);
p
o
->
Register
(
"energy-floor"
,
&
energy_floor
,
"Floor on energy (absolute, not relative) in PLP computation"
);
p
o
->
Register
(
"raw-energy"
,
&
raw_energy
,
"If true, compute energy before preemphasis and windowing"
);
p
o
->
Register
(
"compress-factor"
,
&
compress_factor
,
"Compression factor in PLP computation"
);
p
o
->
Register
(
"cepstral-lifter"
,
&
cepstral_lifter
,
"Constant that controls scaling of PLPs"
);
p
o
->
Register
(
"cepstral-scale"
,
&
cepstral_scale
,
"Scaling constant in PLP computation"
);
p
o
->
Register
(
"htk-compat"
,
&
htk_compat
,
"If true, put energy or C0 last and put factor of sqrt(2) on "
"C0. Warning: not sufficient to get HTK compatible features "
"(need to change other parameters)."
);
void
Register
(
OptionsItf
*
o
pts
)
{
frame_opts
.
Register
(
o
pts
);
mel_opts
.
Register
(
o
pts
);
o
pts
->
Register
(
"lpc-order"
,
&
lpc_order
,
"Order of LPC analysis in PLP computation"
);
o
pts
->
Register
(
"num-ceps"
,
&
num_ceps
,
"Number of cepstra in PLP computation (including C0)"
);
o
pts
->
Register
(
"use-energy"
,
&
use_energy
,
"Use energy (not C0) for zeroth PLP feature"
);
o
pts
->
Register
(
"energy-floor"
,
&
energy_floor
,
"Floor on energy (absolute, not relative) in PLP computation"
);
o
pts
->
Register
(
"raw-energy"
,
&
raw_energy
,
"If true, compute energy before preemphasis and windowing"
);
o
pts
->
Register
(
"compress-factor"
,
&
compress_factor
,
"Compression factor in PLP computation"
);
o
pts
->
Register
(
"cepstral-lifter"
,
&
cepstral_lifter
,
"Constant that controls scaling of PLPs"
);
o
pts
->
Register
(
"cepstral-scale"
,
&
cepstral_scale
,
"Scaling constant in PLP computation"
);
o
pts
->
Register
(
"htk-compat"
,
&
htk_compat
,
"If true, put energy or C0 last and put factor of sqrt(2) on "
"C0. Warning: not sufficient to get HTK compatible features "
"(need to change other parameters)."
);
}
};
...
...
src/feat/feature-spectrogram.h
View file @
f8b9515a
...
...
@@ -44,12 +44,12 @@ struct SpectrogramOptions {
energy_floor
(
0.0
),
// not in log scale: a small value e.g. 1.0e-10
raw_energy
(
true
)
{}
void
Register
(
OptionsItf
*
p
o
)
{
frame_opts
.
Register
(
p
o
);
p
o
->
Register
(
"energy-floor"
,
&
energy_floor
,
"Floor on energy (absolute, not relative) in Spectrogram computation"
);
p
o
->
Register
(
"raw-energy"
,
&
raw_energy
,
"If true, compute energy before preemphasis and windowing"
);
void
Register
(
OptionsItf
*
o
pts
)
{
frame_opts
.
Register
(
o
pts
);
o
pts
->
Register
(
"energy-floor"
,
&
energy_floor
,
"Floor on energy (absolute, not relative) in Spectrogram computation"
);
o
pts
->
Register
(
"raw-energy"
,
&
raw_energy
,
"If true, compute energy before preemphasis and windowing"
);
}
};
...
...
src/feat/pitch-functions.h
View file @
f8b9515a
...
...
@@ -132,68 +132,68 @@ struct PitchExtractionOptions {
nccf_ballast_online
(
false
),
snip_edges
(
true
)
{
}
void
Register
(
OptionsItf
*
p
o
)
{
p
o
->
Register
(
"sample-frequency"
,
&
samp_freq
,
"Waveform data sample frequency (must match the waveform "
"file, if specified there)"
);
p
o
->
Register
(
"frame-length"
,
&
frame_length_ms
,
"Frame length in "
"milliseconds"
);
p
o
->
Register
(
"frame-shift"
,
&
frame_shift_ms
,
"Frame shift in milliseconds"
);
p
o
->
Register
(
"preemphasis-coefficient"
,
&
preemph_coeff
,
"Coefficient for use in signal preemphasis (deprecated)"
);
p
o
->
Register
(
"min-f0"
,
&
min_f0
,
"min. F0 to search for (Hz)"
);
p
o
->
Register
(
"max-f0"
,
&
max_f0
,
"max. F0 to search for (Hz)"
);
p
o
->
Register
(
"soft-min-f0"
,
&
soft_min_f0
,
"Minimum f0, applied in soft way, must not exceed min-f0"
);
p
o
->
Register
(
"penalty-factor"
,
&
penalty_factor
,
"cost factor for FO change."
);
p
o
->
Register
(
"lowpass-cutoff"
,
&
lowpass_cutoff
,
"cutoff frequency for LowPass filter (Hz) "
);
p
o
->
Register
(
"resample-frequency"
,
&
resample_freq
,
"Frequency that we down-sample the signal to. Must be "
"more than twice lowpass-cutoff"
);
p
o
->
Register
(
"delta-pitch"
,
&
delta_pitch
,
"Smallest relative change in pitch that our algorithm "
"measures"
);
p
o
->
Register
(
"nccf-ballast"
,
&
nccf_ballast
,
"Increasing this factor reduces NCCF for quiet frames"
);
p
o
->
Register
(
"nccf-ballast-online"
,
&
nccf_ballast_online
,
"This is useful mainly for debug; it affects how the NCCF "
"ballast is computed."
);
p
o
->
Register
(
"lowpass-filter-width"
,
&
lowpass_filter_width
,
"Integer that determines filter width of "
"lowpass filter, more gives sharper filter"
);
p
o
->
Register
(
"upsample-filter-width"
,
&
upsample_filter_width
,
"Integer that determines filter width when upsampling NCCF"
);
p
o
->
Register
(
"frames-per-chunk"
,
&
frames_per_chunk
,
"Only relevant for "
"offline pitch extraction (e.g. compute-kaldi-pitch-feats), "
"you can set it to a small nonzero value, such as 10, for "
"better feature compatibility with online decoding (affects "
"energy normalization in the algorithm)"
);
p
o
->
Register
(
"simulate-first-pass-online"
,
&
simulate_first_pass_online
,
"If true, compute-kaldi-pitch-feats will output features "
"that correspond to what an online decoder would see in the "
"first pass of decoding-- not the final version of the "
"features, which is the default. Relevant if "
"--frames-per-chunk > 0"
);
p
o
->
Register
(
"recompute-frame"
,
&
recompute_frame
,
"Only relevant for "
"online pitch extraction, or for compatibility with online "
"pitch extraction. A non-critical parameter; the frame at "
"which we recompute some of the forward pointers, after "
"revising our estimate of the signal energy. Relevant if"
"--frames-per-chunk > 0"
);
p
o
->
Register
(
"max-frames-latency"
,
&
max_frames_latency
,
"Maximum number "
"of frames of latency that we allow pitch tracking to "
"introduce into the feature processing (affects output only "
"if --frames-per-chunk > 0 and "
"--simulate-first-pass-online=true"
);
p
o
->
Register
(
"snip-edges"
,
&
snip_edges
,
"If this is set to false, the "
"incomplete frames near the ending edge won't be snipped, so "
"that the number of frames is the file size divided by the "
"frame-shift. This makes different types of features give the "
"same number of frames."
);
void
Register
(
OptionsItf
*
o
pts
)
{
o
pts
->
Register
(
"sample-frequency"
,
&
samp_freq
,
"Waveform data sample frequency (must match the waveform "
"file, if specified there)"
);
o
pts
->
Register
(
"frame-length"
,
&
frame_length_ms
,
"Frame length in "
"milliseconds"
);
o
pts
->
Register
(
"frame-shift"
,
&
frame_shift_ms
,
"Frame shift in milliseconds"
);
o
pts
->
Register
(
"preemphasis-coefficient"
,
&
preemph_coeff
,
"Coefficient for use in signal preemphasis (deprecated)"
);
o
pts
->
Register
(
"min-f0"
,
&
min_f0
,
"min. F0 to search for (Hz)"
);
o
pts
->
Register
(
"max-f0"
,
&
max_f0
,