phase detection and offset elimination

I have interfaced AD7606 simultaneous sampling ADC with ATmega2560. I receive 4 inputs, 50 Hz frequency, 5V peak-peak (max). My goal is to remove any dc offsets present and phase shift between these signals. To eliminate dc offset, I used digital HPF (cut off 0.1Hz, first order). I am unable to verify in plotter if dc offset is actually eliminated. Problem No.2- How to detect phase shift between signals?. Serial print does not accurately depict multiple variables. My scan rate is 500Hz.

Offset elimination is typically done in hardware. An opAmp with AC coupling on its input and fixed offset (2.5V) on its output. In software you have to store a full wave of the signal, determine positive and negative peak and correct the entire sample for zero offset. If you want to use unsigned values, adjust the signals to some common arbitrary offset. Then you also already have located the signal peaks, which you can compare to the peaks of the other signals for the phase shift.

Hi

Any sample program to do this. I found this link,learn/digital-filters-for-offset-removal.md at master · openenergymonitor/learn · GitHub. Will this work?

Secondly I wanted to visualize phase shift of signals. Arduino plotter is not giving accurate representation with Serial.print. Any workaround?

I don't see how you want to represent a phase shift in Serial Plotter.

Hi

I want to visually see the difference in zero crossing in plotter and then using digital all pass filter correct it.