This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

When does *fft_noscale() work?

I see that there are fft function variations with SCALE and NOSCALE.  Under what conditions are the NOSCALE variants appropriate?

My first hunch was that smaller signal amplitudes might work fine with NOSCALE, while full amplitude signals would probably require SCALE.  However, I now wonder if I have this backwards because of Q.15 format, and perhaps small fractions are worse without scaling.

Can anyone comment on how to decide which to use? I'm sure that SCALE will work under all conditions, but it is the implementation that takes more cycles.  So the real question is how to be sure that the faster NOSCALE version will work.

  • Perhaps my question will make more sense if I put it in context.

    My application obtains unsigned data from an ADS chip in the lower 12 bits of each word, ranging from 0x0000 to 0x0FFF.  My firmware will need to convert these unsigned values to signed Q.15 format, which is effectively equivalent to scaling.  It seems like I should adjust my scaling code to match the needs of the NOSCALE variant rather than waste cycles by having the SCALE variant retouch all the input samples.

    I assume that *fft_scale() expects Q.15 values in the range: (-1 < x < +1).  Looking at the source for cfft_scale(), it appears that every input is divided by 2, such that the values have the range (-0.5 < x < +0.5).  Thus, it seems that if I alter my conversion to bring the unsigned 12-bit samples into the -0.5 to +0.5 range, then I can just call cfft_noscale() without the additional overhead of a second pass for scaling.

    Apart from confirming the above, I am particularly interested in whether cfft_noscale() will work properly with inputs equal to -0.5 or +0.5, exactly.  I have a hunch that the actual range is probably (-0.5 <= x < +0.5), but I suppose it could be less.