cancel
Showing results for 
Search instead for 
Did you mean: 

Subtract offset voltage

Sax
Associate III

I have converted an analog signal with offset voltage through ADC to digital. Now I have an array of 1024 integer values. To edit this signal further, I need to convert the integer values to float. Then make this signal offset-free (by q15). I would appreciate it if someone would help me with this.

2 REPLIES 2
TDK
Guru

Duplicate:

https://community.st.com/t5/stm32cubeide-mcus/make-digital-signal-offset-free/td-p/628642

 

I'm not quite sure what you're asking here. Surely you can do subtraction between values. What have you done so far?

If you feel a post has answered your question, please click "Accept as Solution".
Sax
Associate III

for (int i = 0; i<= adcBufferSize; i++)

{

adc_buffer_float[i] = (float)adc_buffer [i];

fir_in_arm [i] = (adc_buffer_float[i]-2048)/2048;

 

}

I tried to convert the integer values to float with casting. Then I should use the Q1.15 format to make the signal offset-free.

Unfortunately, the casting does not convert the values to the float and the subsequent steps do not work properly.

My adc_buffer values are between 0 and 4096 and buffersize is 1024.