An analytical algorithm for Selective Harmonic Elimination and efficient control in five-level inverters