CMSIS arm_rfft_q15 anomalous results

17 Views Asked by At

I am computing the FFT from a sine of 10 Hz @ 512 Hz, using arm_rfft_q15 function from CMSIS.

I extracted a chunk of 1024 samples from the signal and sent to the function. After getting the result, I extract the real part of the fft with arm_cmplx_mag_q15.I expect having a peak at 20, which is approx the frequency 10 in NFFT 1024.

What I get is the following: enter image description here

I have tried:

  1. The data starts and end at the same sample.
  2. shifted the signal to positive values with an offset, to avoid having negative values, but also tested with negative values

What could be the cause of this weird result? I don't know what else to test and there is not much documentation about this.

0

There are 0 best solutions below