A motor control device comprising: a power converter that is controlled by a pulse width modulation signal; a motor that is driven by the power converter; and a controller that generates the pulse width modulation signal, based on a carrier signal, wherein when switching between a first carrier frequency of the carrier signal and a second carrier frequency of the carrier signal, the controller varies proportions of the first carrier frequency and the second carrier frequency in accordance with a number of rotations of the motor, the second carrier frequency being higher than the first carrier frequency, characterised in that the controller decreases the proportion of the first carrier frequency and increases the proportion of the second carrier frequency as the number of rotations of the motor increases, when the number of rotations of the motor is smaller than or equal to a predetermined first number of rotations, the proportion of the first carrier frequency is set to 100%, and the proportion of the second frequency is set to 0%, when the number of rotations of the motor is equal to or larger than a predetermined second number of rotations that is higher than the first number of rotations of the motor, the proportion of the first carrier frequency is set to 0%, and the proportion of the second carrier frequency is set to 100%, when the number of rotations of the motor is equal to or larger than the first number of rotations and is smaller than or equal to the second number of rotations, the proportion of the first carrier frequency is decreased from 100% and the proportion of the second carrier frequency is increased by 0% as the number of rotations of the motor increases, when neither the first carrier frequency nor the second carrier frequency coincides with a mechanical natural frequency of the motor, the second carrier frequency is closer to the natural frequency than the first carrier frequency, and the frequency of the sideband of the carrier signal whose fundamental frequency is the second carrier frequency coincides with the natural frequency, the proportions of the first carrier frequency and the second carrier frequency are varied in accordance with the number of rotations of the motor. a power converter that is controlled by a pulse width modulation signal; a motor that is driven by the power converter; and a controller that generates the pulse width modulation signal, based on a carrier signal, wherein when switching between a first carrier frequency of the carrier signal and a second carrier frequency of the carrier signal, the controller varies proportions of the first carrier frequency and the second carrier frequency in accordance with a number of rotations of the motor, the second carrier frequency being higher than the first carrier frequency, characterised in that the controller decreases the proportion of the first carrier frequency and increases the proportion of the second carrier frequency as the number of rotations of the motor increases, when the number of rotations of the motor is smaller than or equal to a predetermined first number of rotations, the proportion of the first carrier frequency is set to 100%, and the proportion of the second frequency is set to 0%, when the number of rotations of the motor is equal to or larger than a predetermined second number of rotations that is higher than the first number of rotations of the motor, the proportion of the first carrier frequency is set to 0%, and the proportion of the second carrier frequency is set to 100%, when the number of rotations of the motor is equal to or larger than the first number of rotations and is smaller than or equal to the second number of rotations, the proportion of the first carrier frequency is decreased from 100% and the proportion of the second carrier frequency is increased by 0% as the number of rotations of the motor increases, when neither the first carrier frequency nor the second carrier frequency coincides with a mechanical natural frequency of the motor, the second carrier frequency is closer to the natural frequency than the first carrier frequency, and the frequency of the sideband of the carrier signal whose fundamental frequency is the second carrier frequency coincides with the natural frequency, the proportions of the first carrier frequency and the second carrier frequency are varied in accordance with the number of rotations of the motor.