revert fft scaling

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

29
fft.c
View File

@ -84,18 +84,23 @@ int fix_fft(fixed fr[], fixed fi[], int m, int inverse)
{ {
if(inverse) if(inverse)
{ {
/* variable scaling, depending upon data */ /* variable scaling, depending upon data */
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];
shift = (int) sshift; if(m < 0) m = -m;
break;
} if(j > 16383 || m > 16383)
} {
shift = 1;
break;
}
}
if(shift) ++scale;
} }
else else
{ {