What is Q31 format?
Representation in fixed point:
Consider floating point number 0.5 . To represent this number in Q31 format (31 bits for fractional part), the number has to be multiplied by 231. Hence, 0.5 can be represented in Q31 format as 0.5* 231=1073741824.
How do you convert raw voltage to ADC?
ADC has a resolution of one part in 4,096, where 212 = 4,096. Thus, a 12-bit ADC with a maximum input of 10 VDC can resolve the measurement into 10 VDC/4096 = 0.00244 VDC = 2.44 mV. Similarly, for the same 0 to 10 VDC range, a 16-bit ADC resolution is 10/216 = 10/65,536 = 0.153 mV.