| 261 | } |
| 262 | |
| 263 | std::vector<float> MFCC::MfccCompute(const std::vector<float>& audioData) |
| 264 | { |
| 265 | this->MfccComputePreFeature(audioData); |
| 266 | |
| 267 | std::vector<float> mfccOut(this->m_params.m_numMfccFeatures); |
| 268 | |
| 269 | float * ptrMel = this->m_melEnergies.data(); |
| 270 | float * ptrDct = this->m_dctMatrix.data(); |
| 271 | float * ptrMfcc = mfccOut.data(); |
| 272 | |
| 273 | /* Take DCT. Uses matrix mul. */ |
| 274 | for (size_t i = 0, j = 0; i < mfccOut.size(); |
| 275 | ++i, j += this->m_params.m_numFbankBins) |
| 276 | { |
| 277 | *ptrMfcc++ = MathUtils::DotProductF32( |
| 278 | ptrDct + j, |
| 279 | ptrMel, |
| 280 | this->m_params.m_numFbankBins); |
| 281 | } |
| 282 | return mfccOut; |
| 283 | } |
| 284 | |
| 285 | std::vector<std::vector<float>> MFCC::CreateMelFilterBank() |
| 286 | { |
no test coverage detected