wavspa 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,62 @@
1
+ /*
2
+ * Ooura FFT library interface
3
+ *
4
+ * Copyright (C) 2016 Hiroshi Kuwagata <kgt9221@gmail.com>
5
+ */
6
+
7
+ /*
8
+ * $Id$
9
+ */
10
+
11
+ #ifndef __FFT_H__
12
+ #define __FFT_H__
13
+
14
+ #define FFT_WINDOW_RECTANGULAR 0
15
+ #define FFT_WINDOW_HAMMING 1
16
+ #define FFT_WINDOW_HANN 2
17
+ #define FFT_WINDOW_BLACKMAN 3
18
+ #define FFT_WINDOW_BLACKMAN_NUTTALL 4
19
+ #define FFT_WINDOW_FLAT_TOP 5
20
+
21
+ #define FFT_LINEARSCALE_MODE 1
22
+ #define FFT_LOGSCALE_MODE 2
23
+
24
+ typedef struct {
25
+ double* data;
26
+ double* wtbl;
27
+ int fmt;
28
+
29
+ int capa;
30
+ int used;
31
+
32
+ int magnify;
33
+
34
+ void* line;
35
+ int width;
36
+
37
+ int mode;
38
+ double fq_s; // as "sampline frequency"
39
+ double fq_h; // as "high-side frequency"
40
+ double fq_l; // as "low-side frequency"
41
+
42
+ double* a;
43
+ int* ip;
44
+ double* w;
45
+ } fft_t;
46
+
47
+ int fft_new(char* fmt, int capa, fft_t** obj);
48
+ int fft_destroy(fft_t* fft);
49
+
50
+ int fft_set_window(fft_t* fft, int type);
51
+ int fft_set_width(fft_t* fft, int width);
52
+ int fft_set_scale_mode(fft_t* fft, int mode);
53
+ int fft_set_frequency(fft_t* fft, double s, double l, double h);
54
+
55
+ int fft_shift_in(fft_t* fft, void* data, int n);
56
+ int fft_reset(fft_t* fft);
57
+ int fft_transform(fft_t* fft);
58
+ int fft_calc_spectrum(fft_t* fft, double* dst);
59
+ int fft_calc_amplitude(fft_t* fft, double* dst);
60
+ int fft_calc_absolute(fft_t* fft, double* dst);
61
+
62
+ #endif /* !defined(__FFT_H__) */