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 #ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICROFRONTEND_LIB_FFT_H_ 16 #define TENSORFLOW_LITE_EXPERIMENTAL_MICROFRONTEND_LIB_FFT_H_ 17 18 #include <stdint.h> 19 #include <stdlib.h> 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 struct complex_int16_t { 26 int16_t real; 27 int16_t imag; 28 }; 29 30 struct FftState { 31 int16_t* input; 32 struct complex_int16_t* output; 33 size_t fft_size; 34 size_t input_size; 35 void* scratch; 36 size_t scratch_size; 37 }; 38 39 void FftCompute(struct FftState* state, const int16_t* input, 40 int input_scale_shift); 41 42 void FftInit(struct FftState* state); 43 44 void FftReset(struct FftState* state); 45 46 #ifdef __cplusplus 47 } // extern "C" 48 #endif 49 50 #endif // TENSORFLOW_LITE_EXPERIMENTAL_MICROFRONTEND_LIB_FFT_H_ 51