1. A method for converting mechanical energy from a generator operated by a turbine into electric energy to be inputted into an electric network, the method comprising the following steps: (A) supplying a power electronic converter connectable to an output of the generator and to an input of the electric network; (B) supplying an electrical power from the generator output to the power electronic converter; (C) adapting the electrical power using the power electronic converter to input the electrical power to the electric network by the following substeps: (C1) calculating a rotation speed of the turbine; (C2) calculating an estimated value of a wind speed moving the turbine; and (C3) calculating a reference rotation speed corresponding to a maximum energy of the turbine for the estimated wind speed using a Maximum Power Point Tracking algorithm; wherein substep (C1) is implemented by an algorithm carrying out a virtual encoder, and substep (C2) is implemented by training a neural network implementing a virtual anemometer; and wherein a virtual encoder, implemented by substep (C1), is obtained according to the further following substeps: (C1a) supplying an output voltage of generator to the power electronic converter, the output voltage having a residual ripple voltage component overlapping a DC voltage component; (C1b) increasing the DC voltage component of the output voltage to reach a constant value; (C1c) converting the constant value into a single-phase alternate voltage value for the connection with the electric network; (C1d) supplying a band-pass filter for selecting a fundamental frequency of the residual ripple voltage component; (C1e) evaluating a fundamental frequency of the fundamental frequency of the residual ripple voltage component by a zero-crossing algorithm; and (C1f) calculating the rotation speed of the turbine using the formula: ω T = f ripple · π 3 ⁢ p , wherein p is the number of polar pairs of the generator.