wavspa 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +196 -0
- data/Rakefile +2 -0
- data/bin/wavfft +167 -0
- data/bin/wavlet +160 -0
- data/example/Call_To_Quarters-fft.png +0 -0
- data/example/Call_To_Quarters-wavelet.png +0 -0
- data/ext/wavspa/fb/extconf.rb +3 -0
- data/ext/wavspa/fb/rb_fb.c +690 -0
- data/ext/wavspa/fft/extconf.rb +6 -0
- data/ext/wavspa/fft/fft.c +918 -0
- data/ext/wavspa/fft/fft.h +62 -0
- data/ext/wavspa/fft/fftsg.c +3314 -0
- data/ext/wavspa/fft/rb_fft.c +458 -0
- data/ext/wavspa/wavelet/extconf.rb +37 -0
- data/ext/wavspa/wavelet/rb_wavelet.c +706 -0
- data/ext/wavspa/wavelet/walet.c +803 -0
- data/ext/wavspa/wavelet/walet.h +59 -0
- data/lib/wav.rb +87 -0
- data/lib/wavspa/common.rb +74 -0
- data/lib/wavspa/version.rb +3 -0
- data/lib/wavspa/wavfft/main.rb +130 -0
- data/lib/wavspa/wavfft/preset.rb +54 -0
- data/lib/wavspa/wavlet/main.rb +139 -0
- data/lib/wavspa/wavlet/preset.rb +38 -0
- data/wavspa.gemspec +47 -0
- metadata +119 -0
@@ -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__) */
|