summaryrefslogtreecommitdiff
path: root/source/application/main/Mfcc.cc
diff options
context:
space:
mode:
authorKshitij Sisodia <kshitij.sisodia@arm.com>2021-05-24 16:12:40 +0100
committerKshitij Sisodia <kshitij.sisodia@arm.com>2021-05-24 16:41:51 +0000
commit3c8256df7de49a4fb64cdbcdea46ff471ff5f846 (patch)
treed080d1542d2ea85d4a7ae00f41d275878eda3706 /source/application/main/Mfcc.cc
parent55b818002cfdbf55ea3a9f2b509cde34f6a06302 (diff)
downloadml-embedded-evaluation-kit-3c8256df7de49a4fb64cdbcdea46ff471ff5f846.tar.gz
MLECO-1948: Fix for SysTick init and GNU's stdout
The counter val could have been 0 when read the first time quickly after the init function. The init function will now wait for the SysTick counter to start before returning. Also included are some minor changes to get around GNU's file stream implementation being line buffered. Change-Id: I8d51fef5d85f1261a6a5710608349d7ecc19ad62
Diffstat (limited to 'source/application/main/Mfcc.cc')
-rw-r--r--source/application/main/Mfcc.cc27
1 files changed, 11 insertions, 16 deletions
diff --git a/source/application/main/Mfcc.cc b/source/application/main/Mfcc.cc
index c998ef2..2d697ee 100644
--- a/source/application/main/Mfcc.cc
+++ b/source/application/main/Mfcc.cc
@@ -45,22 +45,17 @@ namespace audio {
m_useHtkMethod(useHtkMethod)
{}
- std::string MfccParams::Str() const
+ void MfccParams::Log() const
{
- char strC[1024];
- snprintf(strC, sizeof(strC) - 1, "\n \
- \n\t Sampling frequency: %f\
- \n\t Number of filter banks: %" PRIu32 "\
- \n\t Mel frequency limit (low): %f\
- \n\t Mel frequency limit (high): %f\
- \n\t Number of MFCC features: %" PRIu32 "\
- \n\t Frame length: %" PRIu32 "\
- \n\t Padded frame length: %" PRIu32 "\
- \n\t Using HTK for Mel scale: %s\n",
- this->m_samplingFreq, this->m_numFbankBins, this->m_melLoFreq,
- this->m_melHiFreq, this->m_numMfccFeatures, this->m_frameLen,
- this->m_frameLenPadded, this->m_useHtkMethod ? "yes" : "no");
- return std::string{strC};
+ debug("MFCC parameters:\n");
+ debug("\t Sampling frequency: %f\n", this->m_samplingFreq);
+ debug("\t Number of filter banks: %" PRIu32 "\n", this->m_numFbankBins);
+ debug("\t Mel frequency limit (low): %f\n", this->m_melLoFreq);
+ debug("\t Mel frequency limit (high): %f\n", this->m_melHiFreq);
+ debug("\t Number of MFCC features: %" PRIu32 "\n", this->m_numMfccFeatures);
+ debug("\t Frame length: %" PRIu32 "\n", this->m_frameLen);
+ debug("\t Padded frame length: %" PRIu32 "\n", this->m_frameLenPadded);
+ debug("\t Using HTK for Mel scale: %s\n", this->m_useHtkMethod ? "yes" : "no");
}
MFCC::MFCC(const MfccParams& params):
@@ -84,7 +79,7 @@ namespace audio {
}
math::MathUtils::FftInitF32(this->m_params.m_frameLenPadded, this->m_fftInstance);
- debug("Instantiated MFCC object: %s\n", this->m_params.Str().c_str());
+ this->m_params.Log();
}
void MFCC::Init()