Compensation for current ripple of drive or transducer