Open access peer-reviewed chapter

# Parallel Iteration Method for Frequency Estimation Using Trigonometric Decomposition

By He Wen, Junhao Zhang, Radek Martinek, Petr Bilik and Zidek Jan

Reviewed: November 9th 2016Published: February 1st 2017

DOI: 10.5772/66778

## Abstract

The parallel iteration method for frequency estimation based on trigonometric decomposition is presented. First, the multi-frequency signal can be expressed in a matrix form based on the trigonometric decomposition, which implies a possibility to solve the nonlinear mapping functions of frequency estimation by a parallel iteration procedure. Then, frequency estimation with the minimized square errors is achieved by using the gradient-descent method in the parallel iteration procedure, which can effectively restrain the interferences from harmonics and noise. Finally, the workflow is shown, and the efficiency of the proposed method was demonstrated through computer simulations and experiments.

### Keywords

• frequency estimation
• trigonometric decomposition
• parallel iteration
• signal processing

## 1. Introduction

With the widespread application of nonlinear loads such as uninterruptible power supply, electric arc furnaces, and other power-electronic devices in power electronic systems, resulting power quality problems have drawn much attention. Frequency estimation is a very important issue in the power system because of the need for an assessment of the power quality [1, 2]. In addition, the frequency of a distribution network can extremely vary during transient events, and it can be very difficult to track the frequency with enough accuracy .

In the past years, various methods have been presented to estimate the power system frequency [4, 5]. The DFT-based methods provide a nonparametric approach and require a low computational effort . Unfortunately, they have inherent limitations due to the picket fence and spectral leakage effects caused by the noncoherent sampling. Since the system fundamental frequency may deviate from its nominal value because of the power mismatch between the generation and load demands, it is almost impossible to achieve the strict coherent sampling and thus some degree of spectral leakage cannot be avoided. A commonly used frequency estimation methods to compensate both spectral leakage and picket fence effects are the so-called windowed interpolated FFT (WIFFT) method . However, the WIFFT can only reduce, but not completely remove, the estimation errors at the cost of an increment in the computation burden of the frequency estimation.

Other popular frequency estimation methods include the zero-crossing technique, Kalman filter, least-squares method, and artificial neural networks, which are characterized by high resolution. However, they may either suffer from low accuracy or less computational efficiency . For example, the Prony method can provide high-accuracy frequency estimates when the model order is known; however, the determination of the model order is often a difficult task, which requires intensive computational algorithms .

Trigonometric decomposition is a well-known technique for determine different frequency components of periodic signals. According to the Fourier analysis, general functions or signals may be represented or approximated by sums of simpler trigonometric functions. So, it is relatively easy to estimate the frequency of a pure sine-wave by trigonometric decomposition. However, estimating frequency of a real signal distorted by harmonics and noise is much more difficult. This is because the frequency estimation errors due to the interference from the harmonics and noise remain significant in trigonometric decomposition, especially when the number of acquired signal cycles is very small. To reduce the frequency estimation errors, an iteration procedure can be applied in trigonometric decomposition; however, the computation would much more complex than the fast Fourier transform. For real-time processing requirements, most of the aforementioned methods offer a tradeoff between accuracy and speed . Therefore, seeking efficient methods to estimate power system frequency for power-quality assessment and solutions has been a significant challenge.

This chapter proposes a parallel iteration method for frequency estimation based on trigonometric decomposition. According to the theory of trigonometric decomposition, a multifrequency signal can be expressed using matrix algebra, which provides a base for the parallel iteration to solve the nonlinear mapping functions of frequency estimation. By using the gradient-descent method in the iteration procedure, the frequency is estimated with the minimized square errors and thus the interferences from harmonics and noise can effectively be restrained. The organization of this chapter is as follows: in Section 2, the proposed method is presented. Simulation and experiment results are provided in Section 3, and the conclusion is made in Section 4.

## 2. Proposed frequency estimation method

### 2.1. Trigonometric decomposition of periodic signal

Let us consider a multifrequency electrical waveform x(n) sampled at a known frequency fs, i.e.,

x(n)=U0+h=1HUhsin(2πhfn/fs+φh)E1

where n = 0,1,…, N − 1; f is the fundamental frequency, H is the number of frequency components, Uh and φh are, respectively, the amplitude and phase of the hth component, U0 is the offset, and N is the acquisition length. To satisfy the Nyquist criterion, the frequency of the Hth harmonic is assumed to be smaller than fs/2.

