Summary of the invention
In order to solve the real time problems of the calculating of instantaneous visual sense degrees of data in the existing flickering computing technique, the invention provides a kind of accuracy that both satisfied, satisfied again the flickering computing method of real-time.
In order to achieve the above object, the technical solution used in the present invention is:
A kind of flickering real-time computing technique is characterized in that may further comprise the steps:
(1), measure the instantaneous visual sense degrees of data of flickering, the floating number that these data are greater than zero is referred to as measured data floating-point manifold.
(2), each floating number that this measured data floating number is concentrated multiply by a coefficient, obtains one group of set of integers and is referred to as the measured data set of integers, and the probability statistics of measured data floating-point manifold in fact just are equal to probability statistics to the measured data set of integers.
(3), set one group of integer array and be referred to as to add up array.
(4), when the measured data set of integers is carried out probability statistics, will add up first each the variable zero clearing in the array, then travel through the measured data set of integers, and whenever obtain a round values, the relevant variable of then adding up in the array adds 1.
(5), ergodic process finishes, the numerical value of then adding up each variable of array has just represented the number of times that respective integer occurs in the measured data set of integers in whole measured data set of integers, obtain the probability of the instantaneous visual sense degrees of data of flickering.
Aforesaid a kind of flickering real-time computing technique is characterized in that may further comprise the steps:
(1), establishing the data that need statistics is greater than zero floating number { X
nBe referred to as measured data floating-point manifold, and n={0 wherein, 1,2.。。, N}, N are the data point number that needs statistics, determine { X
nMeasuring accuracy namely need the scale M that keeps.
(2), with measured data floating-point manifold { X
nMultiply by 10
MBe transformed into integer { Y
nBe referred to as the measured data set of integers, to { X
nProbability statistics in fact be exactly to { Y
nProbability statistics.
(3), to { Y
nWhen carrying out probability statistics, estimate first { Y
nMaximal value Y
Max, according to this maximal value Y
Max, set an integer array sort[count] and be called the statistics array, add up the big or small count of array〉Y
Max
(4), at every turn add up beginning, will add up array sort[count first] zero clearing, then from n=0 to n=N, travel through { Y
n, whenever obtain a Y
n, then add up accordingly the variable sort[Y in the array
n] add 1.
(5), this process finishes, and then adds up array sort[count] in each variable sort[y] (0≤y≤Y
Max) just represented numerical value y at { Y
nThe middle number of times m that occurs, m/N is that numerical value y is at { Y just
nIn the probability that occurs, such as y at { X
nIn corresponding value be x, then m/N namely x at { X
nThe middle probability that occurs.
The invention has the beneficial effects as follows:
The present invention can finish the calculating of flickering data in a short period of time, and is not subjected to the impact of statistics element number, can realize that the real-time statistics of large capacity flicker measurement data is calculated.Can satisfy the real-time grasp to the flickering index, satisfy the real-time quality monitoring to grid supply quality.
Embodiment
Below embodiments of the invention are done concrete introduction:
(1), establishes x (n)=f (n), 0≤n≤N, 0≤x (n)≤X
Max
X (n) is a discrete floating number ordered series of numbers, represents the results of intermediate calculations in the detecting instrument testing process, whenever obtains N point and will do a probability statistics calculating to x (n).
Suppose the maximal value X of this sequence
Max<99, the scale that needs to keep is 2.
(2), establish y (n)=x (n) * 10
2, 0≤n≤N.Y (n) is defined as set of integers.
0≤y (n)≤9999 then.So just obtained with x (n) deserved set of integers y (n).
(3), set one group of integer array sort[count], count=10000.
(4), in the actual computation, install every once sampling and just calculate a some x (n).
When n=0, sort[count] the array zero clearing.
y(0)=x(0)*10
2,sort[y(0)]=sort[y(0)]+1;
Whenever obtain later on an x (n), just obtain a y (n), corresponding sort[y (n)]=sort[y (n)]+1.
When n=N-1, carry out probability statistics.
The probability that occurs in x (n) as obtaining floating number x becomes x into integer first, gets y=x*10
2
Then this probable value is: sort[y]/N.
Equally, can carry out probability statistics to other numerical value.
Above demonstration and described ultimate principle of the present invention, principal character and advantage.The technician of the industry should understand; the present invention is not restricted to the described embodiments; that describes in above-described embodiment and the instructions just illustrates principle of the present invention; without departing from the spirit and scope of the present invention; the present invention also has various changes and modifications, and these changes and improvements all fall in the claimed scope of the invention.The claimed scope of the present invention is by appending claims and equivalent circle thereof.