What has apparently happened, is you looked at the published version of emonLibCM. Immediately it was published, I realised that some serious errors had crept in and I asked for it to be withdrawn, but that did not happen. There are several posts (probably here, but also on the archived forums) warning that it should not be used. I’m sorry if you wasted time and effort looking at it.
What the ‘new’ version does, in place of the low pass filter, is pretty much as you expound, but with some differences due to the implementation. For example, I now initially subtract a constant offset of the nominal half-rail voltage purely to reduce the size of the numbers, and then derive the remaining bias offset over the full reporting period. As you say, hopefully it won’t change much over that period. The high or low pass filter has completely gone.
Phase adjustment doesn’t “just purports to correct the sampling timing error” (not even in emonLib) but attempts a correction for the difference in phase errors between v.t. & c.t. too. It can never succeed completely, because both phase errors depend on the magnitude of the variable being measured.
I take it you’re talking about the fundamental component here. The way real power is calculated (surely you have noticed?) is to multiply individual pairs of voltage and current samples and average. Apparent power comes from multiplying rms voltage and rms current, and power factor thereby comes directly from the definition: the ratio of real to apparent power. None of our sketches do Fourier to extract the fundamentals and thereby phase angle. Clearly, as soon as one of the wave shapes ceases to be a pure sinusoid, phase angle becomes meaningless.
You are referring to the interpolation/extrapolation algorithm for time-shifting the wave? The amplitude error is a known fact and covered in the calibration instructions. More to the point, unless the wave is a pure sinusoid, it distorts the shape too. The distortion is visible even on my ‘flat-topped’ mains voltage wave, and would be wholly unacceptable on a current wave if the load was non-linear. Sadly, as the absolute maximum speed to the ADC is 104 μs per sample, and there is only one ADC in the Atmel 328P, we are stuck with voltage samples that can be in excess of 9° apart, and interpolating between samples to ‘phase shift’ the wave is the only way.
I fully accept that phase correction has little consequence with purely resistive loads, obviously because the top of the cosine curve is a good approximation to flat, but unfortunately as the power factor falls, it becomes more important and in the extreme, the power can end up in the wrong quadrant. The user tends to get very excited when that happens.
A lot of distortion, as well as phase error, comes from the a.c. adapter. Unfortunately, there is no practical (from a regulatory point of view) alternative either for that or for the split-core CT. You must bear in mind that equipment manufactured and sold in the Shop has to be safe for non-technical users. It’s been suggested that a small 1:1 c.t. fed via a multiplier resistor would give much greater fidelity, but we need to find a manufacturer willing to assemble it in a plug-top case (or similar) and go through the regulatory hoops for CE approval, and then anyone opting for that would need a separate 5 V power pack as well. One of my professional colleagues published “GIVMon” - some while ago, in the Archive - but again putting that into production would face the same difficulties. I also put forward a capacitive divider for someone who was unable to have a mains socket in the right place, but I don’t know whether it was built.
For measuring phase errors, I use a computer sound card doing 48 k samples per second, with Fourier analysis in a spreadsheet.