diff options
author | Isabella Gottardi <isabella.gottardi@arm.com> | 2021-05-12 08:27:15 +0100 |
---|---|---|
committer | Isabella Gottardi <isabella.gottardi@arm.com> | 2021-05-18 09:48:12 +0100 |
commit | 56ee6207c1524ddc4c444c6e48e05eb34105985a (patch) | |
tree | d4fc7823961034e95364f44b34fb098b34b99d0d /source/use_case/ad/include | |
parent | f4e2c4736f19d2e06fede715bb49c475f93d79a9 (diff) | |
download | ml-embedded-evaluation-kit-56ee6207c1524ddc4c444c6e48e05eb34105985a.tar.gz |
MLECO-1858: Documentation update
* Removing `_` in front of private functions and member
Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com>
Change-Id: I5a5d652f9647ebb16d2d2bd16ab980e73f7be3cf
Diffstat (limited to 'source/use_case/ad/include')
-rw-r--r-- | source/use_case/ad/include/AdMelSpectrogram.hpp | 2 | ||||
-rw-r--r-- | source/use_case/ad/include/AdModel.hpp | 2 | ||||
-rw-r--r-- | source/use_case/ad/include/AdPostProcessing.hpp | 2 | ||||
-rw-r--r-- | source/use_case/ad/include/MelSpectrogram.hpp | 61 |
4 files changed, 34 insertions, 33 deletions
diff --git a/source/use_case/ad/include/AdMelSpectrogram.hpp b/source/use_case/ad/include/AdMelSpectrogram.hpp index 30a77c1..05c5bfc 100644 --- a/source/use_case/ad/include/AdMelSpectrogram.hpp +++ b/source/use_case/ad/include/AdMelSpectrogram.hpp @@ -69,7 +69,7 @@ namespace audio { * energies to logarithmic scale. The difference from * default behaviour is that the power is converted to dB * and subsequently clamped. - * @param[in/out] melEnergies - 1D vector of Mel energies + * @param[in,out] melEnergies - 1D vector of Mel energies **/ virtual void ConvertToLogarithmicScale(std::vector<float>& melEnergies) override; diff --git a/source/use_case/ad/include/AdModel.hpp b/source/use_case/ad/include/AdModel.hpp index bbdf91c..8d914c4 100644 --- a/source/use_case/ad/include/AdModel.hpp +++ b/source/use_case/ad/include/AdModel.hpp @@ -44,7 +44,7 @@ namespace app { static constexpr int ms_maxOpCnt = 6; /* A mutable op resolver instance */ - tflite::MicroMutableOpResolver<ms_maxOpCnt> _m_opResolver; + tflite::MicroMutableOpResolver<ms_maxOpCnt> m_opResolver; }; } /* namespace app */ diff --git a/source/use_case/ad/include/AdPostProcessing.hpp b/source/use_case/ad/include/AdPostProcessing.hpp index f3b35a1..7eaec84 100644 --- a/source/use_case/ad/include/AdPostProcessing.hpp +++ b/source/use_case/ad/include/AdPostProcessing.hpp @@ -38,7 +38,7 @@ namespace app { /** @brief Given a wav file name return AD model output index. * @param[in] wavFileName Audio WAV filename. - * File name should be in format <anything>_<goes>_XX_<here>.wav + * File name should be in format anything_goes_XX_here.wav * where XX is the machine ID e.g. 00, 02, 04 or 06 * @return AD model output index as 8 bit integer. **/ diff --git a/source/use_case/ad/include/MelSpectrogram.hpp b/source/use_case/ad/include/MelSpectrogram.hpp index 22b5d29..d3ea3f7 100644 --- a/source/use_case/ad/include/MelSpectrogram.hpp +++ b/source/use_case/ad/include/MelSpectrogram.hpp @@ -65,16 +65,16 @@ namespace audio { /** * @brief Extract Mel Spectrogram for one single small frame of * audio data e.g. 640 samples. - * @param[in] audioData - Vector of audio samples to calculate + * @param[in] audioData Vector of audio samples to calculate * features for. - * @param[in] trainingMean - Value to subtract from the the computed mel spectrogram, default 0. + * @param[in] trainingMean Value to subtract from the the computed mel spectrogram, default 0. * @return Vector of extracted Mel Spectrogram features. **/ std::vector<float> ComputeMelSpec(const std::vector<int16_t>& audioData, float trainingMean = 0); /** * @brief Constructor - * @param[in] params - Mel Spectrogram parameters + * @param[in] params Mel Spectrogram parameters */ explicit MelSpectrogram(const MelSpecParams& params); @@ -87,10 +87,11 @@ namespace audio { /** * @brief Extract Mel Spectrogram features and quantise for one single small * frame of audio data e.g. 640 samples. - * @param[in] audioData - Vector of audio samples to calculate + * @param[in] audioData Vector of audio samples to calculate * features for. - * @param[in] quantScale - quantisation scale. - * @param[in] quantOffset - quantisation offset + * @param[in] quantScale quantisation scale. + * @param[in] quantOffset quantisation offset. + * @param[in] trainingMean training mean. * @return Vector of extracted quantised Mel Spectrogram features. **/ template<typename T> @@ -103,12 +104,12 @@ namespace audio { float minVal = std::numeric_limits<T>::min(); float maxVal = std::numeric_limits<T>::max(); - std::vector<T> melSpecOut(this->_m_params.m_numFbankBins); - const size_t numFbankBins = this->_m_params.m_numFbankBins; + std::vector<T> melSpecOut(this->m_params.m_numFbankBins); + const size_t numFbankBins = this->m_params.m_numFbankBins; /* Quantize to T. */ for (size_t k = 0; k < numFbankBins; ++k) { - auto quantizedEnergy = std::round(((this->_m_melEnergies[k]) / quantScale) + quantOffset); + auto quantizedEnergy = std::round(((this->m_melEnergies[k]) / quantScale) + quantOffset); melSpecOut[k] = static_cast<T>(std::min<float>(std::max<float>(quantizedEnergy, minVal), maxVal)); } @@ -124,9 +125,9 @@ namespace audio { protected: /** * @brief Project input frequency to Mel Scale. - * @param[in] freq - input frequency in floating point - * @param[in] useHTKmethod - bool to signal if HTK method is to be - * used for calculation + * @param[in] freq input frequency in floating point + * @param[in] useHTKMethod bool to signal if HTK method is to be + * used for calculation * @return Mel transformed frequency in floating point **/ static float MelScale(const float freq, @@ -135,9 +136,9 @@ namespace audio { /** * @brief Inverse Mel transform - convert MEL warped frequency * back to normal frequency - * @param[in] freq - Mel frequency in floating point - * @param[in] useHTKmethod - bool to signal if HTK method is to be - * used for calculation + * @param[in] melFreq Mel frequency in floating point + * @param[in] useHTKMethod bool to signal if HTK method is to be + * used for calculation * @return Real world frequency in floating point **/ static float InverseMelScale(const float melFreq, @@ -168,7 +169,7 @@ namespace audio { /** * @brief Converts the Mel energies for logarithmic scale - * @param[in/out] melEnergies - 1D vector of Mel energies + * @param[in,out] melEnergies 1D vector of Mel energies **/ virtual void ConvertToLogarithmicScale(std::vector<float>& melEnergies); @@ -176,10 +177,10 @@ namespace audio { * @brief Given the low and high Mel values, get the normaliser * for weights to be applied when populating the filter * bank. - * @param[in] leftMel - low Mel frequency value - * @param[in] rightMel - high Mel frequency value - * @param[in] useHTKMethod - bool to signal if HTK method is to be - * used for calculation + * @param[in] leftMel low Mel frequency value + * @param[in] rightMel high Mel frequency value + * @param[in] useHTKMethod bool to signal if HTK method is to be + * used for calculation * @return Return float value to be applied * when populating the filter bank. */ @@ -189,16 +190,16 @@ namespace audio { const bool useHTKMethod); private: - MelSpecParams _m_params; - std::vector<float> _m_frame; - std::vector<float> _m_buffer; - std::vector<float> _m_melEnergies; - std::vector<float> _m_windowFunc; - std::vector<std::vector<float>> _m_melFilterBank; - std::vector<uint32_t> _m_filterBankFilterFirst; - std::vector<uint32_t> _m_filterBankFilterLast; - bool _m_filterBankInitialised; - arm::app::math::FftInstance _m_fftInstance; + MelSpecParams m_params; + std::vector<float> m_frame; + std::vector<float> m_buffer; + std::vector<float> m_melEnergies; + std::vector<float> m_windowFunc; + std::vector<std::vector<float>> m_melFilterBank; + std::vector<uint32_t> m_filterBankFilterFirst; + std::vector<uint32_t> m_filterBankFilterLast; + bool m_filterBankInitialised; + arm::app::math::FftInstance m_fftInstance; /** * @brief Initialises the filter banks. |