# Least-Squares Approach for Harmonic and Interharmonic Analysis in Power System

Hong Luo, Hui Xue

► To cite this version:

Hong Luo, Hui Xue. Least-Squares Approach for Harmonic and Interharmonic Analysis in Power System. 5th Computer and Computing Technologies in Agriculture (CCTA), Oct 2011, Beijing, China. pp.508-512, 10.1007/978-3-642-27281-3_57. hal-01351855

HAL Id: hal-01351855

https://inria.hal.science/hal-01351855

Submitted on 4 Aug 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Least-Squares Approach for harmonic and interharmonic analysis in power system

Hong Luo, Hui Xue

China Agricultural University, Beijing, China, 100083,
xue_huicn@yahoo.com.cn

**Abstract.** A new algorithm based on least-squares method for harmonic and interharmonic analysis is proposed. The approach employs least-squares method and is based on a linear prediction relation for multiple sinusoidal signals. It is shown that the method allows for accurate harmonic and interharmonic estimation with high frequency resolution. The approach is compared with that of DFT method and prony method.

**Keywords:** Least square, linear prediction, interharmonic, harmonic

## 1 Introduction

Harmonic/interharmonic measurement is an important function of a power quality analyzer widely used in monitoring the quality of power. The use of power electronic devices which increases the harmonic pollution in power system on the one hand and the widespread use of sensitive loads such as computers and microprocessor-based industrial controllers on the other hand signify the ever-increasing need for harmonic/interharmonic measurement devices. To monitor and maintain the power quality, there has been an increasing interest in devising harmonic/interharmonic measurement methods and devices over the last decade[1]-[2].

Discrete Fourier transform (DFT) has been widely used for spectral analysis of harmonics, however, DFT suffers from leakage and picket fence effect and suffers from the major problem of resolution because of some invalid assumptions (zero data or repetitive data outside the duration of observations) make in this method[3]-[4]. It is very important to develop better tools of interharmonic and harmonic estimation to avoid possible damages due to its influence.

This paper proposed a least square approach for harmonic and interharmonic analysis in power system. Least square is time-domain approach which has to do with the criterion for selecting a solution to the overdefined equations produced when more measurements than states are represented in the estimation problems[5], and has been widely used in power quality analysis. Tests show that this proposed approach can
give an accurate harmonic and interharmonic estimation with high frequency resolution, the test results are compared with DFT and Prony method.

## 2 The proposed algorithm

Suppose the power signal is represented

$$x_k = \sum_{i=1}^{L} A_i \cos(\omega_i t_k + \phi_i) \quad (1)$$

In [6], It has been shown that $x_k$ can be uniquely expressed as a linear combination of its previous 2L samples as follow.

$$x_k = -\sum_{i=1}^{L} a_i x_{k-i} \quad (2)$$

Where $a_i = a_{2L-i}$ (i=1, 2..L);

Then (2) can be expressed as follows

$$x_k = -\sum_{i=1}^{L} a_i [x_{k-i} + x_{k+i}] \quad (3)$$

Since

$$x_{k+1} + x_{k-1} = \sum_{i=1}^{L} 2 \cos \omega_i \Delta t A_i \cos(\omega_i t_k + \phi_i) \quad (4)$$

⋮

$$x_{k+L} + x_{k-L} = \sum_{i=1}^{L} 2 \cos \omega_i L \Delta t A_i \cos(\omega_i t_k + \phi_i)$$

From (1), (3) and (4) we obtain

$$\sum_{i=1}^{L} a_i 2 \cos i \omega_i \Delta t = -1 \quad (5)$$

Equation (5) can be expressed as follows

$$\sum_{i=1}^{L} a_i (e^{-j\omega_0 i \Delta t} + e^{j\omega_0 i \Delta t}) = -1 \quad (6)$$

Equation (6) can be expressed as follows

$$\sum_{i=0}^{2L} b_i e^{i\omega_0 i \Delta t} = 0 \quad (7)$$

Where $b_i = b_{2L-i} = a_{L-i}$, (i=0,1,..L-1) and $b_L = 1$. Then the positive phase angles of the roots of (7) are the frequencies of the sinusoidal. The parameter of $a_i$ can be obtained as follows. Since (3) can be expressed as following

$$X_{k0} = X_{k1} S \quad (8)$$
$$ \text{Where } X_{k0} = \begin{bmatrix} x_k \\ \vdots \\ x_{k+M} \end{bmatrix}, \quad S = [a_1, \dots, a_L]^T \text{ and} $$

$$ X_{k1} = \begin{bmatrix} x_{k-1} + x_{k+L} & \cdots & x_{k-L} + x_{k+L} \\ \vdots & \ddots & \vdots \\ x_{k+M-1} + x_{k+M+1} & \cdots & x_{k+M-L} + x_{k+M+L} \end{bmatrix}, $$

where the value of M is bigger than L, Then S can be solved using the least mean square method, that is

