1. A method for performing a frequency analysis of an AC voltage signal, 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 a frequency based on the obtained sequence of sampling values, the subset of sampling values and the altered portion of the sampling values.