revert fft scaling

This commit is contained in:
Jörg Thalheim 2015-03-05 14:46:15 +01:00
parent 17890500c7
commit c261fc4d9a

13
fft.c
View File

@ -88,14 +88,19 @@ int fix_fft(fixed fr[], fixed fi[], int m, int inverse)
shift = 0; shift = 0;
for(i=0; i<n; ++i) for(i=0; i<n; ++i)
{ {
xtbool sshift; j = fr[i];
FFT_scale(fr[i], fi[i], sshift, scale); if(j < 0) j = -j;
if(sshift)
m = fi[i];
if(m < 0) m = -m;
if(j > 16383 || m > 16383)
{ {
shift = (int) sshift; shift = 1;
break; break;
} }
} }
if(shift) ++scale;
} }
else else
{ {