Thanks for looking into it for me :) and I more and more are confident that this seems to be the way of doing the energy calculation. I use a diff probe as the signal is not common to the rest of the setup so ground shound therefore be ok. It might be some offset issue with that probe to be introduced but for now it is ok.
My next issue now is to be able to calculate the amount of pulses having this energy. I struggle a lot to be able to calc that in a good way.
If you look at mye attached scope picture you see that in this case it calc this trigg almost correct (6 cycles) but it is actual 7, but in most cases this is even worse, 0, 1 etc
How do I do this calc exact? Each pulse is approx 50uS wide. Another way maye is to zoom inn on the 50uS signal and count the amount of trigg, but I have not found a good way of doing that eighter.
it could