A method of controlling the heating of food ingredients, the method comprising the steps of: - measuring the spectrum of energy absorption of the food ingredients in a given range of radio frequencies; - identifying, in said given range of radio frequencies, the radio frequency for which the food ingredients have the maximum energy absorption; and - applying an electrical field to the food ingredients, said electrical field having a radio frequency corresponding to said radio frequency for which the food ingredients have the maximum energy absorption, wherein said step of measuring comprises, for a plurality of selected radio frequencies in said given range of radio frequencies, the steps of: - applying an electrical field on the food ingredients having a radio frequency corresponding to a given selected radio frequency in said plurality of selected radio frequencies; and, - measuring (1102, 1103) the ratio between the energy of the radio frequency electrical field reflected or absorbed from the food ingredients, and the energy of the radio frequency electrical field applied to the food ingredients, and wherein the plurality of selected radio frequencies are selected from said given range of radio frequencies by the steps of: - for each of said given range of radio frequencies, obtaining a penetration depth of an electrical field having a radio frequency corresponding to the given radio frequency into the food ingredients, and - including the given radio frequency into the plurality of selected radio frequencies if the penetration depth of the electrical field having a radio frequency corresponding to the given radio frequency is equal to or larger than the thickness of the food ingredients in the direction of the electrical field applied to the food ingredients. - measuring the spectrum of energy absorption of the food ingredients in a given range of radio frequencies; - identifying, in said given range of radio frequencies, the radio frequency for which the food ingredients have the maximum energy absorption; and - applying an electrical field to the food ingredients, said electrical field having a radio frequency corresponding to said radio frequency for which the food ingredients have the maximum energy absorption, - applying an electrical field on the food ingredients having a radio frequency corresponding to a given selected radio frequency in said plurality of selected radio frequencies; and, - measuring (1102, 1103) the ratio between the energy of the radio frequency electrical field reflected or absorbed from the food ingredients, and the energy of the radio frequency electrical field applied to the food ingredients, - for each of said given range of radio frequencies, obtaining a penetration depth of an electrical field having a radio frequency corresponding to the given radio frequency into the food ingredients, and - including the given radio frequency into the plurality of selected radio frequencies if the penetration depth of the electrical field having a radio frequency corresponding to the given radio frequency is equal to or larger than the thickness of the food ingredients in the direction of the electrical field applied to the food ingredients.