diff --git a/source/projects/fiddle_tilde/fft_mayer.c b/source/projects/fiddle_tilde/fft_mayer.c old mode 100755 new mode 100644 index 7596fb0..2a8befc --- a/source/projects/fiddle_tilde/fft_mayer.c +++ b/source/projects/fiddle_tilde/fft_mayer.c @@ -1 +1,219 @@ -#define GOOD_TRIG // MSP removing this file cause I dont have it. #include "trigtbl.h" char fht_version[] = "Brcwl-Hrtly-Ron-dbld"; #include "fft_mayer.proto.h" void debug_printf(char *s, ...); #define SQRT2_2 0.70710678118654752440084436210484 #define SQRT2 2*0.70710678118654752440084436210484 void fht(float *fz, int n) { int i,k,k1,k2,k3,k4,kx; float /* REAL */ *fi,*fn,*gi; TRIG_VARS; for (k1=1,k2=0;k1>1; (!((k2^=k)&k)); k>>=1); if (k1>k2) { a=fz[k1]; fz[k1]=fz[k2]; fz[k2]=a; } } for ( k=0 ; (1<> 1; fi = fz; gi = fi + kx; fn = fz + n; do { REAL g0,f0,f1,g1,f2,g2,f3,g3; f1 = fi[0 ] - fi[k1]; f0 = fi[0 ] + fi[k1]; f3 = fi[k2] - fi[k3]; f2 = fi[k2] + fi[k3]; fi[k2] = f0 - f2; fi[0 ] = f0 + f2; fi[k3] = f1 - f3; fi[k1] = f1 + f3; g1 = gi[0 ] - gi[k1]; g0 = gi[0 ] + gi[k1]; g3 = SQRT2 * gi[k3]; g2 = SQRT2 * gi[k2]; gi[k2] = g0 - g2; gi[0 ] = g0 + g2; gi[k3] = g1 - g3; gi[k1] = g1 + g3; gi += k4; fi += k4; } while (fi>1; (!((k2^=k)&k)); k>>=1); + if (k1>k2) { + a=fz[k1]; + fz[k1]=fz[k2]; + fz[k2]=a; + } + } + for ( k=0 ; (1<> 1; + fi = fz; + gi = fi + kx; + fn = fz + n; + do { + REAL g0,f0,f1,g1,f2,g2,f3,g3; + f1 = fi[0 ] - fi[k1]; + f0 = fi[0 ] + fi[k1]; + f3 = fi[k2] - fi[k3]; + f2 = fi[k2] + fi[k3]; + fi[k2] = f0 - f2; + fi[0 ] = f0 + f2; + fi[k3] = f1 - f3; + fi[k1] = f1 + f3; + g1 = gi[0 ] - gi[k1]; + g0 = gi[0 ] + gi[k1]; + g3 = SQRT2 * gi[k3]; + g2 = SQRT2 * gi[k2]; + gi[k2] = g0 - g2; + gi[0 ] = g0 + g2; + gi[k3] = g1 - g3; + gi[k1] = g1 + g3; + gi += k4; + fi += k4; + } while (fi