By applying trigonometric decomposition, it can be rewritten Eq. (1) as follow:

x(n)=U0+h=1H[Uhsinφhcos(2πhfn/fs)+Uhcosφhsin(2πhfn/fs)]E2

For the sake of simplicity, the ah and bh can be used to represent Uhsin φh and Uhsin φh, respectively, i.e.,

ah=Uhsinφh and bh=UhcosφhE3

So, Eq. (1) can be expressed as

x(n)=U0+h=1H[ahcos(2πhfn/fs)+bhsin(2πhfn/fs)]E4

By using the matrix operation, Eq. (4) can also be written as

X=ZD+AC+BSE5

where X = [x(1), x(2),…, x(N)] denotes the vector of the sampled signal, Z = U0, D = [11,12,…, 1N], A = [a1,a2,…, aH], B = [b1, b2, …, bH],

C=[cos(η)cos(2η)cos(Nη)cos(2η)cos(4η)cos(2Nη)cos(Hη)cos(H2η)cos(HNη)]E6

and

S=[sin(η)sin(2η)sin(Nη)sin(2η)sin(4η)sin(2Nη)sin(Hη)sin(H2η)sin(HNη)]E7

with η = 2πf/fs.

### 2.2. Parallel iteration algorithm

From Eq. (5), the frequency estimation for each component can be regarded as a nonlinear mapping problem through N samples, which can be defined as

f=Fm(X,Z,D,A,C,B,S)E8

where Fm is the nonlinear mapping functions for the fundamental frequency. The solution procedure for detecting the fundamental frequency of Eq. (8) is not easy. This is because it is difficult to determine the nonlinear mapping functions Fm, which should be implicit function. It has been noticed that the iteration is one of the approaches developed to solve the nonlinear mapping problem. In the following, the procedure with parallel iteration for solving the nonlinear mapping functions Fm of Eq. (8) with a fast convergence is proposed.

Suppose Y = [y(1), y(2),…, y(N)] denote the vector of the estimated signal. According to the least-squares method, the estimated frequency fe should be the one that minimizes the square error, which can be expressed as

fe=argmin[E2]=argmin[(XY)(XY)T]E9

where (•)T denotes the transpose operation.

By using the gradient-descent method, a group of equations can be obtained by setting each partial derivative of E2 equal to zero. Then, the parallel iteration equations can be obtained as following,

