1. A method for calculating a frequency of an AC voltage signal using a conversion device, in particular in a power mains, comprising the steps of: determining an upper limit of the period length of a fundamental oscillation in the AC voltage signal, obtaining a sequence of sampling values of the AC voltage signal over a duration longer than the upper limit of the period length, thereby ensuring that more than a period of the fundamental oscillation is sampled, selecting from the sequence of sampling values a subset of sampling values, with the subset sampling substantially one period of the fundamental oscillation, altering at least a portion of the sampling values not included in the subset, and calculating the frequency based on the obtained sequence of sampling values, the subset of sampling values and the altered portion of the sampling values.