Skip to content

Conversation

@pegahgh
Copy link
Contributor

@pegahgh pegahgh commented Jul 21, 2017

…wnsampling waveform(waveform downsampling function is not added yet).

…wnsampling waveform(waveform downsampling function is not added yet).
@pegahgh
Copy link
Contributor Author

pegahgh commented Jul 21, 2017

@danpovey
I made all changes to allow downsampling the waveform during feature extraction.
I didn't add function to do waveform downsampling yet.
I wonder if you have specific plan to implement this function.

Copy link
Contributor

@danpovey danpovey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small comments (and suggestions Re how to do the downsampling)

be 1.0)
@param [out] output The matrix of features, where the row-index
is the frame index.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove blank line

of the input waveform.
@param [in] wave The input waveform
@param [in] sample_freq The sampling frequency with which
'wave' was sampled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarify that if sample_freq is higher than the frequency specified in the config,
we'll downsample, but if lower, it's an error.

blackman_coeff(0.42),
snip_edges(true){ }
snip_edges(true),
allow_downsample(false){ }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after ) [this was wrong in the original code]

<< sample_freq << " .vs " << new_sample_freq
<< "--allow_downsample should be true to allow "
<< " downsampling the waveform.";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so I guess this is where you'd call the 'real' downsample function.
Declare it in resample.h, and maybe make it something like:

/// Downsample a waveform. This is a convenience wrapper for the /// class 'LinearResample'. void DownsampleWaveform(BaseFloat orig_freq, const VectorBase<BaseFloat> &wave, BaseFloat new_freq, Vector<BaseFloat> *new_wave); 

Regarding the filter-cutoff, please find out what sox uses and use that rule to find it;
and document it in the declaration of the function. For 'num_zeros', maybe use 10.

<< spec_opts.frame_opts.samp_freq << " but data has "
<< wave_data.SampFreq() << " (use --sample-frequency "
<< "option). Utterance is " << utt;
<< spec_opts.frame_opts.samp_freq << " larger than data sample freq "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this check, it's checked internally.

@danpovey danpovey merged commit cc2469e into kaldi-asr:master Aug 9, 2017
kronos-cm added a commit to kronos-cm/kaldi that referenced this pull request Aug 11, 2017
* 'master' of https://github.com/kaldi-asr/kaldi: [scripts] reverting the recent change of perturb_data_dir_speed_3way.sh (kaldi-asr#1809) [src] modify feature-extraction binaries to support downsampling (kaldi-asr#1773) [src] Small test-code fix [src] Fix bug in model-update consolidation code (thanks: sriram ganapathy).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants