blob: 049981df155b09bc8103a8db1e08f0acb153f04f [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001/*
Richard Burtonf32a86a2022-11-15 11:46:11 +00002 * SPDX-FileCopyrightText: Copyright 2021 Arm Limited and/or its affiliates <open-source-office@arm.com>
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_MICRONET_MFCC_HPP
18#define KWS_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. */
27 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
Kshitij Sisodia76a15802021-12-24 11:05:11 +000036 explicit MicroNetKwsMFCC(const size_t numFeats, const size_t frameLen)
alexander3c798932021-03-26 21:42:19 +000037 : MFCC(MfccParams(
38 ms_defaultSamplingFreq, ms_defaultNumFbankBins,
39 ms_defaultMelLoFreq, ms_defaultMelHiFreq,
40 numFeats, frameLen, ms_defaultUseHtkMethod))
41 {}
Kshitij Sisodia76a15802021-12-24 11:05:11 +000042 MicroNetKwsMFCC() = delete;
43 ~MicroNetKwsMFCC() = default;
alexander3c798932021-03-26 21:42:19 +000044 };
45
46} /* namespace audio */
47} /* namespace app */
48} /* namespace arm */
49
Kshitij Sisodia76a15802021-12-24 11:05:11 +000050#endif /* KWS_MICRONET_MFCC_HPP */