This presentation describes a torque harmonic compensation algorithm for wind turbine applications, where the presence of a converter managing the energy conversion can be also exploited for active compensation purposes. A general scenario is described first. The algorithm is then described with its mathematical background. A modification of the algorithm is proposed in order to overcome the problem of unknown phase shift between the variables to compensate and those steering the compensation. Simulations and experimental results prove the effectiveness of the solution.