This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to prepare ADC data for Q31_t CMSIS DSP functions?

Hi to you all,
I've another post on the forum (here's the link Process ADC data, moved by DMA, using CMSIS DSP: what's the right way? ), but since I think I made some small steps forward I felt I could be a little more specific. I hope this won't be a problem.

Actually I'm trying to extract the MAX from a q31_t (Note that: typedef int32_t q31_t) array filled by the ADCHS in my LPC4370 lpc link2 board, using the arm_max_q31 function (here for reference: Maximum).
The problem is that the 12bit ADC supplies data in Two's Complement format, but the library is misunderstanding it (ora at least I think so).
For instance: 

111111111111

Should be

-1

but actually is read by the CMSIS Function as

4095

and therefore is always recognized as the MAX value.

Do I need to manually convert all the samples one-by-one? This seems to be extremely slow, and since I've some real-time requirements I need the fastest way to do this maths.
Any help would be highly appreciated since I'm stuck here.

Thanks,
Andrea