An algorithmic approach to space vector modulation for multiphase inverters