State of charge estimation of LiFePO4 battery based on a gain-classifier observer