blob: 57ac24ee50a6d00dd5c9af280ad20c708954a8c8 [file] [log] [blame]
Lun Donga43730e2022-06-22 21:52:14 -07001/*
2 * Copyright 2022 Google LLC
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Cindy Liu3c4d6272022-08-04 18:54:12 -070017#ifndef AUDIO_PREP_UTIL_H_
18#define AUDIO_PREP_UTIL_H_
Lun Donga43730e2022-06-22 21:52:14 -070019
20#ifndef M_PI
21#define M_PI 3.14159265358979323846
22#endif
23
24// Evenly linear spaced array
25void linspace(float* x, float start, float end, int n);
26
27// Calculate the dot product of two vectors
28float dot_product(float* v, float* u, int n);
29
30/*---------------------------------------------------------------------------
31 * FUNCTION NAME: rfft
32 *
33 * PURPOSE: Real valued, in-place split-radix FFT
34 *
35 * INPUT:
36 * x Pointer to input and output array
37 * m 2^m = n is the Length of FFT
38 *
39 * OUTPUT Output order
40 * Re(0), Re(1), ..., Re(n/2), Im(N/2-1), ..., Im(1)
41 *
42 * RETURN VALUE
43 * none
44 *
45 *---------------------------------------------------------------------------*/
46void rfft(float* x, int m);
47
Cindy Liu3c4d6272022-08-04 18:54:12 -070048#endif // AUDIO_PREP_UTIL_H_