Question regarding FFTs in arm_math.h
Hello!
I am trying to simulate an octave model on a microcontroller and ran into a snag I thought I'd get some help with.
So I have an FFT I am running on a sample of data (we'll say 4096 bytes). In octave, I'm using an FFT of the sample (where the sample is a 1 x 8192 array):
fft_data = fft(sample);Pretty straight forward function. I have the data extracted to a csv file for comparison to ensure the data matches up.
I am now trying to replicate the fft on a microcontroller. I thought I had set it up correctly from a few forum posts but I can't tell if I'm using the wrong type of fft, the wrong data size, etc. Below is essentially what I have on the microcontroller:
float32_t sample_flt[4096] = {0};
float32_t fft_out_buf[4096] = {0};
arm_rfft_fast_instance_f32 fft_handler;
arm_rfft_fast_init_f32(&fft_handler, 4096);
arm_rfft_fast_f32(&fft_handler, (float32_t *)sample_flt,(float32_t *)fft_out_buf,0);When I'm looking at the contents of the sample, I'm getting sample[0] and sample[1] filled with information (that doesn't match my octave data) and the rest are nan.
Is it safe to assume the nan is because it's a complex number and can't be displayed?
Am I using the fft correctly or am I setting something up wrong?
I think I am close but I think I'm missing something really simple.
Any information you can give me would be greatly appreciated. Thanks!
NOTE: Edited original code posted to reflect fft init command that I forgot to add to post (but is in code).
Additional info given in post below as well.
