Altera_Forum
Honored Contributor
15 years agofft code in c
hello everyone, I am working on speech recognition projet using nios 2. I need simple fft code in c to run on the nios. did anyone know where can i found one?
Took me a while to figure out what that scaling of the input data is for. In the hardware accelerator version only 16-bit temp value are stored so by prescaling the input by >> 8 it makes sure the temp results between the FFT stages fit in a 16-bit variable. In reality that's more scaling than is necessary, so if you use the software version of the FFT then you shouldn't have to worry about prescaling the input data since the software FFT uses 32-bit temporary storage of the results of each FFT stage.
>> 8 will discard the lowest 8 bits of the value which is identical to dividing by 256. If you use just the software version it should be safe to use this line of code instead: InputData[point_counter] = InData[point_counter];