A Method for Battery Impedance Analysis