blue_diode
Newbie
I'm using a STM32 Cortex M0+ to read an AC signal from a CT. I'm sampling at 6kHz and storing 400 samples. The signal has a DC bias equal to Vcc/2 = 1.65V. In the digital domain this is 2048. When there's no input signal, I only read the DC bias which is OK. Have a look at the dc_bias_raw.txt file. As you can see, the readings are not so bad. It varies from 2044 to 2052. The DC bias is very precise in hardware so I think this variation is due to the noise floor. Now if I want to do RMS in that set of data, I need to find a way to deal with this DC bias variation. In the file adc_raw_current.txt you can see the samples when there's an input signal.
I have been thinking the following:
1- Subtract a fixed value of 2048 from each ADC reading. This is no so good as I said above this value may vary slightly. Also, if I want to read zero cross it may cause errors to choose exactly 2048 as reference.
2- Sample the DC bias and average it.
3- Don't remove the DC bias. If I calculate RMS then I would get the DC value when there's no input signal.
4- Use a more sophisticated software high pass filter
I appreciate any help or suggestion
I have been thinking the following:
1- Subtract a fixed value of 2048 from each ADC reading. This is no so good as I said above this value may vary slightly. Also, if I want to read zero cross it may cause errors to choose exactly 2048 as reference.
2- Sample the DC bias and average it.
3- Don't remove the DC bias. If I calculate RMS then I would get the DC value when there's no input signal.
4- Use a more sophisticated software high pass filter
I appreciate any help or suggestion