diff options
author | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2021-05-24 16:12:40 +0100 |
---|---|---|
committer | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2021-05-24 16:41:51 +0000 |
commit | 3c8256df7de49a4fb64cdbcdea46ff471ff5f846 (patch) | |
tree | d080d1542d2ea85d4a7ae00f41d275878eda3706 /source/application/main | |
parent | 55b818002cfdbf55ea3a9f2b509cde34f6a06302 (diff) | |
download | ml-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')
-rw-r--r-- | source/application/main/Mfcc.cc | 27 | ||||
-rw-r--r-- | source/application/main/include/Mfcc.hpp | 4 |
2 files changed, 13 insertions, 18 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() diff --git a/source/application/main/include/Mfcc.hpp b/source/application/main/include/Mfcc.hpp index 6b11ebb..86330ca 100644 --- a/source/application/main/include/Mfcc.hpp +++ b/source/application/main/include/Mfcc.hpp @@ -51,8 +51,8 @@ namespace audio { ~MfccParams() = default; - /** @brief String representation of parameters */ - std::string Str() const; + /** @brief Log parameters */ + void Log() const; }; /** |