2024-01-18 08:52 AM
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.
2024-01-18 10:42 AM
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?
2024-01-18 12:20 PM
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.