annotate 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
rev   line source
tomwalters@0 1
tomwalters@0 2 #define PI 3.14159265
tomwalters@0 3 #define TWOPI 6.2831853
tomwalters@0 4
tomwalters@0 5 #define MAXSHORT 32767.
tomwalters@0 6 #define MINSHORT ( -32767. )
tomwalters@0 7
tomwalters@0 8 #define log2(x) (log((double)x)/log(2.0))
tomwalters@0 9
tomwalters@0 10 typedef struct {
tomwalters@0 11 float real;
tomwalters@0 12 float imag;
tomwalters@0 13 } complex;
tomwalters@0 14
tomwalters@0 15 #define sq(x) ((x)*(x))
tomwalters@0 16 #define Re(C) (C)->real /* cartesian form */
tomwalters@0 17 #define Im(C) (C)->imag
tomwalters@0 18
tomwalters@0 19
tomwalters@0 20 /*
tomwalters@0 21 V is m floats interpreted as m/2 complex numbers: (real,imag).
tomwalters@0 22 mag: overwrite first m/2 floats with mod of m/2 complex numbers.
tomwalters@0 23 phase: overwrite first m/2 floats with arg of m/2 complex numbers.
tomwalters@0 24 fft: overwrite m floats with m/2 complex numbers (Fourier spectrum).
tomwalters@0 25 */
tomwalters@0 26
tomwalters@0 27 #define mag(V,m) Mod( (complex *)V, m>>1 )
tomwalters@0 28 #define phase(V,m) Arg( (complex *)V, m>>1 )
tomwalters@0 29 #define fft(V,m,i) realft( (float *)(V)-1, m>>1, i )
tomwalters@0 30
tomwalters@0 31
tomwalters@0 32 float mod();
tomwalters@0 33 float arg();
tomwalters@0 34
tomwalters@0 35
tomwalters@0 36 int ispower();
tomwalters@0 37 int getpower();
tomwalters@0 38
tomwalters@0 39 float ftos() ;
tomwalters@0 40
tomwalters@0 41 float *raised_cosine() ;
tomwalters@0 42 float *hamming() ;
tomwalters@0 43 float *gauss_window() ;
tomwalters@0 44
tomwalters@0 45 short *getframe() ;