-
Notifications
You must be signed in to change notification settings - Fork 11
/
s_fft.h
69 lines (53 loc) · 1.08 KB
/
s_fft.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
libFooID - Free audio fingerprinting library
Copyright (C) 2006 Gian-Carlo Pascutto, Hogeschool Gent
Use of this software is allowed under either:
1) The GNU General Public License (GPL), as described
in LICENSE.GPL.
2) A modified BSD License, as described in LICENSE.BSDA.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef S_FFT_DEFINED
#define S_FFT_DEFINED
/*
defs
*/
typedef struct
{
float re;
float im;
} t_complex;
typedef struct
{
float cos_t;
float sin_t;
float cos3_t;
float sin3_t;
} t_twiddle;
typedef struct
{
int size;
/*
trig tables
*/
t_twiddle *twiddle_tab;
unsigned *seed_tab;
/*
work buffers
*/
t_complex *work;
}
t_fft_data;
/*
funcs
*/
t_fft_data* fft_init(const int fftsize);
void fft_free(t_fft_data *tb);
void fft(const t_fft_data *tb, t_complex *x);
/*
globals
*/
extern t_fft_data *xtb;
#endif