Efficient digital controller for active shielding circuits