{f(k+1)=f(k)λE(k)f(k)=f(k)+γE(k)fs(ψ.*C(k)TB(k)Tψ.*S(k)TA(k)T)Z(k+1)=Z(k)λE(k)Zk=Z(k)+λE(k)DTA(k+1)=A(k)λE(k)Ak=A(k)+λE(k)CTB(k+1)=B(k)λEB(k)=B(k)+λE(k)STE10

where * denotes the element-by-element multiplication; γ = 2/U12 and λ are the descent coefficients, ψ is a matrix of constants

ψ=[12N242NH2HHN]E11

### 2.3. Convergence of parallel iteration procedure

From Eq. (9), the Lyapunov function can be defined as

Jk=12E(k)2E12

and the gradient can be calculated by

ΔJk=12E(k+1)212E(k)2E13

where ||•||2 denotes the square of the F-norm.

By using the Taylor expansion, the E(k+1) can be rewritten as

E(k+1)=E(k)+ΔZkE(k)Zk+ΔAkE(k)Ak+ΔBkE(k)BkE14

where the partial derivatives can be calculated as

{ΛkZk=DΛkAk=CΛkBk=SE15

By using Eq. (9), Eq. (14) can be expressed as

E(k+1)=E(k)[Iλ(DTD+CTC+STS)]E16

where I is an identity matrix. By substituting Eq. (16) into Eq. (13), the gradient can be expressed as

ΔJk=12E(k)2[Iλ(DTD+CTC+STS)21]E17

According to the triangle inequality of the matrix norm, the following inequality can be obtained

Iλ(DTD+CTC+STS)2(Iλ(DTD+CTC+STS))2=12λDTD+CTC+STS+λ2DTD+CTC+STS2E18

Substitute Eq. (17) into Eq. (18), one can obtain

ΔJk12E(k)2DTD+CTC+STS(2+λDTD+CTC+STS)E19

In Eq. (19), considering the ||E(k)||2||DTD + CTC + STS|| ≥ 0, to guarantee the convergence of the parallel iteration procedure, i.e., ΔJk < 0, it is required to hold the following condition

2+λDTD+CTC+STS<0E20

That is to say the convergence of parallel iteration procedure can be guaranteed if λ satisfy the following condition

0<λ<2/DTD+CTC+STSFE21

where ||•||F denotes the F-norm.

### 2.4. Workflow of the proposed method

Figure 1 shows the workflow of the parallel iteration method for frequency estimation using trigonometric decomposition, where ε denotes the tolerance. The major steps are as follows: Figure 1.Workflow of the parallel iteration method for frequency estimation using trigonometric decomposition.
1. Initialize the parallel iteration parameters. Set the initial frequency f to be 50 Hz, the initial value of both A and B to be random values within the range (0–1), the initial value of Z to be zero.

2. Calculate the iteration values of C, S, Y, E based on Eqs. (5)–(7).

3. Update iteration values by using Eq. (10).

4. Check if the early-stopping constraint, i.e., E(k+1)<E(k), is met. If not, adjust the λ and return to step (1).

5. Check if the stopping constraint, i.e. E < ε, is met. If not, return to step (3). If yes, keep the value of fe and output.

It is worth mentioning that the early stopping constraint is to guarantee that the error differences between two iterations are decreasing.

## 3. Simulation and experimental results

To evaluate the performances of the proposed algorithm, we perform a series of simulations on an electrical power signal with and without white noise in this section. To make comparisons, the WIFFT algorithm and discrete phase difference correction (DPDC) algorithm  based on the Hanning window (HNW), 3-term Max decay window (MDW), and the proposed method are adopted. At last, the proposed algorithm is evaluated by practical measurements.

### 3.1. Comparison with other algorithms without noise

An electrical power signal with 11 orders of harmonics, whose amplitudes are actually measured in an electric power network, is analyzed. This signal model is also used in Ref.  and can be expressed as

x(n)=h=111Ahsin(2πhfn+φh)E22

where the fundamental frequency f is set as 50.2 Hz, the sampling frequency is 3200 Hz, the amplitude Ah and the phase φh of each harmonic component are given in Table 1.

h1234567891011
Ah (V)2400.1120.12.70.052.100.300.6
φh (°)010203040506080100

### Table 1.

Parameters of each harmonic component of signal (22).

The WIFFT and DPDC algorithms and the proposed method are adopted to make a comparison. The absolute errors of fundamental and harmonic frequencies by using different algorithms are listed in Table 2, where aE-b represents a × 10b.

h1234567911
WIFFTHNW7E-51E12E-31E-11E-35E-24E-49E-49E-5
MDW1E-61E-13E-58E-31E-51E-22E-54E-57E-6
DPDCHNW2E-46E12E-38E-17E-39E-15E-48E-34E-3
MDW3E-64E-12E-57E-21E-57E-22E-51E-68E-6
Proposed3E-113E-113E-113E-113E-113E-113E-113E-113E-11

### Table 2.

Absolute errors of fundamental and harmonic frequencies by using different algorithms.

Table 2 shows that the accuracy of frequency estimation obtained by the proposed method is higher than those obtained by the WIFFT and DPDC algorithms.

### 3.2. With white Gaussian noise

To analyze the influence of white noise, the signal is superposed with zero-mean Gaussian noise. For each SNR value 3000 runs are performed by using N = 512 samples.

The estimation variances of fundamental frequency by using different algorithms are listed in Table 3. From Table 3, it can be seen that the proposed method can achieve the lowest variances of frequency estimation among all the four adopted algorithms making it to be a good choice for high accurate frequency estimation.

SNRWIFFT
HNW
WIFFT
MDW
DPDC
HNW
DPDC
MDW
Proposed
20 dB3E-86E-81E-83E-89E-9
30 dB3E-96E-91E-93E-99E-10
40 dB3E-106E-101E-103E-109E-11
50 dB3E-114E-111E-113E-119E-12
60 dB4E-126E-121E-123E-129E-13
70 dB4E-136E-131E-133E-138E-14
80 dB4E-146E-142E-143E-149E-15

### Table 3.

Estimation variances of fundamental frequency by using different algorithms with white noise.

### 3.3. With frequency varying

In addition, the signal is simulated with SNR = 40 dB and frequency varying from 48.5 and 51.5 Hz to investigate the influences of both the white noise and frequency variations on frequency estimation.

The biases of frequency estimation by using different algorithms with frequency variations and SNR = 40 dB are listed in Table 4. As shown in Table 4, the biases of the frequency estimation obtained by the proposed method are 1–2 orders of magnitude lower than those obtained by the adopted WIFFT and DPDC algorithm.

f/HzWIFFT
HNW
WIFFT
MDW
DPDC
HNW
DPDC
MDW
Proposed
48.5-8E-52E-67E-31E-4-1E-6
49.0-4E-41E-56E-39E-5-5E-7
49.5-7E-41E-53E-34E-51E-6
50.0-7E-42E-57E-67E-52E-6
50.5-5E-41E-52E-43E-63E-7
51.0-2E-41E-61E-32E-51E-6
51.58E-52E-64E-35E-52E-6

### Table 4.

Biases of fundamental frequency estimation by using different algorithms with frequency variations and SNR = 40 dB.

### 3.4. Experimental results

The experiments are carried out by using the electrical power standard HBS1030, the data acquisition system ELVIS II of National Instrument. The measurement scheme is depicted in Figure 2. Figure 2.Measurement scheme for the laboratory experiment of the proposed method.

As shown in Figure 2, the electrical power standard HBS1030 is used to generate multisine waves with the accuracy 0.05%. The signal is sampled by the data acquisition system ELVIS II with 16-bit analog-to-digital (A/D) converter. The sampling frequency is set as 3.2 kHz. The measurement results of the fundamental frequency are shown in Table 5, where the “true” values for calculating the measurement absolute errors are provided by the electrical power standard HBS1030. The experimental results demonstrate that the presented algorithms have high accuracy in practice.

 f 49.1 49.2 49.3 49.4 49.5 49.6 49.7 49.8 49.9 Error 0.0004 0.0003 0.0002 0.0003 0.0002 0.0001 0.0002 0.0002 0.0001 f 50.1 50.2 50.3 50.4 50.5 50.6 50.7 50.8 50.9 Error 0.0001 0.0001 0.0002 0.0003 0.0003 0.0003 0.0003 0.0004 0.0004

### Table 5.

Absolute errors of frequency estimation by experiments.

## 4. Conclusion

Since frequency estimation errors caused by harmonic interference and noise remain significant when the number of acquired signal cycles is very small, this chapter presents a parallel iteration method for frequency estimation using trigonometric decomposition. Due to the nature of trigonometric decomposition of periodic signal, the parallel iteration can be effectively executed to solve the nonlinear mapping functions of frequency estimation with a fast convergence. Additionally, the minimized square errors can be achieved by using the gradient-descent method in the iteration procedure. By observing the simulation and experimental results, it is seen that the proposed method is more accurate than the WIFFT and DPDC in comparisons.

## Acknowledgments

This work has partially been supported by the National Natural Science Foundation of China under grant 61370014.

chapter PDF
Citations in RIS format
Citations in bibtex format

## More

© 2017 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

## How to cite and reference

### Cite this chapter Copy to clipboard

He Wen, Junhao Zhang, Radek Martinek, Petr Bilik and Zidek Jan (February 1st 2017). Parallel Iteration Method for Frequency Estimation Using Trigonometric Decomposition, Proceedings of the 2nd Czech-China Scientific Conference 2016, Jaromir Gottvald and Petr Praus, IntechOpen, DOI: 10.5772/66778. Available from:

### Related Content

#### Proceedings of the 2nd Czech-China Scientific Conference 2016

Edited by Jaromir Gottvald

Next chapter

#### Use of Regression Analysis to Determine the Model of Lighting Control in Smart Home with Implementation of KNX Technology

By Jan Vanus, Radek Martinek, Petr Bilik, Jan Zidek and He Wen

#### Proceedings of the 3rd Czech-China Scientific Conference 2017

Edited by Jaromir Gottvald

First chapter

#### Traffic Management by Admission Control in IMS Networks

By Ivan Baroňák, Michal Čuba, Chien-Ming Chen and Ladislav Beháň

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

View all Books