A method of operating a wind turbine comprising a voltage converter, the voltage converter being connectable to a power grid via a filter arrangement and at least one inductor, the method comprising: - determining a line voltage at a coupling point between the filter arrangement and the power grid; - sampling the line voltage at regular time intervals to generate a sampling signal indicative of the line voltage; - calculating a cancellation voltage from a discrete transformation series comprising a linear combination of different voltage sample values of the sampling signal weighted by respective voltage sample weighting coefficients, wherein some of the voltage sample weighting coefficients respectively depend on an optimization parameter (t predict) which adjusts a time delay with which the determined line voltage is applied to an output voltage signal (Uv) of the voltage converter; - generating a cancellation voltage signal indicative of the calculated cancellation voltage; - generating a pulse-width modulated signal (SPWM) that includes the cancellation voltage signal with the time delay; - modifying the output voltage signal (Uv) with the pulse-width modulated signal (SPWM) such that the cancellation voltage signal is added to the output voltage signal (Uv); - outputting a converter output current signal corresponding to the modified output voltage signal (Uv), the converter output current signal comprising a damping current that produces a damping effect of a fictive resistor (R CAP,fictif), which depends on an inductance value of the at least one inductor and the optimization parameter (t predict), and is connected in parallel with the filter arrangement; wherein the optimization parameter (t predict) is determined by adjusting the time delay in a simulation based on the discrete transformation series, until simulated resonant effects occurring at the filter arrangement are decreased. - determining a line voltage at a coupling point between the filter arrangement and the power grid; - sampling the line voltage at regular time intervals to generate a sampling signal indicative of the line voltage; - calculating a cancellation voltage from a discrete transformation series comprising a linear combination of different voltage sample values of the sampling signal weighted by respective voltage sample weighting coefficients, wherein some of the voltage sample weighting coefficients respectively depend on an optimization parameter (t predict) which adjusts a time delay with which the determined line voltage is applied to an output voltage signal (Uv) of the voltage converter; - generating a cancellation voltage signal indicative of the calculated cancellation voltage; - generating a pulse-width modulated signal (SPWM) that includes the cancellation voltage signal with the time delay; - modifying the output voltage signal (Uv) with the pulse-width modulated signal (SPWM) such that the cancellation voltage signal is added to the output voltage signal (Uv); - outputting a converter output current signal corresponding to the modified output voltage signal (Uv), the converter output current signal comprising a damping current that produces a damping effect of a fictive resistor (R CAP,fictif), which depends on an inductance value of the at least one inductor and the optimization parameter (t predict), and is connected in parallel with the filter arrangement;