blob: 57ac24ee50a6d00dd5c9af280ad20c708954a8c8 [file] [log] [blame]
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef AUDIO_PREP_UTIL_H_
#define AUDIO_PREP_UTIL_H_
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
// Evenly linear spaced array
void linspace(float* x, float start, float end, int n);
// Calculate the dot product of two vectors
float dot_product(float* v, float* u, int n);
/*---------------------------------------------------------------------------
* FUNCTION NAME: rfft
*
* PURPOSE: Real valued, in-place split-radix FFT
*
* INPUT:
* x Pointer to input and output array
* m 2^m = n is the Length of FFT
*
* OUTPUT Output order
* Re(0), Re(1), ..., Re(n/2), Im(N/2-1), ..., Im(1)
*
* RETURN VALUE
* none
*
*---------------------------------------------------------------------------*/
void rfft(float* x, int m);
#endif // AUDIO_PREP_UTIL_H_