i control solenoid valve using pwm generated by MCU , and i used op-amp with shunt resistor to measure the current in solenoid. i will read the output of the op-amp by the MCU but the output isn't constant because of pwm so i want to average the reading . what are available solutions here?