A computing device includes a memory configured to store instructions. The computing device also includes a processor to execute the instructions to perform operations that include providing an alternating electrical signal to a patient through at least a pair of electrodes, and determining transthoracic impedance of the patient from a measurement associated with the applied alternating electrical signal. Operations also include identifying, from the transthoracic impedance, a sequence of resistance values for controlling the discharge of a charge storage device located external to the patient, and controlling the discharge of the charge storage device using the identified sequence of resistance values.