From c4a5be300dc6efd533cd36bd1d5b5d8a3e5724ec Mon Sep 17 00:00:00 2001 From: SmileGoat Date: Mon, 7 Mar 2022 11:14:58 +0800 Subject: [PATCH] add comment --- speechx/speechx/codelab/feat_test/linear_spectrogram_main.cc | 1 - speechx/speechx/frontend/normalizer.cc | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/speechx/speechx/codelab/feat_test/linear_spectrogram_main.cc b/speechx/speechx/codelab/feat_test/linear_spectrogram_main.cc index 0a31b6fb..3cd1ae61 100644 --- a/speechx/speechx/codelab/feat_test/linear_spectrogram_main.cc +++ b/speechx/speechx/codelab/feat_test/linear_spectrogram_main.cc @@ -113,7 +113,6 @@ int main(int argc, char* argv[]) { ++cur_idx; } } - std::cout << "xxx: " << feats[0].Data()[0]; feat_cmvn_check_writer.Write(utt, features_check); if (num_done % 50 == 0 && num_done != 0) diff --git a/speechx/speechx/frontend/normalizer.cc b/speechx/speechx/frontend/normalizer.cc index 72ad5ecf..16fc09a8 100644 --- a/speechx/speechx/frontend/normalizer.cc +++ b/speechx/speechx/frontend/normalizer.cc @@ -104,6 +104,7 @@ void CMVN::Read(kaldi::VectorBase* feat) { return; } +// feats contain num_frames feature. void CMVN::ApplyCMVN(bool var_norm, VectorBase* feats) { KALDI_ASSERT(feats != NULL); int32 dim = stats_.NumCols() - 1; @@ -128,6 +129,8 @@ void CMVN::ApplyCMVN(bool var_norm, VectorBase* feats) { Vector offset(feats->Dim()); SubVector mean_stats(stats_.RowData(0), dim); Vector mean_stats_apply(feats->Dim()); + //fill the datat of mean_stats in mean_stats_appy whose dim is equal with the dim of feature. + //the dim of feats = dim * num_frames; for (int32 idx = 0; idx < feats->Dim() / dim; ++idx) { SubVector stats_tmp(mean_stats_apply.Data() + dim*idx, dim); stats_tmp.CopyFromVec(mean_stats); @@ -174,4 +177,4 @@ bool CMVN::Compute(const VectorBase& input, } -} // namespace ppspeech \ No newline at end of file +} // namespace ppspeech