blob: af6ba5f7c1c0f9fec793946b9d7b16e111777def [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001/*
Richard Burton4e002792022-05-04 09:45:02 +01002 * Copyright (c) 2021-2022 Arm Limited. All rights reserved.
alexander3c798932021-03-26 21:42:19 +00003 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
Kshitij Sisodia76a15802021-12-24 11:05:11 +000017#ifndef KWS_ASR_MICRONET_MFCC_HPP
18#define KWS_ASR_MICRONET_MFCC_HPP
alexander3c798932021-03-26 21:42:19 +000019
20#include "Mfcc.hpp"
21
22namespace arm {
23namespace app {
24namespace audio {
25
Kshitij Sisodia76a15802021-12-24 11:05:11 +000026 /* Class to provide MicroNet specific MFCC calculation requirements. */
Richard Burton4e002792022-05-04 09:45:02 +010027 class MicroNetKwsMFCC : public MFCC {
alexander3c798932021-03-26 21:42:19 +000028
29 public:
30 static constexpr uint32_t ms_defaultSamplingFreq = 16000;
31 static constexpr uint32_t ms_defaultNumFbankBins = 40;
32 static constexpr uint32_t ms_defaultMelLoFreq = 20;
33 static constexpr uint32_t ms_defaultMelHiFreq = 4000;
34 static constexpr bool ms_defaultUseHtkMethod = true;
35
36
Richard Burton4e002792022-05-04 09:45:02 +010037 explicit MicroNetKwsMFCC(const size_t numFeats, const size_t frameLen)
alexander3c798932021-03-26 21:42:19 +000038 : MFCC(MfccParams(
39 ms_defaultSamplingFreq, ms_defaultNumFbankBins,
40 ms_defaultMelLoFreq, ms_defaultMelHiFreq,
41 numFeats, frameLen, ms_defaultUseHtkMethod))
42 {}
Richard Burton4e002792022-05-04 09:45:02 +010043 MicroNetKwsMFCC() = delete;
44 ~MicroNetKwsMFCC() = default;
alexander3c798932021-03-26 21:42:19 +000045 };
46
47} /* namespace audio */
48} /* namespace app */
49} /* namespace arm */
50
Kshitij Sisodia76a15802021-12-24 11:05:11 +000051#endif /* KWS_ASR_MICRONET_MFCC_HPP */