The effect of the carrier sequences on the voltage spectrum of MCU(microcontroller)-based random-frequency pulse-width modulation (RFPWM) is presented. To optimise the carrier sequence efficiently, first all possible sequences are classified into groups according to the time-shift and time-reverse properties of the Fourier transform. Then, some evaluation indexes are proposed to obtain the optimal sequence quickly with the end of a personal computer (PC). Finally, some optimised carrier sequences with only two carrier frequencies are recommended. The experimental results also indicate that we should pay more attentions to the carrier sequences than to the selection of carrier frequency and on the numbers of carrier frequencies.