A Generalized Algorithm to Eliminate Spikes of Common-Mode Voltages for CMVRPWM