This work proposes a digital implementation concept for a synchronous optimal pulse width modulator (SOP) exemplarily used in a three-phase 5-level NPC H-bridge inverter driving a permanent magnet synchronous motor at variable speed. The numeric optimization is performed offline and the resulting information that defines the inverter output waveforms are stored in a look-up table. The real time portion of the modulator recomposes the pre-computed optimal waveforms and chooses the switching states that, both, synthesize the waveforms and perform voltage balance for the three bipolar dc-buses of the power converter. The proposed modulation algorithm main feature is that changes in the number of commutations per cycle are transparently handled without the need for the dynamic reconfiguration of the digital modulator, which makes it very suitable for synchronous modulation techniques in variable speed applications.