summaryrefslogtreecommitdiff
path: root/source/use_case/kws_asr/include
diff options
context:
space:
mode:
Diffstat (limited to 'source/use_case/kws_asr/include')
-rw-r--r--source/use_case/kws_asr/include/DsCnnModel.hpp2
-rw-r--r--source/use_case/kws_asr/include/OutputDecode.hpp2
-rw-r--r--source/use_case/kws_asr/include/Wav2LetterModel.hpp2
-rw-r--r--source/use_case/kws_asr/include/Wav2LetterPostprocess.hpp19
-rw-r--r--source/use_case/kws_asr/include/Wav2LetterPreprocess.hpp38
5 files changed, 32 insertions, 31 deletions
diff --git a/source/use_case/kws_asr/include/DsCnnModel.hpp b/source/use_case/kws_asr/include/DsCnnModel.hpp
index f9d4357..92d96b9 100644
--- a/source/use_case/kws_asr/include/DsCnnModel.hpp
+++ b/source/use_case/kws_asr/include/DsCnnModel.hpp
@@ -58,7 +58,7 @@ namespace app {
static constexpr int ms_maxOpCnt = 10;
/* 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/kws_asr/include/OutputDecode.hpp b/source/use_case/kws_asr/include/OutputDecode.hpp
index 2bbb29c..cea2c33 100644
--- a/source/use_case/kws_asr/include/OutputDecode.hpp
+++ b/source/use_case/kws_asr/include/OutputDecode.hpp
@@ -27,7 +27,7 @@ namespace asr {
/**
* @brief Gets the top N classification results from the
* output vector.
- * @param[in] tensor Label output from classifier.
+ * @param[in] vecResults Label output from classifier.
* @return true if successful, false otherwise.
**/
std::string DecodeOutput(const std::vector<ClassificationResult>& vecResults);
diff --git a/source/use_case/kws_asr/include/Wav2LetterModel.hpp b/source/use_case/kws_asr/include/Wav2LetterModel.hpp
index 9a86bd9..7c327b3 100644
--- a/source/use_case/kws_asr/include/Wav2LetterModel.hpp
+++ b/source/use_case/kws_asr/include/Wav2LetterModel.hpp
@@ -58,7 +58,7 @@ namespace app {
static constexpr int ms_maxOpCnt = 5;
/* 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/kws_asr/include/Wav2LetterPostprocess.hpp b/source/use_case/kws_asr/include/Wav2LetterPostprocess.hpp
index fe60923..5c11412 100644
--- a/source/use_case/kws_asr/include/Wav2LetterPostprocess.hpp
+++ b/source/use_case/kws_asr/include/Wav2LetterPostprocess.hpp
@@ -33,10 +33,11 @@ namespace asr {
public:
/**
* @brief Constructor
- * @param[in] contextLen Left and right context length for
- * output tensor.
- * @param[in] innerLen This is the length of the section
- * between left and right context.
+ * @param[in] contextLen Left and right context length for
+ * output tensor.
+ * @param[in] innerLen This is the length of the section
+ * between left and right context.
+ * @param[in] blankTokenIdx Blank token index.
**/
Postprocess(uint32_t contextLen,
uint32_t innerLen,
@@ -61,11 +62,11 @@ namespace asr {
bool lastIteration = false);
private:
- uint32_t _m_contextLen; /* Lengths of left and right contexts. */
- uint32_t _m_innerLen; /* Length of inner context. */
- uint32_t _m_totalLen; /* Total length of the required axis. */
- uint32_t _m_countIterations; /* Current number of iterations. */
- uint32_t _m_blankTokenIdx; /* Index of the labels blank token. */
+ uint32_t m_contextLen; /* Lengths of left and right contexts. */
+ uint32_t m_innerLen; /* Length of inner context. */
+ uint32_t m_totalLen; /* Total length of the required axis. */
+ uint32_t m_countIterations; /* Current number of iterations. */
+ uint32_t m_blankTokenIdx; /* Index of the labels blank token. */
/**
* @brief Checks if the tensor and axis index are valid
* inputs to the object - based on how it has been
diff --git a/source/use_case/kws_asr/include/Wav2LetterPreprocess.hpp b/source/use_case/kws_asr/include/Wav2LetterPreprocess.hpp
index cf40fa8..66d19d3 100644
--- a/source/use_case/kws_asr/include/Wav2LetterPreprocess.hpp
+++ b/source/use_case/kws_asr/include/Wav2LetterPreprocess.hpp
@@ -145,32 +145,32 @@ namespace asr {
const int quantOffset)
{
/* Check the output size will for everything. */
- if (outputBufSz < (this->_m_mfccBuf.size(0) * 3 * sizeof(T))) {
+ if (outputBufSz < (this->m_mfccBuf.size(0) * 3 * sizeof(T))) {
printf_err("Tensor size too small for features\n");
return false;
}
/* Populate. */
T * outputBufMfcc = outputBuf;
- T * outputBufD1 = outputBuf + this->_m_numMfccFeats;
- T * outputBufD2 = outputBufD1 + this->_m_numMfccFeats;
- const uint32_t ptrIncr = this->_m_numMfccFeats * 2; /* (3 vectors - 1 vector) */
+ T * outputBufD1 = outputBuf + this->m_numMfccFeats;
+ T * outputBufD2 = outputBufD1 + this->m_numMfccFeats;
+ const uint32_t ptrIncr = this->m_numMfccFeats * 2; /* (3 vectors - 1 vector) */
const float minVal = std::numeric_limits<T>::min();
const float maxVal = std::numeric_limits<T>::max();
/* We need to do a transpose while copying and concatenating
* the tensor. */
- for (uint32_t j = 0; j < this->_m_numFeatVectors; ++j) {
- for (uint32_t i = 0; i < this->_m_numMfccFeats; ++i) {
+ for (uint32_t j = 0; j < this->m_numFeatVectors; ++j) {
+ for (uint32_t i = 0; i < this->m_numMfccFeats; ++i) {
*outputBufMfcc++ = static_cast<T>(this->GetQuantElem(
- this->_m_mfccBuf(i, j), quantScale,
+ this->m_mfccBuf(i, j), quantScale,
quantOffset, minVal, maxVal));
*outputBufD1++ = static_cast<T>(this->GetQuantElem(
- this->_m_delta1Buf(i, j), quantScale,
+ this->m_delta1Buf(i, j), quantScale,
quantOffset, minVal, maxVal));
*outputBufD2++ = static_cast<T>(this->GetQuantElem(
- this->_m_delta2Buf(i, j), quantScale,
+ this->m_delta2Buf(i, j), quantScale,
quantOffset, minVal, maxVal));
}
outputBufMfcc += ptrIncr;
@@ -182,18 +182,18 @@ namespace asr {
}
private:
- Wav2LetterMFCC _m_mfcc; /* MFCC instance. */
+ Wav2LetterMFCC m_mfcc; /* MFCC instance. */
/* Actual buffers to be populated. */
- Array2d<float> _m_mfccBuf; /* Contiguous buffer 1D: MFCC */
- Array2d<float> _m_delta1Buf; /* Contiguous buffer 1D: Delta 1 */
- Array2d<float> _m_delta2Buf; /* Contiguous buffer 1D: Delta 2 */
-
- uint32_t _m_windowLen; /* Window length for MFCC. */
- uint32_t _m_windowStride; /* Window stride len for MFCC. */
- uint32_t _m_numMfccFeats; /* Number of MFCC features per window. */
- uint32_t _m_numFeatVectors; /* Number of _m_numMfccFeats. */
- AudioWindow _m_window; /* Sliding window. */
+ Array2d<float> m_mfccBuf; /* Contiguous buffer 1D: MFCC */
+ Array2d<float> m_delta1Buf; /* Contiguous buffer 1D: Delta 1 */
+ Array2d<float> m_delta2Buf; /* Contiguous buffer 1D: Delta 2 */
+
+ uint32_t m_windowLen; /* Window length for MFCC. */
+ uint32_t m_windowStride; /* Window stride len for MFCC. */
+ uint32_t m_numMfccFeats; /* Number of MFCC features per window. */
+ uint32_t m_numFeatVectors; /* Number of m_numMfccFeats. */
+ AudioWindow m_window; /* Sliding window. */
};