$$ S = X^{-} \bar{X}_{k0}, \qquad (9) $$

$$ \text{where } X_{k1}^{-} = (X_{k1}^{T} X_{k1})^{-1} X_{k1}^{T} $$

After the parameter $a_i$ obtained, the frequencies can be obtained using (7), and we can construct a matrix, denoted as E.

$$ E = \begin{bmatrix} e^{j\omega_1} & e^{j\omega_2} & \cdots & e^{j\omega_L} \\ e^{j2\omega_1} & e^{j2\omega_2} & \cdots & e^{j2\omega_L} \\ \vdots & \vdots & \ddots & \vdots \\ e^{jN\omega_1} & e^{jN\omega_2} & \cdots & e^{jN\omega_L} \end{bmatrix} \qquad (10) $$

Notice

$$ EA=Y \qquad (11) $$

$$ \text{Where } A = [A_1 e^{j\phi_1} \quad A_2 e^{j\phi_2} \quad \dots \quad A_L e^{j\phi_L}]^T, \quad Y = [x_1 \quad x_2 \quad \dots \quad x_N]^T. $$

Then the amplitude and phase angle can be calculated again using the least mean square method again as

$$ A = (E' E)^{-1} E' Y \qquad (12) $$

## 3 SIMULATION RESULTS

We investigate the performance of the proposed approach. Matlab is used to perform the simulations. The sample frequency is 3840Hz. And the data window length is 64 points, which is (1/60) second. The DFT, Prony and proposed method are compared for two cases.

Case 1: Suppose the test signal is as : \

$$ x(t) = \cos(2\pi f_1 t) + 0.2 \cos(2\pi f_2 t) + 0.2 \cos(2\pi f_3 t) $$

$$ \text{Where } f_1 = 60.2 \text{ Hz}, \quad f_2 = 90.3 \text{ Hz}, \quad f_3 = 180.6 \text{ Hz}. $$

There is a 0.2Hz frequency deviation of fundamental components, and the signal contains an 20% interharmonic with a frequency of 72Hz and a 20% 3rd harmonic component with a frequency of 180.6Hz. The measurement results using DFT, Prony
and LMS are given in Fig.1. Fig.1 shows that DFT cannot separate the three components, Prony can separate the different frequency components but the amplitude estimation is mistaken, LMS can not only separate the different components, but also can give an accurate estimation of the amplitude as shown in Fig.1. In fact the frequency resolution of LMS can be very high, another experiment is given as follows.

Case 2: The test signal is $x(t) = \cos(2\pi f_1 t) + 0.5 \cos(2\pi f_2 t)$

Where $f_1 = 60.2$ Hz, $f_2 = 64$ Hz.

There is a 0.2Hz frequency deviation in the fundamental frequency, and a 50% 64Hz interharmonic exists in the signal. The frequencies of the fundamental component and interharmonic frequency are near to each other which make it hard to separate them. The measurement results are given in Fig.2. Fig.2 shows that DFT and Prony cannot separate the two components because their frequencies are so near to each other, while the proposed LMS method can give an accurate estimation of these two components.

<figure><img src="image_2.png" /><figcaption>Fig.1 Spectra obtained. (a) DFT (b) Prony (c) LMS</figcaption></figure>

<figure><img src="image_3.png" /><figcaption>Fig.2 Spectra obtained. (a) DFT (b) Prony (c) LMS</figcaption></figure>
## 4 Conclusion

A new algorithm based on Least-squares method for harmonic and interharmonic analysis in power system was proposed in this paper. The algorithm uses the linear prediction model of the sinusoidal. Theoretical analysis and simulation experiments validate the proposed algorithm have high frequency resolution in harmonic and interharmonic analysis

## References

1. M. Joorabian, S.S. Mortazavi, A.A. Khayyami, "Harmonic estimation in a power system using a novel hybrid least squares-adaline method," Electric power systems research, vol. 79, no. 1, p. 107-116, (2009).

2. Z. Lu, T.Y.Ji, W.H. Tang, H. Wu, "Optimal harmonic estimation using a particle swarm optimizer," IEEE Transactions on Power Delivery, vol. 23 no.2, p.1166-1174, (2008).

3. A. A. Girgis, F. M. Ham, "A Quantitative Study of Pitfalls in the FFT", IEEE Transactions on Aerospace and Electronic Systems, AES-16, Issue 4 pp.434-439, (1980)

4. S. M. Kay, *Modern Spectral Estimation: Theory and Application*. Englewood Cliffs, NJ: Prentice-Hall, pp. 224-225, (1988)

5. A. G. Phadke and J. S. Thorp, *Synchronized phasor measurements and their applications*, New York: Springer, (2008).

6. Y.T.Chan, J.M.M.Lavoie, and J.B.Plant, "A parameter estimation approach to estimation of frequencies of sinusoidals," IEEE Trans. Acoust. Speech, Signal Process., vol. ASSP-29, no.2, pp. 214-219, Apr. (1981)