I'm using a MCU ADC, PIC18F26K22, to sample and calculate a RMS value of a sine wave that is rectified by the full precision rectifying circuit in the schematic below. This ADC has 10 bits and I'm sampling at 50 kHz. The signal is 2 kHz and at the ADC input has 700mVp. This voltage was measured with a digital oscilloscope.
I already did the compensation for Gain and Offset errors, using DC voltages and a very good quality multi-meter, but when I'm sampling this sine wave I'm having a very poor accuracy in the results, for instance, in 700mVp Sin Wave the ADC is sampling peak values of ~620mV. I'm using the internal voltage reference of 2.048V, which guarantees a low error.
So, I'm really clueless about what could be done to solve this, I already increased the acquisition time, with the cost of reducing the sampling frequency, but still the voltage peak values do not change.
What is the cause of the incorrect peak voltage? How can I fix this problem?