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

Type conversion(short to Q15)

Dear all
I have sampled some data using a 16bit ADC the data is in short(16-bit int) format, now I want to use the Cortex CMSIS DSP library to do some calculations like calculating rms values.I have used the arm_rms_q15 function, but the input to this function is in q15 format. How can I convert the short and other int types to the data that has been used in this library?
Any ideas are welcome.

Parents
  • How many places have you posted to?

    forums.arm.com/index.php

    Have you read up on the Q15 (sometimes written Q1.15) format?

    Have you considered how you can take your ADC value and normalize it so that the maximum ADC value would represent 1.0 (or actually 0.99xx something) and how that can be converted into Q1.15? What would the fractional part be for the min ADC value? What would the fractional part be for the maximum ADC value. For an ADC that measures +/- - what would the fractional part be for the maximum negative value?

    So - do you now get an idea what to do?

    What references to Q15 did you got when you googled?

Reply
  • How many places have you posted to?

    forums.arm.com/index.php

    Have you read up on the Q15 (sometimes written Q1.15) format?

    Have you considered how you can take your ADC value and normalize it so that the maximum ADC value would represent 1.0 (or actually 0.99xx something) and how that can be converted into Q1.15? What would the fractional part be for the min ADC value? What would the fractional part be for the maximum ADC value. For an ADC that measures +/- - what would the fractional part be for the maximum negative value?

    So - do you now get an idea what to do?

    What references to Q15 did you got when you googled?

Children