Mercurial > hg > aim92
comparison tools/sigproc.h @ 0:5242703e91d3 tip
Initial checkin for AIM92 aimR8.2 (last updated May 1997).
author | tomwalters |
---|---|
date | Fri, 20 May 2011 15:19:45 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:5242703e91d3 |
---|---|
1 | |
2 #define PI 3.14159265 | |
3 #define TWOPI 6.2831853 | |
4 | |
5 #define MAXSHORT 32767. | |
6 #define MINSHORT ( -32767. ) | |
7 | |
8 #define log2(x) (log((double)x)/log(2.0)) | |
9 | |
10 typedef struct { | |
11 float real; | |
12 float imag; | |
13 } complex; | |
14 | |
15 #define sq(x) ((x)*(x)) | |
16 #define Re(C) (C)->real /* cartesian form */ | |
17 #define Im(C) (C)->imag | |
18 | |
19 | |
20 /* | |
21 V is m floats interpreted as m/2 complex numbers: (real,imag). | |
22 mag: overwrite first m/2 floats with mod of m/2 complex numbers. | |
23 phase: overwrite first m/2 floats with arg of m/2 complex numbers. | |
24 fft: overwrite m floats with m/2 complex numbers (Fourier spectrum). | |
25 */ | |
26 | |
27 #define mag(V,m) Mod( (complex *)V, m>>1 ) | |
28 #define phase(V,m) Arg( (complex *)V, m>>1 ) | |
29 #define fft(V,m,i) realft( (float *)(V)-1, m>>1, i ) | |
30 | |
31 | |
32 float mod(); | |
33 float arg(); | |
34 | |
35 | |
36 int ispower(); | |
37 int getpower(); | |
38 | |
39 float ftos() ; | |
40 | |
41 float *raised_cosine() ; | |
42 float *hamming() ; | |
43 float *gauss_window() ; | |
44 | |
45 short *getframe() ; |