Method for controlling a converter configured so as to be connected to an electric machine by a cable (Cx) via a filter (F) connected to the output of the inverter , said cable (Cx) comprising at least two conductors and exhibiting an impedance and said filter being an LC filter and comprising at least one inductor (Lf) and one capacitor (Cf) for each conductor of the cable, said converter comprising at least two switching arms each comprising at least two power switches that are switched so as to chop a DC voltage having a value E in order to deliver at least two voltage levels, the controlling of a switching arm making it possible to generate voltage pulses on the output phase that is connected thereto, a voltage pulse potentially being an increasing voltage pulse and including a vertical voltage edge rising with an increment of non-zero duration to the value E or a decreasing voltage pulse and including a vertical voltage edge falling with an increment of non-zero duration to the value 0 V, said method being characterized in that it consists in determining at least one sequence of a plurality of voltage pulses forming a square wave signal to be applied to each conductor on each switching transition of the two power switches of one and the same switching arm, the two switches being controlled complementarily, so as to minimize an overvoltage level across the terminals of the electric machine (M), said sequence comprising a number 2N of successive pulses, N being greater than or equal to 1, each pulse being defined by a distinct rank n, said sequence being generated by replacing each rising edge and each falling edge of the voltage pulses generated at the chopping period of the DC voltage and such that each increasing voltage pulse of rank n exhibits a pulse width that is identical to that of a decreasing voltage pulse of rank equal to 2N+1-n, and in that it includes the following steps: - determining the number of successive pulses of said sequence; - determining the width of each pulse of the sequence made suitable for minimizing the overvoltage level across the terminals of the electric machine (M) while satisfying the following relationship: t N = t p + t r / 2 where: - t N corresponds to an instant in time of the end of the pulse of rank N; - t p corresponds to the propagation time of the cable; - t r corresponds to the rise time for the voltage (Vi) present at the input of the cable to reach 50% of said value E of the DC voltage; also characterized in that it includes a step of increasing the number of pulses in the sequence for as long as the obtained overvoltage level exceeds a threshold value. - determining the number of successive pulses of said sequence; - determining the width of each pulse of the sequence made suitable for minimizing the overvoltage level across the terminals of the electric machine (M) while satisfying the following relationship: t N = t p + t r / 2 where: - t N corresponds to an instant in time of the end of the pulse of rank N; - t p corresponds to the propagation time of the cable; - t r corresponds to the rise time for the voltage (Vi) present at the input of the cable to reach 50% of said value E of the DC voltage; - t N corresponds to an instant in time of the end of the pulse of rank N; - t p corresponds to the propagation time of the cable; - t r corresponds to the rise time for the voltage (Vi) present at the input of the cable to reach 50% of said value E of the DC voltage; <EOS>