Patent ID: 7734673

Claim:
An automatic control device, comprising input means for inputting samples comprising measured values of cyclic voltage and/or current; computing means for computing a parameter on the basis of said samples, and for comparing the computed parameter to a predefined condition; and initiating means for initiating a control function in response to the parameter meeting the predefined condition; said input means being arranged to input a predefined number N of samples per one cycle; and said predefined number N being a power of two; said computing means being arranged to compute the parameter with a discrete Fourier transform algorithm optimized on the basis of fixed coefficients that correspond to said predefined number N of samples per cycle, the optimization on the basis of fixed coefficients comprising: determining for the discrete Fourier transform algorithm a group of discrete values each discrete value being a result of multiplication with a coefficient that varies according to a sine or cosine function of an integer value multiplied with a quotient of full cycle and said predefined number N of samples per one cycle, the integer value ranging up to the predefined number N of samples per one cycle; determining zero coefficients that by the choice of said predefined number N of samples per one cycle fix to zero; determining multiplication coefficients the value of which by the choice of said predefined number N of samples per one cycle fix to 1 or −1; eliminating calculations involving zero coefficients; and replacing calculations involving multiplication coefficients by use of corresponding minus and plus signs.