Disclosure of Invention
The invention aims to solve the technical problem of providing a frequency and amplitude self-adaptive algorithm of a transient electric signal, which can quickly and accurately realize synchronous self-adaptive tracking of the frequency amplitude of a power grid.
In order to solve the technical problems, the invention adopts a technical scheme that: there is provided a frequency and amplitude adaptive algorithm for a transient electrical signal, comprising the steps of:
s1: after being filtered by an anti-aliasing analog filter, the electric power system signal x (t) takes the sampling frequency as fsSampling duration of tsSampling to obtain N discrete electrical signals x (N), wherein N ═ fs*tsWith a sampling interval of Ts=1/fs;
S2: establishing a cubic spline interpolation function to interpolate the discrete electric signal x (N), so as to obtain an interpolation sequence x' (k) containing interpolation points, wherein k is 1,2, ┄, (M-2) (N-1), and M is the number of interpolation points between two adjacent sampling points;
s3: truncating the interpolation sequence x' (k) according to sampling intervals to obtain (N-1) equal-interval reconstruction samples, and recording the samples as xi(M), wherein i ═ 1,2, ┄, N-1, M ═ 1,2, ┄, M;
s4: estimation of (N-1) reconstructed sample sequences x using the Prony algorithmiFrequency and amplitude of (m).
In a preferred embodiment of the present invention, in step S2, the step of establishing the cubic spline interpolation function is:
given interval [ a, b]Function f above and a set of nodes a ═ x0<x1<┄<xqB, the cubic spline interpolation S of the function f is a function satisfying the following condition:
condition 1: for the subinterval [ x ]j,xj+1](j is 0,1,2, ┄, q-1), and S (x) is a cubic polynomial in the subinterval denoted as Sj(x);
Condition 2: s (x)j)=f(xj),(j=0,1,2,┄,q-1);
Condition 3: sj+1(xj+1)=Sj+1(xj+1),(j=0,1,2,┄,q-2);
Condition 4: s'j+1(xj+1)=S′j(xj+1),(j=0,1,2,┄,q-2);
Condition 5: s ″)j+1(xj+1)=S″j(xj+1),(j=0,1,2,┄,q-2);
One of the boundary conditions is satisfied, S ″ (x)0)=S″(xq)=0;②S′(x0)=f′(x0) And S' (x)q)=f′(xq)。
In a preferred embodiment of the present invention, the step S2 includes the following steps:
s2.1: the interpolated function f corresponds to the signal x (t) of the power system, the interpolated function point f (x)j) Discrete electrical signals x (n) obtained by sampling corresponding to the power system;
s2.2: difference h between arbitrary cellsj=xj+1-xj(j ═ 1,2, ┄, q-1), corresponding to sampling interval Ts;
s2.3: determining the number M of interpolation points between two adjacent sampling points;
s2.4: after the cubic spline interpolation function is obtained, the independent variable x is sequentially set to 0, Ts,2Ts,3Ts, ┄, (N-1) MTs, and a new interpolation sequence x' (k) is obtained.
In a preferred embodiment of the present invention, the step S4 includes the following steps:
s4.1: setting the transient power system signal as
Reconstructed sample x after sampling interpolation reconstruction and truncation processing
i(m) constructing an extended Prony detection model for a group of harmonic signals with p random amplitudes, phases and frequencies, wherein the discrete time function form of the extended Prony detection model is as follows:
where M is 0,1,2, …, M-1, p is the rank of the model matrix, ajIs the amplitude, fjIs the frequency, thetajIs a phase,αjAn attenuation factor;
s4.2: the Prony algorithm utilizes the principle of error square sum minimum to realize model parameter estimation and constructs a cost function, namely:
s4.3: calculating a Prony detection model, and solving the amplitude and the frequency of the transient electric signal at a certain moment;
s4.4: and repeating the steps S4.1 to S4.3, and solving the amplitude and the frequency of the transient electric signal at each moment.
Further, the calculation process of step S4.3 includes:
s4.3.1: calculating a reconstructed sample function R (i, j) and constructing an expansion matrix RiDetermining RiAn effective rank p;
p
eis the order of the linear prediction model;
s4.3.2: establishing a linear matrix equation and solving the parameter a
j:R
i[1,a
1,…,a
p]
T=[ξ
i,0,…,0]
TIn which epsilon
piFor minimum error energy:
s4.3.3: solving the characteristic root z of a polynomialj:1+a1z-1+…+apz-p=0;
S4.3.4: solving for the amplitude and frequency of the transient signal: a. thej=2|aj|,fj=arctan[Im(zj)/Re(zj)]/(2πTs)。
Further, in step (ii)S4.4, the amplitude and frequency of the transient electrical signal at each time instant is a ═ a
1 A
i … A
N-1],f=[f
1 f
i … f
N-1]Wherein A is
i=[2|a
1| 2|a
j| … 2|a
p|],
The invention has the beneficial effects that:
(1) in the invention, cubic spline interpolation is firstly carried out on a sampled electric signal in a time domain, an interpolation sequence is obtained, then data truncation is carried out according to a sampling interval, a reconstructed sample is constructed, and finally a Prony algorithm is adopted to estimate the frequency amplitude of each reconstructed sample. The experimental result verifies that the algorithm quickly and accurately realizes the synchronous self-adaptive tracking of the frequency amplitude of the power grid;
(2) the method is suitable for synchronous detection of the electrical parameters of the power grid signals under the condition that the frequency and the amplitude of the power grid signals simultaneously change along with time, has high algorithm accuracy, and provides a reliable and effective technical support for accurate measurement and analysis of three elements of the power grid.
Detailed Description
The following detailed description of the preferred embodiments of the present invention, taken in conjunction with the accompanying drawings, will make the advantages and features of the invention easier to understand by those skilled in the art, and thus will clearly and clearly define the scope of the invention.
Referring to fig. 1, an embodiment of the present invention includes:
a frequency and amplitude adaptive algorithm for transient electrical signals comprising the steps of:
s1: before an AD sampling module, an anti-aliasing analog filter is additionally arranged on a power system signal x (t), so that the frequency spectrum leakage of a sampling signal is reduced to the maximum extent, and the sampling frequency is fs(unit: Hz), sampling duration tsSampling a power system signal x (t) (unit: V or A) to obtain an N-point discrete electric signal x (N), wherein N ═ fs*tsWith a sampling interval of Ts=1/fs;
S2: establishing a cubic spline interpolation function to interpolate the discrete electric signal x (N), so as to obtain an interpolation sequence x' (k) containing interpolation points, wherein k is 1,2, ┄, (M-2) (N-1), and M is the number of interpolation points between two adjacent sampling points;
the method comprises the following steps of:
given interval [ a, b]Function f above and a set of nodes a ═ x0<x1<┄<xqB, the cubic spline interpolation S of the function f is a function satisfying the following condition:
condition 1: for the subinterval [ x ]j,xj+1](j is 0,1,2, ┄, q-1), and S (x) is a cubic polynomial in the subinterval denoted as Sj(x);
Condition 2: s (x)j)=f(xj),(j=0,1,2,┄,q-1);
Condition 3: sj+1(xj+1)=Sj+1(xj+1),(j=0,1,2,┄,q-2);
Condition 4: s'j+1(xj+1)=S′j(xj+1),(j=0,1,2,┄,q-2);
Condition 5: s ″)j+1(xj+1)=S″j(xj+1),(j=0,1,2,┄,q-2);
One of the boundary conditions is satisfied, S ″ (x)0)=S″(xq)=0;②S′(x0)=f′(x0) And S' (x)q)=f′(xq)。
The specific steps of applying the cubic spline interpolation in the power signal sample reconstruction include:
s2.1: the interpolated function f corresponds to the signal x (t) of the power system, the interpolated function point f (x)j) Discrete electrical signals x (n) obtained by sampling corresponding to the power system;
s2.2: difference h between arbitrary cellsj=xj+1-xj(j ═ 1,2, ┄, q-1), corresponding to sampling interval Ts;
because the signals of the power system adopt real-time sampling and equivalent time sampling, and the sampling interval Ts is fixed, hjThe value of (A) is also constant;
s2.3: determining the number M of interpolation points between two adjacent sampling points;
s2.4: after the cubic spline interpolation function is obtained, the independent variable x is sequentially set to 0, Ts,2Ts,3Ts, ┄, (N-1) MTs, and a new interpolation sequence x' (k) is obtained.
S3: truncating the interpolation sequence x' (k) according to sampling intervals to obtain (N-1) equal-interval reconstruction samples, and recording the samples as xi(M), wherein i ═ 1,2, ┄, N-1, M ═ 1,2, ┄, M; the method comprises the following specific steps:
sequentially combining two adjacent sampling points (shown as triangles in figure 2) in the new interpolation sequence x '(k) and (M-2) interpolation points (shown as pentagons in figure 2) between the two adjacent sampling points into a reconstruction sample (except for the initial sampling point and the tail sampling point, the rest sampling points are used twice), and finally, substantially truncating the interpolation sequence x' (k) according to sampling intervals to obtain (N-1) equidistant reconstruction samples which are recorded as xi(M), wherein i is 1,2, ┄, N-1, M is 1,2, ┄, M.
S4: estimation of (N-1) reconstructed sample sequences x using the Prony algorithmiFrequency and amplitude of (m). This step includes the construction and calculation of a test model,the method comprises the following specific steps:
s4.1: setting the transient power system signal as
Reconstructed sample x after sampling interpolation reconstruction and truncation processing
i(m) constructing an extended Prony detection model for a group of harmonic signals with p random amplitudes, phases and frequencies, wherein the discrete time function form of the extended Prony detection model is as follows:
where M is 0,1,2, …, M-1, p is the rank of the model matrix, ajIs the amplitude, fjIs the frequency, thetajIs a phase, αjAn attenuation factor;
s4.2: the Prony algorithm utilizes the principle of error square sum minimum to realize model parameter estimation and constructs a cost function, namely:
s4.3: calculating a Prony detection model, and solving the amplitude and the frequency of the transient electric signal at a certain moment;
further, the calculation process of step S4.3 includes:
s4.3.1: calculating a reconstructed sample function R (i, j) and constructing an expansion matrix RiDetermining RiAn effective rank p;
pe is the order of the linear prediction model;
s4.3.2: establishing a linear matrix equation and solving the parameter a
j:R
i[1,a
1,…,a
p]
T=[ξ
i,0,…,0]
TIn which epsilon
piFor minimum error energy:
s4.3.3: solving the characteristic root z of a polynomialj:1+a1z-1+…+apz-p=0;
S4.3.4: solving for the amplitude and frequency of the transient signal: a. thej=2|aj|,fj=arctan[Im(zj)/Re(zj)]/(2πTs)。
S4.4: and repeating the steps S4.1 to S4.3, solving the amplitude and the frequency of the transient electric signal at each moment: a ═ A
1 A
i… A
N-1],f=[f
1 f
i … f
N-1]Wherein A is
i=[2|a
1| 2|a
j| … 2|a
p|],
In the field of power system control, the transfer function is generally in the form of
Wherein m and n are positive integers and n>m, the time domain form of the transfer function without the heavy root is:
therefore, the frequency and the amplitude of the constructed signal are transient according to the e-t and te-t rules, and the tracking performance of the algorithm under an MATLAB simulation platform is given.
The invention describes the tracking performance of the algorithm on the frequency and amplitude of the transient electric signal by two embodiments:
signal 1 is: x (t) ═ A
1(t)cos(2πf
1(t)t+45°)+A
2(t)cos(2πf
2(t) t +45 °), amplitudes a1, a2 are:
the frequencies f1 and f2 are:
the sampling interval is 0.001s, the sampling length N is 100, and the reconstructed sample length M is 1000. Algorithm frequency and amplitude tracking curves and error curves are plotted as shown in fig. 3-6.
Signal 2 is: : x (t) ═ A
1(t)cos(2πf
1(t)t+45°)+A
2(t)cos(2πf
2(t) t +45 °), amplitudes a1, a2 are:
the frequencies f1 and f2 are:
the sampling interval is 0.001s, the sampling length N is 200, and the reconstructed sample length M is 1000. Algorithm frequency and amplitude tracking curves and error curves are plotted as shown in fig. 7-10.
As can be seen from the frequency and amplitude tracking curves and the error curves of the two experiments, the algorithm well realizes the frequency and amplitude synchronous tracking of the transient signal. Comparing the first and second embodiments, the tracking effect is different for different signal algorithms: (1) the overall tracking effect of the second embodiment is better than that of the first embodiment because the signal variation amplitude of the second embodiment is larger than that of the first embodiment; (2) the frequency tracking effect of the first and second embodiments is better than the amplitude tracking effect because the Prony algorithm is more sensitive to frequency.
After cubic spline interpolation reconstruction is carried out on a sampling signal of the electric power system in a time domain, data truncation is carried out according to a sampling interval, and an obtained reconstructed sample has three advantages: firstly, the truncated equidistant data sequence is not only strictly cycle truncated, but also contains an integer number of reconstruction points in each cycle; secondly, the cubic spline interpolation value has small signal reconstruction error, and the frequency spectrum and the amplitude hardly leak, so that a foundation is provided for realizing accurate detection of Prony parameters; thirdly, the length of the reconstructed sample can be reduced by reducing the length of the truncated reconstructed sample, so that the sampling interval of the software is reduced, the time interval is ensured to be small enough, the accuracy of the algorithm is improved, and the cost of sampling equipment is reduced. And finally, estimating the frequency amplitude of each reconstructed sample by adopting a Prony algorithm. Experimental results prove that the algorithm quickly and accurately realizes the synchronous self-adaptive tracking of the frequency amplitude of the power grid.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.