Hi,
The fft lib is working with my test project but failed with my main project, here is differences:
Project | Test project | Main project |
Languange | Pure C | FFT functions are coded with C but will finally called by C++ |
Run-time location | RAM | Flash |
Code |
#define N_SHIFT 7
/* unsigned int i; // Number of periods to sample // Sample step fft.ipcbptr = Buffer; // Construct the signal RFFT32_brev(Buffer, Buffer, N); fft.split(&fft); return 0; } |
void AutoTuneCalcRFFT32_128P(INT32* pBuffer) { // Calculating result RFFT32 fft = RFFT32_128P_DEFAULTS; fft.ipcbptr = pBuffer; fft.magptr = pBuffer; fft.init(&fft); RFFT32_brev(pBuffer, pBuffer, 128); fft.calc(&fft); fft.split(&fft); fft.mag(&fft); } |
Even the address of the buffer has been located to be the same, and I even tried saving the buffer(data) from the main project and then load to the buffer of the test project, but the calculating results (fft.calc(&fft);) are still not the same.
Did I missed anything?
Any comments are appriciated in advance.