You are on page 1of 7

IEEE: Transactions on Power Delivery, Vol. 12, No.

1, January 1997

157

Frequency Estimation by Demodulation of Two Complex Signals


Magnus Akke
Sydkraft AB S-205 09 Malmo Sweden
The typical use of frequency estimation in power systems is for protection scheme against loss of synchronism [lo], under-frequency relaying and for power system stabilisation [5]. Frequency estimation in power system has evolved along several paths. Some are Change of angle for phasor measurements [11
0

Abstract
This paper presents a method for frequency estimation in power system by demodulation of two complex signals. In power system analysis, the @transform is used to convert three phase quantities to a complex quantity where the real part is the in-phase component and the imaginary part is the quadrature component. This complex signal is demodulated with a known complex phasor rotating in opposite direction to the input. The advantage of this method is that the demodulation does not introduce a double frequency component. For signals with high signal to noise ratio, the filtering demand for the double frequency component can often limit the speed of Ihe frequency estimator. Hence, the method can improve fast frequency estimation of signals with good noise properties. The method looses its benefits for noisy signals, where the filter design is governed by the demand to filter harmonics and white noise. The method has been previously published, but not explored to its potential. The paper presents four examples to illustrate the strengths and weaknesses of the method.

Kalman filters [ 2 ] Zero crossing and modification thereof [31 Demodulation with fixed frequency [ 3 ] , [4]

Demodulation with varying frequency. A feedback loop controls the frequency, i.e., a phase locked loop (PLL). This has been used in [5]. Estimation using identification theory, such as recursive least squares, least mean squares, see [6].
0 Numerical optimisation. A Newton type method has been used in [9].

The applications can be categorised based on their time demand, that is, critical real time applications, such as relay protection;
0

1. Introduction
Fast and accurate frequency estimation in presence of noise is a challenging problem that has attracted a lot of attention. Many solutions have been suggested, both in signal processing and in power system publications. Che 3per computational power has boosted the use of mor12 refined signal processing methods. A new research area, known as time-frequency signal analysis, has emerged and is discussed in [7], [8]. This area deals with instantaneous frequency estimation and is, to some extent, also applicable to power system frequency estimation.

on-line data monitoring in control room; off-line data analysis of computer recordings.

The classification is useful since the different time demands put restrictions on what type of frequency estimator and filter technique that can be used. In off-line data analysis we have access to the full time series and the estimation and filtering can be improved by using noncausal forward-backward filtering. The term causal is explained in [ 111, but basically it means that only samples at and before time k can be used to calculate the output at time k. For example, the relation y(k)=u(k)-u(k- 1) is causal, whereas y(k)=u(k+l)-u(k-1) is non-causal. To compare different methods we need a test criterion that reflects relevant demands. Three such demands are: speed of convergence; accuracy; and noise rejection. The key problem is to find a method that improves all these demands and not just compromise one demand for another.

96 Shrl379-8 PWRD A paper recommended and approved by the IEEE Power System Relaying Committee of the IEEE Power Engineering Society for presentationat the 1996 IEEWPES Summer Meeting, July 28 - August I, 1996, in Denver, Colorado. Manuscript submitted December 28, 1!395; made available for printing May 21, 1996.

0885-8977/97/$10.000 1996 IEEE

158

The key points of this paper are; To show that the proposed demodulation method does not introduce a double frequency component.

expected for monitoring of real time power dynamics. Further improvements are possible with thorough analysis of the filtering options of the demodulation method. This motivates that demodulation is a promising method for frequency estimation. We also stress that the filtering of the double frequency component in demodulation needs thorough analysis and can very well be the limiting factor of demodulation. This is also reflected in [IO] where a large part of the paper describes alternative designs of these filters.

To point out the strengths with this method and also to show some limitations. To give four illustrative examples. To discuss the use of the method for frequency estimation in power system.

2. Demodulation
Traditional demodulation as in reference [3], [4], [lo] introduces a double frequency component that needs to be filtered away. For signals with low noise, the filter to reduce the double frequency component can often limit the speed of the frequency estimation algorithm. The purpose of this section is to show that the proposed method eliminates this problem. If other filters are the bottle-neck of the estimation algorithm, we will not capitalise on the benefits.

Traditional demodulation The idea of traditional demodulation is to multiply the scalar input with a sine and cosine signal-that can be interpreted as a complex exponential-with a known frequency. The method is shown in Figure 1 where the notation tk is used for tk=k,At.
v,(k) = A , sin(w,t,

New demodulation of two complex signals Reference [5] suggests frequency estimation by a phase locked loop (PLL) If this scheme IS analysed it is found that the scheme does not introduce any double frequency component. This is not evident at a first glance and it is easy to miss this fact. Even though it is specifically written in the paper [5], Multiplication of this phasor times the rotating space phasor up gives the so-called stationary phasor US which pulses at the frequency difference of up and 5. Few readers have noticed the cleverness of the scheme and the importance of this message. Consequently, the filter design in the same paper only aims at harmonic reduction, not to remove the double frequency since it is not there.
The idea to multiply two complex signals bears resemblance with single side band modulation, see p.685-686 in the textbook [ l l ] . We adopt the notations of [3] and assume discrete signals that have passed anti-aliasing filters. Consider vl(k), vz(k), y ( k ) to be samples of the three phase voltages
n

+I
sln(wOtk)

+ 4)

+$I}

v,(k) = A, sin(wl tk +$,)+e,(k) i = 1, 2, 3 (1) where e, is a general noise term that can be any combination of white noise and harmonics. The a,P-components are defined as the complex voltage V(k) = V,(k)+jVp(k) where the real and imaginary parts are calculated from

c0s(w0tk) Figure 1. Normal demodulation (correlation).

The resulting signal has two parts, V, and V,, that each contains two components of different frequency. One component of the frequency difference and one with the sum. The signal is then low-pass filtered, or band-stop filtered, to reduce the double frequency component. The remaining component in V, and V, is used to estimate the unknown frequency. More details about demodulation and aspects on filter design are given in [3, 4, lo]. We focus on two recent publications [lo], [3] from the years 1992 and 1994 respectively. The first paper [lo] describes a study to find a frequency estimation algorithm that could be used for the Electricit6 de Frances defence plan against loss of synchronism. An extensive study of different algorithms was done. The final choice of algorithm was demodulation with a fixed filter to reduce harmonics and an adaptive filter to remove the double frequency component of demodulation. The paper [3] concludes that frequency estimation by demodulation is capable of transient performance

(2)

(3)
In the literature, the complete transformation is often

called the ap0-transform and then also includes the zero sequence component. In our application we only use the two perpendicular parts, a and p, and therefore leave out the zero sequence component in our transformation. Note that V, and Vp can contain plus and minus sequence voltage, but not any zero sequence component. Hence, harmonics that are mainly zero sequence-such as the third harmonic-are blocked by the aptransformation.

159

To make the analysis straightforward we first assume that the input voltages VI, v2, v3 do not have any negative sequence voltage nor any noise. We then have

The unknown frequency for the signal V is estimated as

V(k) = A[cos(w,t, +$I+ jsin(w,t, +$I] - A ej(wltk+@)


where A is the phase to phase RMS-value.

( 4 )

where fo is the nominal, and f, is the sampling frequency. Typical use of this demodulation is for frequency estimation by demodulation with a fixed frequency or by a PLL where the demodulation frequency is controlled by feedback.

The demodulation is done with a complex signal Z , that rotates in the opposite direction, i.e., negative sequence, compared to the input signal V.

V(k) = A&(mltk+$)

Z(k) = e-joOtk

3. Demodulation Examples
The purpose of this section is to give examples to illustrate the strengths and weakness of the proposed method. The used examples are: 1. Step in frequency under ideal noise conditions; no noise, no negative sequence, no additional filters are used.

Y(k) = Aej[(ol-wO)tk+~l

Figure 2. New demodulation of two complex signals.

The signal Z with a known frequency

is

Z(k) = cos(-o, t k ) + jsin(-motk) =e-Jootk. (5) The resulting signal, Y, after the multiplication becomes
tk Y(k) = V(k). Z(k) = A $@I tk+@)e-jwO

2. Test signal from [3] with low noise; no negative sequence. No additional filters.
3. Test signal from [3], with medium white noise, 3:rd harmonics, 5:th harmonics and negative sequence. Additional filters that are causal.

- A ej[(ol-wO)tk+@]
jsin[(w, -w,)t,+~]). (6) Note that the demodulation does not create the double frequency component. Hence, the demodulation does not add demands to filter away the double frequency component. However, there still might be a need to filter due to noise. The frequency estimation is done as in [3]. To find the phase difference, we define the complex variable U as
= A(cos[(w, -w,>t,+$]+

4. Same test signal as 3) but filters that are non-causal.


The program Matlab has been used for calculations. The code for Example 3 and 4 are given in Appendix A.

U(k) = Y (k) . Y (k - 1 7

(7)

where * stands for conjugate. We separate Y in real and imaginary part and find that
U( k) = Re[Y (k)] Re[Y (k - l)]+ Im[ Y (k)] Im[ Y(k - l)]

Example 1: Step in frequency under ideal conditions The test signals are three noise-free symmetrical phase voltages. There is a step change in frequency from 50 to 51 Hz at t=100 ms. This signal is unrealistic since power frequency can not change instantaneously. The test signal is only chosen to illustrate that, with a perfect symmetry and without any noise, the demodulation gives an exact frequency estimate within one sampling interval.
Figures 3-5 illustrate the new demodulation. Note the different time scales.
lmaglnsrypa" Dl v

+ j{ Im[Y( k)] Re[Y( k - l)] - Re[Y (k)] Im[Y( k - l)]}.

(8)

2,

Real pan af v

The phase difference y between two consecutive samples is calculated from the real and imaginary part of U.

(9)
I $1 I
015

I
01

The deviation in angular frequency is estimated from


" r y l

02 Time (E)
pa" 01

025

0.15

Time ($1
OlZ

02

025

Real pa,,

1 Am( k - 0.5) = -[y( At

k) - Y(k - l)] = f, [y(k) - y(k - l)] (10)

The time index k-0.5 is used to point out that the estimate is best in the middle of the time interval [k1, k] . For realtime application we are restricted to causal relations and get 1 (1 1) t [ y ( k ) - ~ ( -k 111= fs .[y(k) - ~ ( k111

Figure 3. Real and imaginary part of the complex input signal V and the demodulationsignal Z.

160
True freq.= Solid; Estimate=DashDot; SNR=80 dB

51.5

4 9 50

0:1

02 03 Time (s)

0:4

05

I
02

I
01 06 Time Is1
08

oz

04 05 T$mBla)

08

Figure 6. True and estimated frequency for SNRSO dB and no filtering of estimate.

Figure 4. Real and imaginary part of the demodulated signal Y as well as amplitude and phase of the same signal.
Estimated Frequency

Freq

This example illustrates that the algorithm works well for SNR above 80 dB. For lower signal to noise ratios the frequency estimate needs to be filtered. The two following examples show filtering in two alternative situations. Example 3 shows filtering for real-time applications, such as relay protection. Example 4 shows a filtering method that can be used for off line calculations, for example filtering of fault recordings.

Figure 5. Frequency estimate from the demodulated signal Y. No noise present, nor any negative sequence voltage.

Example 3: Test signal [3] with medium noise; causal filter. We consider the same type of test signal as in Example 2, but now distorted with
-Negative sequence of 1%; -white noise with SNR 40 dB; -3:rd harmonic, 5 %, mainly zero sequence; -5:th harmonic, 2 %, mainly negative sequence. Matlabs Signal Processing Toolbox was used to test various filters. The final choice was a 3:rd order low pass Butterworth filter with a cross over frequency of 20 Hz. The code is given in Appendix A. Figure 7 shows the true signal and the frequency estimate before filtering.
True freq.=Solid, Unfiltered estimate=DashDot, SNR=40 dB 60

From this example we see that under ideal conditions, we can nearly make an arbitrary fast frequency estimator. The only limitation is the analogue anti-aliasing filters.

Example 2: Test signal [3] and very low noise In this example we use the test signal from reference [3] The three phase voltages are
v, (k) = &Arms sin($, (k)) + N, (m, 6) i = 1,2,3 where the angles are calculated from
@i(k)=+,(k-l)+o(k)At;

for k 2 l

with the initial values

The frequency is time varying,

o(k) = 2 . ~ [ 5 + 0 sin(2 ..n.l. t k )+ 0.5,sin(2.7~ . 6 .tk)]. The notation N(m,o) is used for normally distributed white noise. In this example the standard deviation is 0=0.0001 and the mean m=O. The signal used has an RMS-value of 1 p.u. giving a signal to noise ratio of SNR = 20 log()=80dB. 0.0001

40

0.1

0.2 0.3 Time (s)

0.4

05

Figure 7. True and estimated frequency for SNR=40 dJ3 before filtering.

Figure 6 shows the simulation result, Note that no filtering has been used, neither before, nor after the frequency estimation.

Figure 8 shows the effect of the Butterworth filter.

161
51.5

True and filtered estimate; SNR=40 dB

The proposed demodulation can be made very fast for signals with high signal to noise ratio (SNR>80dB). The frequency estimate needs filtering when the S N R value falls below 80 dB. Causal filtering introduce a time delay. This is true also for filters such as Bessel with a maximal flat phase, that implies constant group delay. A constant (non-zero) group delay results in a fixed time delay.

49.5' 0

0.1

0.2

0.3

0.4

0.5

Time (s)

Figure 8. True and estimated frequency filtered in 3:rd order lowpass Butterworth filter with crossover frequency of 20 Hz. SNR=40 dB.

For off-line calculation we can use non-causal filters to reduce the time delay. This gives significant improvements.

4. Discussion
In frequency estimation by demodulation there is a need to filter signals for various reasons. If we exclude antialiasing filters, the most important reasons are reduction of white noise, harmonics and the double frequency component caused by the demodulation. The proposed method does not introduce the double frequency component. As a consequence, we do not need to filter for this specific reason. Therefore the proposed method will show its advantage for applications where the main concern of the filtering has been the double frequency component from the demodulation. In contrast, the new method will only give minor improvements for signals with a large content of white noise and harmonics that need a lot of filtering for these reasons.

We see that the filter has introduced a lag, so the estimate lags the true frequency by around 20 ms. A cross-over frequency of 20 Hz, still introduces some phase shift at lower frequencies. This can be seen in the Bode plot of the filter. For off-line applications where the raw data have been sampled and stored, it is possible to reduce the lag effect. This is shown by the next example.

Example 4: Same test signal as Example 3, but noncausal filter. In this example the full time series is used. The phase shift is reduced by applying forward filtering followed by backward filtering. The filtering is performed in the Matlab package by the command Jil@lt and is described in reference [12]. We use the same filters as for Example 3 and filters the estimate twice, first forward and then backward. The resulting sequence has precisely zerophase distortion and double the filter order. We get Figure 9 that shows significant improvements, except at the beginning and end, where initial transients from the filter show up.
51.5 True freq. = Solid; Filtered=DashDot;SNR=40 dB

Unsymmetric phase voltages The proposed method works excellent when the negative sequence component is small. If the input contains negative sequence, the demodulation introduce a double frequency component that is proportional to the negative sequence amplitude. This gives the same type of doubIe frequency component as the traditional demodulation method. Even though, for most cases our situation is better, because of the proportionality to the negative sequence, the amplitude of the double frequency component is small. However, at unsymmetrical faults the negative sequence component can be large. In these situation the proposed method will give a double frequency component with a large amplitude and will work similar to the old demodulation method. Discrete Hilbert transform filter The ab-transform is used to get the complex phasor representation of the three phase inputs. The real and imaginary parts have a phase difference of 90 degrees. An alternative way to achieve this is to use a discrete Hilbert transform filter, as suggested in [lo]. This filter can be designed to have 90 degrees phase shift and unity gain for the frequency band of interest. The drawback with a discrete Hilbert transform filter is that the filter introduces a time delay of half the filter length. An advantage is that we can use the three phasors independently and use the

0 Figure 9.

0.1

0.2

0.3

0.4

0.5

Time (s)

True and estimated frequency forward-backward filtered in 3:rd order low-pass Butterworth filter with crossover frequency of 20 Hz. SNR=4O dB.

These four examples show that:

162

mean value as a filtered estimate. In signal processing, the Hilbert transform plays a key role for frequency estimation, see [7], [8], [ I l l . It might be possible that improvements can be made by using a discrete Hilbert transform filter instead of the a@-transform. Yet another alternative is to use sine and cosine filters. Reference [ 131 has used this to divide a scalar input signal into two orthogonal components. The drawback with this method is that-in addition to the filter time delay-the two filter gains are equal only at the nominal frequency.

Acknowledgement
This work has been supported by a research grant from Sydkraft. I am also grateful for help from my supervisors S. Lindahl, Professor G. Olsson and L. Messing.

References
[1] A. G. Phadke, J. S. Thorp, M. G. Adamiak, "A New Measurement Technique for Tracing Voltage Phasors, Local System Frequency, and Rate of Change of Frequency", IEEE Trans. on Power Apparatus and Systems, Vol. PAS-102, No. 5, 1983, pp. 1025-1038. [2] A. A. Girgis, W. L. Peterson, "Adaptive Estimation of Power System Frequency Deviation and its Rate of Change for Calculating Sudden Power System Overloads", IEEE Trans. on Power Delivery, Vol. 5 , No. 2, April, 1990, pp. 585-594. [3] M. M. Begovic, P. M. Djuric, S. Dunlap, A. G. Phadke, "Frequency Tracking in Power Networks in the Presence of Harmonics", IEEE Trans. on Power Delivery, Vol. 8, No. 2, April, 1993, pp. 480-486. [4] A. G. Phadke et al, "Synchronized Sampling and Phasor Measurements for Relaying and Control", IEEE Trans. on Power Delivery, Vol. 9, No. 1, January, 1994, pp. 442-452.

Phased Locked Loop (PLL) The proposed demodulation method can also be applied to PLL as already done in [5]. In the design in [SI, four FIR filters of a total order of 130 were used inside the control loop. Filters inside the control loop puts an upper limit to PLL performance. From a control point of view it seems better to filter away harmonic and noise before the signal enters the PLL. Without any filters inside the PLL loop, the PLL can be made much faster without stability problems.
In our work we have not found any improvements by using PLL demodulation instead of demodulation with a fixed frequency.

5. Conclusion
Demodulation is a promising method for power system frequency estimation, but one drawback is that the demodulation itself, introduces a double frequency component that needs to be filtered. This paper has demonstrated a demodulation method that solve this problem. The method uses three phases as inputs and the ap-transform to convert these inputs to a complex vector with two orthogonal components. This vector is demodulated using a complex vector with known frequency, rotating in the opposite direction. The resulting signal does not contain the double frequency component. Hence, a filter for this specific purpose is not needed. Advantages with the proposed demodulation:

[5]V. Eckhardt, P. Hippe, G. Hosemann, "Dynamic


Measuring of Frequency and Frequency Oscillations in Multiphase Power Systems", IEEE Trans. on Power Delivery, Vol. 4, No. 1, January, 1989, pp. 95-102. [6] I. Kamwa, R. Grondin, "Fast Adaptive Schemes for Tracking Voltage Phasor and Local Frequency in Power Transmission and Distribution Systems", IEEE Trans. on Power Delivery, Vol. 7, No. 2, April, 1992, pp. 789-795. [7] B. Boashash, "Estimating and Interpreting The Instantaneous Frequency of a Signal - Part 1: Fundamentals", Proc. of IEEE, Vol. 80, No. 4, April, 1992, pp. 520-538.

* No need to filter the double frequency;


0

Can be made extremely fast for low noise signals

Disadvantages with the proposed demodulation


e The advantages are much reduced if the input signal contains a large negative sequence component, that might appear under fault conditions.

[SI B. Boashash, "Estimating and Interpreting The Instantaneous Frequency of a Signal - Part 2: Algorithms and Application", Proc. of IEEE, Vol. 80, No. 4, April, 1992, pp. 540-568.

* All three phases are used for one calculation. Other methods that use all the three phases independently, can use the mean value of the them as a filtered estimate.

163

[9] V. V. Terzija et al, "Voltage Phasor and Local System Frequency Estimation Using Newton Type Algorithm", Paper 94 WM 016-6 PWRD, IEEEPES 1994 Winter Meeting, New York, January 30 February 3, New York, 1994. Later published in IEEE Trans. on Power Delivery (T-PWRD), July, 1994. [lo] P. Denys, C. Counan, L. Hossenlopp, C. Holweck, "Measurement of Voltage Phase for the French Future Defence Plan Against Losses of Synchronism", IEEE Trans. on Power Delivery, Vol. 7, No. 1, Jan, 1992, pp. 62-69.
[ 111 A. V. Oppenheim, and R. W. Schafer, Discrete-Time

Epsilonl =zeros(size(t)); Epsilon2=zeros(size(t));

Epsilon3=zeros(size(t));
Epsilonl (1)=0; Epsilon2(1)=-125*@/I80; Epsilon3(1)=1I5 * p i 480; for k=2:length(t); Epsilonl(k)=rem(Epsilonl(k-l)-5*wl(k) *dt,2*pi): Epsilon2(k)=rem(Epsilon2(k-l)-5*wl (k)*dt,2*pi); Epsilon3(k)=rem(Epsilon3(k-I)-5 *wl(k)*dt,2 *pi); end qo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hurml =zeros(size(t));Hurm2=zeros(size(t)); Hurm3=zeros(si~e(t)); Hurml =O.O5*VI *sin(Gummul)+0.02*VI *sin(Epsilonl); Hurm2 =0.05*V2'Sin(Gummu2)+0.02*V2*sin(Epsilon2); Hurm3 =O. 05*V3*sin(Gumma3)+0.02 *V3*.~in(Epsil0?~3); % Phusors V I =VI *sin(TetuI)+Sigmu*rundn(size(t))+Hurml; v2=V2 *sin(Tetu2)+Sigmu*rundn(size(t))+HurmZ; v3= V3*sin(Tetu3)+Sigma*randn(size(t))+Hurm2; % Alpha Betu Components Alpha=sqrt(2/3)"(VI -0.5 *v2 -0.5 *v3); Betu =sqrt(lQ)*(v2 - v3); % Complex input signul V=Alpha+j*Betu; % Modulutiqn signul Z=cos(-2*piTfO *t)+j*sin(-2*pi?jO*t); % Demoduluted signul Y= v. *z; Im-Y=imug(Y); Re_Y=reul(Y); Amp-Y=sqrt(Re-Y. *Re-Y+lm-Y. *Im-Y); Pha_Y=utan2(lm_Y,Re_Y); % Create the signul U NN=length( Y); *Im-Y(I: NN-I)]; Re-U=[O Re-Y(2:NN). *Re-Y(l:NN-l)+Im-Y(2:NN). lm-U=[0 Im-YI2:NN). *Re-Y(I:NN-I)-Re-Y(2:NN). *Im-Y(I:NN-I)l;
70

Signal Processing, Prentice-Hall, Englewood Cliffs, New Jersey, USA, 1989.


[ 121 Matlab-Reference Guide, The Mathworks, Inc.,

Natick, Mass. [13] P. J. Moore, R. D. Carranza, A. T. Johns, "A New Numeric Technique for High-speed Evaluation of Power System Frequency", IEE Proc.-Gener. Transm. Distrib., Vol. 141, No. 5 , Sept, 1994, pp. 529-536.

Appendix
A. Matlab code for new demodulation
% % test qfcomplex demodulution % Ex 3 und 4 in paper ,ji=I000; % ( H z ) sumplingfrequency dt= 14r;

Sigmu=le-Z; % stundurd deviutionfiv noise j0=50; % Hz; V-rm.i=l.O; VI =,ryrt(2) *V-rms; Phil =0.3; V2=1.015 ' V I ; Phi2 =Phil -2 *pi/3; V3=1.015*VI; Phi3=Phil+2*pi/3;; SNR=2O*logI 0(V-rms/Sigmu); t=[0:dt:0.5]; . f l =(to) *ones(size(t))+ I *sin(2*pi3'1*t)+0. 5 *si42 *pi*6*t); wl=2*pi;y'l; %-------Angles,fi,r,fundumantul phusor quuntities---------Tetul =zeros(size(t)); Tetu2 =zeros(size(t)); Tetu3=zeros(size(t)); Tetul(I)=Phil; Tetu2(1)=PhiZ; Tetu3(1)=Phi3; .for k=2:length(t); Tetul(k)=rem(Tetulfk-l)+wl(k)*dt,2 *pi); Tet~Z(k)=rem(Tetu2(k-l)+wl(k)*dt,2~~pi); Tetu3(k)=rem(Tetu3(k-l)+wl(k)*dt,2 *pi); end %------- Angles,for 3:rd harmonic ---------Gummul =zeros(size.e(tJ); Gummu2=zeros(size(t)); Gumma3 =zeror(size(t)); Gummul (I)=O; Gummu2(1)= -lO;Kpi/l 80;
GammuJ(1)=IOfpi/180;

Arg_U=utun2(lm_U,Re_LI); .flhut=fo+fi*Arg-V./(2 *pi); 70 ____---filter estimate ________-N=3; %jilter order fc=20; % ( H z ) Cut offrequency
~

.fn=f.YQ; % spec$ cution in normulizedjrequency

Wn=fdfn ;
% design LP Butterworth,fi'lter

[B,Al=butter(N,Wn); %jilter the estimate ,fLhutfilt-ex3 =filter(B,A,,fLhut;fO)+fO; ,f~hatfilt~ex4=~l~ilt(B,A,.f~hut~f~)if~;

,for k=2: length(t); Gummul (k)=rem(Gummul(k-I)+3*wl( k )*dt,2*pi); Gummu2(k)=rem( Gummu2(k-l)+3*wl(k)*dt,2*pi); Gummu3(k)=rem(Gummu3(k-1)+3 *wl(k)*dt,2*pi); end
% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
%-------Anglesfrir 5:th hurmonic . . . . . . . . . .

You might also like