2020-10-09 05:30 AM
Hello
I have DMA ADC and store data in uint16_t buffer
I need to copy these values to input buffer to arm_rfft_fast_f32 function;
the function should also cast ushort to float
void copy_adc_to_input(uint16_t * int_buff, float32_t * float_buff, uint16_t size)
{
for(int i = 0; i < size; i++)
{
float_buff[i] = (float32_t)int_buff[i];
}
}
it seems to be working on STM32F7 mcu but goes crazy on STM32F303
any suggestions ???
2020-10-09 06:36 AM
I don't see anything wrong with the code. What does "goes crazy" mean?
2020-10-09 06:54 AM
turns out this fft function modifies input buffer as well. That was the reason why I could not recognize what I was seeing.
At this stage I am witnessing rather strange thing. my adc is 12 bits resolution but values are in 16 bit for some reason.
I use uint16_t for buffer. I think I just need to shift down these values