1 /* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7     http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 
16 // Basic minimal DCT class for MFCC speech processing.
17 
18 #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_MFCC_DCT_H_
19 #define TENSORFLOW_LITE_KERNELS_INTERNAL_MFCC_DCT_H_
20 
21 #include <vector>
22 
23 namespace tflite {
24 namespace internal {
25 
26 class MfccDct {
27  public:
28   MfccDct();
29   bool Initialize(int input_length, int coefficient_count);
30   void Compute(const std::vector<double>& input,
31                std::vector<double>* output) const;
32 
33  private:
34   bool initialized_;
35   int coefficient_count_;
36   int input_length_;
37   std::vector<std::vector<double> > cosines_;
38 };
39 
40 }  // namespace internal
41 }  // namespace tflite
42 
43 #endif  // TENSORFLOW_LITE_KERNELS_INTERNAL_MFCC_DCT_H_
44