CN117194892A - Method and device for determining peak value and valley value of signal and electronic equipment - Google Patents

Method and device for determining peak value and valley value of signal and electronic equipment Download PDF

Info

Publication number
CN117194892A
CN117194892A CN202311108034.8A CN202311108034A CN117194892A CN 117194892 A CN117194892 A CN 117194892A CN 202311108034 A CN202311108034 A CN 202311108034A CN 117194892 A CN117194892 A CN 117194892A
Authority
CN
China
Prior art keywords
value
candidate
valley
signal
peak
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311108034.8A
Other languages
Chinese (zh)
Inventor
孙鹏飞
李胜芳
杜君
李良
闻志国
李岩
李慧
王龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
State Grid Corp of China SGCC
Beijing Smartchip Microelectronics Technology Co Ltd
Beijing Smartchip Semiconductor Technology Co Ltd
Original Assignee
State Grid Corp of China SGCC
Beijing Smartchip Microelectronics Technology Co Ltd
Beijing Smartchip Semiconductor Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by State Grid Corp of China SGCC, Beijing Smartchip Microelectronics Technology Co Ltd, Beijing Smartchip Semiconductor Technology Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN202311108034.8A priority Critical patent/CN117194892A/en
Publication of CN117194892A publication Critical patent/CN117194892A/en
Pending legal-status Critical Current

Links

Landscapes

  • Measurement Of Current Or Voltage (AREA)

Abstract

The invention provides a method and a device for determining a peak value and a valley value of a signal and electronic equipment, and belongs to the technical field of digital signals. The method comprises the following steps: acquiring the signal frequency of a signal to be detected; determining a plurality of sampling points in a single period of a signal to be detected based on the signal frequency and a preset sampling frequency; forming a polynomial function based on the fitting of the plurality of sampling points, and determining a first candidate peak value and a first candidate valley value based on the polynomial function; performing differential solution of discrete sampling points based on the plurality of sampling points, and determining a second candidate peak value and a second candidate valley value; and determining the most value of the first candidate peak value and the second candidate peak value as a target peak value of the signal to be detected, and determining the most value of the first candidate valley value and the second candidate valley value as a target valley value of the signal to be detected. The method and the device can accurately solve the peak value and the valley value of the periodic signal of the finite sequence in a complex noise environment by combining the peak-valley value solving method of the continuous waveform and the peak-valley value solving method of the discrete sampling points.

Description

Method and device for determining peak value and valley value of signal and electronic equipment
Technical Field
The present invention relates to the field of digital signals, and in particular, to a method for determining a peak value and a valley value of a signal, a device for determining a peak value and a valley value of a signal, and an electronic device.
Background
In the processing of digital signals, a method of finding or solving peaks (or troughs) of a signal for a given sampling sequence is often involved. The sampling sequence signals may be, for example, voltage signals, current signals, power signals in an electrical system, and various vibration-type signals related to human life and motion: respiration rate signals, pulse signals, blood pressure signals, blood oxygen index signals, step count signals, and the like.
The current measuring method of the wave crest and the wave trough comprises the following steps: a comparison discrimination method, a first-order difference combination comparison discrimination method, a second-order difference discrimination method, and the like. However, the three methods cannot extract effective peaks and troughs for complex noise signals, and cannot discard noise signals, so that detection results are inaccurate, and unnecessary losses and results are caused in actual scenes.
Disclosure of Invention
The embodiment of the invention aims to provide a method for determining the peak value and the valley value of a signal, a device for determining the peak value and the valley value of the signal and electronic equipment, which are used for solving the defect that the effective peak value and the effective valley value cannot be extracted by the existing method in a signal with complex noise.
In order to achieve the above object, an embodiment of the present invention provides a method for determining a peak value and a valley value of a signal, including:
acquiring the signal frequency of a signal to be detected;
determining a plurality of sampling points in a single period of the signal to be detected based on the signal frequency and a preset sampling frequency;
forming a polynomial function based on the plurality of sampling point fits, and determining a first candidate peak and a first candidate valley based on the polynomial function;
performing differential solution of discrete sampling points based on the plurality of sampling points, and determining a second candidate peak value and a second candidate valley value;
and determining the maximum value of the first candidate peak value and the second candidate peak value as a target peak value of the signal to be detected, and determining the maximum value of the first candidate valley value and the second candidate valley value as a target valley value of the signal to be detected.
Optionally, the fitting based on the plurality of sampling points to form a polynomial function, and determining the first candidate peak value and the first candidate valley value based on the polynomial function includes:
fitting the plurality of sampling points based on a Taylor regression function to form a polynomial function;
and performing quadratic derivation based on the polynomial function, and determining a first candidate peak value and a first candidate valley value based on the quadratic derivation result.
Optionally, the fitting the plurality of sampling points based on the taylor regression function to form a polynomial function includes:
fitting a symbol equation of a plurality of sampling points approximately by using a Taylor regression function;
performing feature discrimination based on the low-order polynomial of the symbol equation to obtain the functional feature of the symbol equation;
a polynomial function is formed based on the function features.
Optionally, the determining the second candidate peak value and the second candidate valley value based on the differential solution of the discrete sampling points of the plurality of sampling points includes:
splicing a plurality of sampling points to form a sampling vector;
calculating a first-order differential vector based on the sampling vector;
performing sign taking function operation based on the first-order differential vector to obtain a trend vector;
traversing the trend vector to carry out reassignment;
performing first-order differential operation based on the reassigned trend vector to obtain a differential vector;
a second candidate peak and a second candidate valley are determined based on the differential vector.
Optionally, the step of determining the most value of the first candidate peak value and the second candidate peak value as the target peak value of the signal to be measured, and determining the most value of the first candidate valley value and the second candidate valley value as the target valley value of the signal to be measured further includes:
and comparing each adjacent value in the set neighborhood range of the target peak value with the target peak value, and comparing each adjacent value in the set neighborhood range of the target valley value with the target valley value to verify the accuracy of the target peak value and the target valley value.
Optionally, before the step of obtaining the signal frequency of the signal to be measured, the method further includes:
and carrying out smoothing denoising treatment on the signal to be detected based on a weighted moving average filtering method.
On the other hand, the embodiment of the invention also provides a device for determining the peak value and the valley value of the signal, which comprises the following steps:
the signal frequency acquisition module is used for acquiring the signal frequency of the signal to be detected;
the sampling point determining module is used for determining a plurality of sampling points in a single period of the signal to be detected based on the signal frequency and a preset sampling frequency;
a first peak-to-valley determination module configured to form a polynomial function based on the plurality of sampling point fits, and determine a first candidate peak and a first candidate valley based on the polynomial function;
the second peak-valley value determining module is used for carrying out differential solution of discrete sampling points based on the plurality of sampling points to determine a second candidate peak value and a second candidate valley value;
and the target peak-to-valley value determining module is used for determining the most value of the first candidate peak value and the second candidate peak value as the target peak value of the signal to be detected, and determining the most value of the first candidate valley value and the second candidate valley value as the target valley value of the signal to be detected.
Optionally, the fitting based on the plurality of sampling points to form a polynomial function, and determining the first candidate peak value and the first candidate valley value based on the polynomial function includes:
fitting the plurality of sampling points based on a Taylor regression function to form a polynomial function;
and performing quadratic derivation based on the polynomial function, and determining a first candidate peak value and a first candidate valley value based on the quadratic derivation result.
Optionally, the fitting the plurality of sampling points based on the taylor regression function to form a polynomial function includes:
fitting a symbol equation of a plurality of sampling points approximately by using a Taylor regression function;
performing feature discrimination based on the low-order polynomial of the symbol equation to obtain the functional feature of the symbol equation;
a polynomial function is formed based on the function features.
Optionally, the determining the second candidate peak value and the second candidate valley value based on the differential solution of the discrete sampling points of the plurality of sampling points includes:
splicing a plurality of sampling points to form a sampling vector;
calculating a first-order differential vector based on the sampling vector;
performing sign taking function operation based on the first-order differential vector to obtain a trend vector;
traversing the trend vector to carry out reassignment;
performing first-order differential operation based on the reassigned trend vector to obtain a differential vector;
a second candidate peak and a second candidate valley are determined based on the differential vector.
Optionally, the peak and valley determining device of the signal further comprises:
and the verification module is used for comparing each adjacent value in the set neighborhood range of the target peak value with the target peak value and comparing each adjacent value in the set neighborhood range of the target valley value with the target valley value so as to verify the accuracy of the target peak value and the target valley value.
Optionally, the peak and valley determining device of the signal further comprises:
and the smooth denoising module is used for carrying out smooth denoising processing on the signal to be measured based on a weighted moving average filtering method.
In another aspect, the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method for determining peaks and valleys of the signals as described above when the program is executed.
In another aspect, the invention also provides a machine readable storage medium having stored thereon a computer program which when executed by a processor implements a method of peak and trough determination of a signal as described above.
In another aspect, the invention also provides a computer program product comprising a computer program which, when executed by a processor, implements a method for peak and trough determination of a signal as described above.
According to the technical scheme, the target peak value and the target valley value which are the most values are screened out from the candidate peak valley value determined by the polynomial function and the candidate peak valley value obtained by the differential solution of the discrete sampling points, so that the peak value and the valley value of the periodic signal of the finite sequence can be accurately solved in a complex noise environment by combining the continuous waveform peak valley value solving method and the discrete sampling point peak valley value solving method.
Additional features and advantages of embodiments of the invention will be set forth in the detailed description which follows.
Drawings
The accompanying drawings are included to provide a further understanding of embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain, without limitation, the embodiments of the invention. In the drawings:
FIG. 1 is a flow chart of a method for determining peaks and valleys of a signal according to the present invention;
FIG. 2 is a second flow chart of a method for determining peaks and valleys of a signal according to the present invention;
FIG. 3 is a third flow chart of a method for determining peaks and valleys of a signal according to the present invention;
FIG. 4 is a schematic diagram of the structure of the peak and valley determining device of the signal provided by the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
The following describes the detailed implementation of the embodiments of the present invention with reference to the drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the invention, are not intended to limit the invention.
Method embodiment
Referring to fig. 1, an embodiment of the present invention provides a method for determining a peak value and a valley value of a signal, including:
step 200, obtaining the signal frequency of the signal to be detected.
The electronic equipment obtains the signal frequency of the signal to be detected. The signals to be measured can be voltage signals, current signals, power signals in the power system and various vibration signals related to human life and sports: respiration rate signals, pulse signals, blood pressure signals, blood oxygen index signals, step count signals, and the like.
In one embodiment, the electronic device may obtain the frequency and amplitude of the signal under test by performing a fast fourier transform on the signal under test and analyzing the frequency components in the frequency spectrum. In another embodiment, the electronic device may also obtain the signal frequency of the signal to be measured based on the method mentioned in the chinese patent of the invention with the application number CN 201910573020.0.
And 300, determining a plurality of sampling points in a single period of the signal to be detected based on the signal frequency and a preset sampling frequency.
In the case of determining a signal frequency, the electronic device may determine a plurality of sampling points within a single period of the signal under test based on the signal frequency and a preset sampling frequency. Specifically, the number M of the plurality of sampling points 1 Can be determined by the following formula:
wherein M is 1 For the number of sampling points determined in a single period, f s For a preset sampling frequency f x Is the signal frequency. Based on the number M of the plurality of sampling points 1 Assume that for a plurality of sampling points in a single period of a signal to be measured, the following are: p (P) -1 ,P 0 ,P 1 ,…,P i ,…,
Step 400, forming a polynomial function based on the plurality of sampling point fits, and determining a first candidate peak and a first candidate valley based on the polynomial function.
The electronics form a polynomial function based on the plurality of sample point fits. The electronic device forms a continuous waveform curve based on fitting of a plurality of sampling points, and then determines a first candidate peak value and a first candidate valley value based on a polynomial function representing the continuous waveform curve.
And 500, carrying out differential solution of discrete sampling points based on the plurality of sampling points, and determining a second candidate peak value and a second candidate valley value.
And the electronic equipment performs differential solution of the discrete sampling points based on the plurality of sampling points to determine a second candidate peak value and a second candidate valley value. The electronic device determines a second candidate peak value and a second candidate valley value through a differential solving mode of discrete sampling points different from the polynomial function solving mode.
Step 600, determining the most value of the first candidate peak value and the second candidate peak value as a target peak value of the signal to be measured, and determining the most value of the first candidate valley value and the second candidate valley value as a target valley value of the signal to be measured.
In the case that the electronic device screens out candidate peak-valley values (i.e., a first candidate peak value, a first candidate valley value, a second candidate peak value, and a second candidate valley value) from two aspects by combining a polynomial function and a differential solution of discrete sampling points, the electronic device determines the most value of the first candidate peak value and the second candidate peak value as a target peak value of a signal to be measured, and determines the most value of the first candidate valley value and the second candidate valley value as a target valley value of the signal to be measured. For example, when the signal to be measured is a current signal, the first candidate peak value is 80mA, and the second candidate peak value is 90mA, and then the electronic device selects the second candidate peak value as the target peak value. Similarly, the first candidate valley is 1mA and the second candidate valley is 0mA, and the electronic device selects the second candidate valley as the target valley.
Thus, the peak value and the valley value of the precise periodic signal of the finite sequence are obtained through comparison of the two methods. The method can be used for solving the peak value and the valley value of the periodic signal of the finite sequence accurately in a complex noise environment by combining the polynomial function with the differential solution of the discrete sampling points to determine the optimal target peak value and the optimal target valley value in the candidate peak valley value, so that the defect of solving the peak valley value by a single polynomial function or solving the peak valley value by the differential solution of the discrete sampling points can be overcome.
The method screens out the target peak value and the target valley value which are the most values from the candidate peak valley value determined by the polynomial function and the candidate peak valley value obtained by the difference solution of the discrete sampling points, so that the peak value and the valley value of the periodic signal of the finite sequence can be accurately solved in a complex noise environment by combining the continuous waveform peak valley value solving method and the discrete sampling point peak valley value solving method, and powerful guarantee is provided for analysis and judgment of the signal.
In other aspects of embodiments of the present invention, step 400 of forming a polynomial function based on the plurality of sample point fits, and determining a first candidate peak and a first candidate valley based on the polynomial function comprises:
and step 410, fitting the plurality of sampling points based on the Taylor regression function to form a polynomial function.
The electronic device may fit the plurality of sampling points based on a taylor regression function to form a polynomial function, such that a continuous waveform curve is formed by fitting the plurality of sampling points with the polynomial function.
And step 420, performing quadratic derivation based on the polynomial function, and determining a first candidate peak value and a first candidate valley value based on the quadratic derivation result.
The electronic device determines a first candidate peak value and a first candidate valley value based on a result of the quadratic derivation by performing the quadratic derivation on the polynomial function. In particular, for example, the polynomial function isWhen the first derivative of the polynomial function is obtained, a point (i, P) with a derivative value of 0 is found i ). Based on i point pair->Solving the second derivative and judging->I is a stationary point if it is 0, P if it is greater than 0 i For the first candidate valley, P is less than 0 i Is the first candidate peak.
It should be noted that, in other embodiments, the waveform curve fitting may be performed on the plurality of sampling points by other methods. Waveform curve fitting is performed on the plurality of sampling points, for example, by a least square method.
According to the embodiment of the invention, the plurality of sampling points are fitted through the Taylor regression function to form the polynomial function, the polynomial function is subjected to secondary derivation, and the first candidate peak value and the first candidate valley value are determined based on the secondary derivation result, so that the first candidate peak value and the first candidate valley value are obtained through the continuous polynomial function, and a good precondition is provided for judging the target peak value and the target valley value.
In other aspects of the embodiments of the present invention, step 410, fitting the plurality of sampling points based on a taylor regression function to form a polynomial function includes:
step 411, approximating the sign equation of the plurality of sampling points using a taylor regression function.
And 412, performing feature discrimination based on the low-order polynomial of the symbol equation to obtain the functional feature of the symbol equation.
Step 413, forming a polynomial function based on the function features.
The electronic device performs a waveform curve fitting by using a taylor regression function, which approximates the sign equation of a plurality of sampling points using a taylor polynomial. And the electronic equipment performs feature discrimination based on the low-order polynomial of the symbol equation to obtain the functional feature of the symbol equation. Wherein the functional features include variable separability, boundary, monotonicity, parity, and the like. The electronic device forms a polynomial function based on the function features. In one embodiment the polynomial function is formulated asθ is the target parameter set, ++>Expression for the estimated polynomial function, +.>Is the value of the estimated point. The range of the data set D consisting of a plurality of sampling points is +.>x is the abscissa of the sampling point, i is the serial number of the sampling point, and P is the ordinate of the sampling point.
In one embodiment, the specific process of step 410 is as follows:
selecting (x from a data set D of a plurality of sampling points 0 ,P 0 ) Around k points (x 1 ,P 1 ),(x 1 ,P 2 ),…,(x k ,P k ) K th order taylor polynomials are aggregated by the following formula according to the k points selected:
in f (x) i )=P i Again via f=ca -1 The formula yields the k derivative, where f= [ F' (a), F "(a), F k (a)] T ,C=[P 1 -P 0 ,P 1 -P 0 ,...,P k -P 0 ],a ij E A andthe final calculated F may generate a taylor polynomial of order k.
For the taylor polynomial, if the coefficients in each of the multiple variable terms are zero, the function of the taylor polynomial approximation is additive separable. Splitting the Taylor polynomial into a plurality of sub-Taylor polynomials, and judging the sub-Taylor polynomials: if the polynomial is a low-order polynomial, the mathematical expression can be directly formed; and vice versa, monotonicity, parity and boundary calculations are performed.
And then evolution is carried out on the function characteristics, and individual initialization and individual recombination operations are carried out. The individual initialization operator randomly generates individuals that satisfy the functional characteristics. And the individual reorganization operator transforms the individual, so that the generated individual can meet the function characteristics. In each generation, individual recombination is utilized to produce offspring with a probability of α; generating offspring with probability β using individual initialization; individuals are saved as other offspring with probabilities (1-alpha-beta).
The individual initialization is divided into three steps of dividing a mathematical expression space, evaluating subspaces and generating individuals, wherein the dividing mathematical expression space represents one space segment of a mathematical expression by using a tree with depth of h. For example, given a set of basis functions { +, sin } and a set of variables { x, c }, the mathematical expression space is divided into tree-encoded subspaces of depth 3, including "+++ sincxx", "+++ xcc", "+sinsinxx" and "sin+xc". The evaluation subspace is used for judging the boundary, monotonicity and parity of the subspace. The individual methods of generating result in a segmented subspace whose boundaries contain a given boundary. One subspace is then randomly selected from the subspaces. If the subspace does not meet the given monotonicity and parity requirements, the method randomly generates a new individual from the subspace until the given functional characteristic is met.
The individual recombination is to recombine two individuals in space, construct an individual meeting the given function characteristics, and assemble mathematical expressions after combination.
The mathematical expression is assembled by only combining the mathematical expression found by each simple taylor polynomial into various complete mathematical equations, which are summarized as
In other aspects of the embodiments of the present invention, step 500, performing differential solution of discrete sampling points based on the plurality of sampling points, determining a second candidate peak value and a second candidate valley value, includes:
step 510, forming a sampling vector based on the concatenation of the plurality of sampling points.
Specifically, the electronic device splices a one-dimensional sampling vector based on a plurality of sampling points
Step 520, calculating a first-order differential vector based on the sampling vector.
The electronic equipment calculates and obtains a first-order differential vector Diff based on the sampling vector V v The calculation formula of each element in the first-order differential vector is as follows: diff (Diff) v (i) =v (i) -V (i-1); wherein i.epsilon.0, 1,2,3, … N.
And 530, performing signed function operation based on the first-order differential vector to obtain a trend vector.
Electronic device pair first order differential vector Diff v And performing signed function operation to obtain a Trend vector Trend. Wherein the calculation formula of the Trend vector Trend is trend=sign (Diff v )。
Wherein,
step 540, traversing the trend vector to reassign.
Specifically, the electronic device traverses the Trend vector Trend from the tail, and performs the following operations: trend (i) =1 if Trend (i) =0 and Trend (i+1) > 0; trend (i) = -1 if Trend (i) = 0 and Trend (i+1) < 0.
Step 550, performing a first-order difference operation based on the reassigned trend vector to obtain a difference vector.
And the electronic equipment performs first-order differential operation on the reassigned Trend vector Trend to obtain a differential vector R. Wherein the formula of the differential vector R is: r=diff Trend (i)。
Step 560, determining a second candidate peak and a second candidate valley based on the differential vector.
The electronic device traverses the resulting differential vector R, if R (i) = -2, i+1 is the peak position of the waveform, and P i+1 Is the second candidate peak; if R (i) =2, i+1 is the trough bit of the waveform, and P i+1 Is the second candidate valley.
The embodiment of the invention adopts a first-order difference method to determine and select a second candidate peak value and a second candidate valley value based on discrete sampling points. The second candidate peak value and the second candidate valley value obtained through the differential solution of the discrete sampling points provide good preconditions for judging the target peak value and the target valley value.
In other aspects of the embodiments of the present invention, referring to fig. 2, step 600, determining the most value of the first candidate peak value and the second candidate peak value as the target peak value of the signal to be measured, and determining the most value of the first candidate valley value and the second candidate valley value as the target valley value of the signal to be measured further includes:
step 700, comparing each adjacent value in the set neighborhood range of the target peak value with the target peak value, and comparing each adjacent value in the set neighborhood range of the target valley value with the target valley value, so as to verify the accuracy of the target peak value and the target valley value.
And the electronic equipment compares each adjacent value in the set neighborhood range of the target peak value in the signal to be detected with the target peak value so as to verify the accuracy of the target peak value. For example, the electronic device target compares the first 5 adjacent values and the last 5 adjacent values of the target peak value in the signal to be detected, and the total 10 adjacent values are respectively compared with the target peak value, so as to verify the accuracy of the selected target peak value. Therefore, further verification of the target peak value is realized, and the selected target peak value is ensured to belong to the peak value of the signal to be detected.
Similarly, the electronic device target compares the first 5 adjacent values and the last 5 adjacent values of the target valley value in the signal to be detected, and the total 10 adjacent values are respectively compared with the target valley value so as to verify the accuracy of the selected target valley value. Therefore, further verification of the target valley is realized, and the selected target valley is ensured to truly belong to the valley of the signal to be detected.
And comparing each adjacent value in the set neighborhood range of the target peak value with the target peak value, and comparing each adjacent value in the set neighborhood range of the target valley value with the target valley value, so that further verification on the accuracy of the target peak value and the target valley value is realized, and the fact that the selected target peak value really belongs to the peak value and the valley value of the signal to be detected is ensured.
In other aspects of the embodiments of the present invention, referring to fig. 3, before step 200, the step of obtaining the signal frequency of the signal to be measured further includes:
and 100, carrying out smooth denoising treatment on the signal to be detected based on a weighted moving average filtering method.
In order to reduce the influence of noise on the peak and valley determination of the signal to be measured. The electronic equipment carries out smooth denoising treatment on the signal to be detected based on a weighted moving average filtering method. Specifically, the embodiment of the invention adopts a weighted moving average filtering method to P -1 ,P 0 ,P 1 ,…,P i ,P N-1 The sampling sequence of (2) eliminates the noise signal of short-term fluctuation, and the working principle is to treat each data in the moving period differently according to the characteristic that the more recent data has larger influence on the predicted value. The method has the advantages that the method gives larger weight to recent data and smaller weight to distant data, so that the irregular data points can be formed into a smoother arrangement rule by means of gradual transition and gradual averaging according to the sequence of the data points, and the functions of the data with different distances from the current value can be different through weight setting. The specific formula is as follows:
wherein a, b, c correspond to weighting coefficients of different positions, respectively, and a>b>And c, setting the numerical value of the weighting coefficient according to the actual scene.
In addition, in some embodiments, it may be desirable to determine the pair of signals under test prior to step 100The lower limit value of the sampling point at which the number is sampled. Specifically, when the system is operated for the first time, since the exact signal frequency f of the object is not known x So that it is necessary to satisfy the sampling frequency f s And a lower frequency limit f of the signal under test low The lower limit value M of the calculated sampling point can be generally understood as a sampling point of n cycles above the lowest sampling frequency. The lower limit value M of the sampling point is:where n is the number of cycles desired to be sampled, f s For the sampling frequency, 6400Hz was set. f (f) low Is the lower frequency limit. Number M of multiple sample points of step 300 1 Greater than the lower limit value M of the sampling point to ensure that steps 400 and 500 are enabled, thereby providing a good prerequisite for the determination of the target peak and target valley.
Device embodiment
Referring to fig. 4, in another aspect, an embodiment of the present invention further provides a device for determining a peak value and a valley value of a signal, including:
a signal frequency acquisition module 401, configured to acquire a signal frequency of a signal to be detected;
a sampling point determining module 402, configured to determine a plurality of sampling points in a single period of the signal to be measured based on the signal frequency and a preset sampling frequency;
a first peak-to-valley determination module 403, configured to form a polynomial function based on the plurality of sampling point fits, and determine a first candidate peak and a first candidate valley based on the polynomial function;
a second peak-to-valley determination module 404, configured to determine a second candidate peak value and a second candidate valley value based on differential solutions of the discrete sampling points performed by the plurality of sampling points;
the target peak-valley determining module 405 is configured to determine the most value of the first candidate peak value and the second candidate peak value, to be the target peak value of the signal to be measured, and to determine the most value of the first candidate valley value and the second candidate valley value, to be the target valley value of the signal to be measured.
Optionally, the fitting based on the plurality of sampling points to form a polynomial function, and determining the first candidate peak value and the first candidate valley value based on the polynomial function includes:
fitting the plurality of sampling points based on a Taylor regression function to form a polynomial function;
and performing quadratic derivation based on the polynomial function, and determining a first candidate peak value and a first candidate valley value based on the quadratic derivation result.
Optionally, the fitting the plurality of sampling points based on the taylor regression function to form a polynomial function includes:
fitting a symbol equation of a plurality of sampling points approximately by using a Taylor regression function;
performing feature discrimination based on the low-order polynomial of the symbol equation to obtain the functional feature of the symbol equation;
a polynomial function is formed based on the function features.
Optionally, the determining the second candidate peak value and the second candidate valley value based on the differential solution of the discrete sampling points of the plurality of sampling points includes:
splicing a plurality of sampling points to form a sampling vector;
calculating a first-order differential vector based on the sampling vector;
performing sign taking function operation based on the first-order differential vector to obtain a trend vector;
traversing the trend vector to carry out reassignment;
performing first-order differential operation based on the reassigned trend vector to obtain a differential vector;
a second candidate peak and a second candidate valley are determined based on the differential vector.
Optionally, the peak and valley determining device of the signal further comprises:
and the verification module is used for comparing each adjacent value in the set neighborhood range of the target peak value with the target peak value and comparing each adjacent value in the set neighborhood range of the target valley value with the target valley value so as to verify the accuracy of the target peak value and the target valley value.
Optionally, the peak and valley determining device of the signal further comprises:
and the smooth denoising module is used for carrying out smooth denoising processing on the signal to be measured based on a weighted moving average filtering method.
The peak and valley determining device of the signal comprises a processor and a memory, the signal frequency obtaining module 401, the sampling point determining module 402, the first peak valley determining module 403, the second peak valley determining module 404, the target peak valley determining module 405 and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel may be provided with one or more.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
Fig. 5 illustrates a physical schematic diagram of an electronic device, as shown in fig. 5, which may include: processor 510, communication interface (Communications Interface) 520, memory 530, and communication bus 540, wherein processor 510, communication interface 520, memory 530 complete communication with each other through communication bus 540. Processor 510 may invoke logic instructions in memory 530 to perform a method of peak and valley determination of a signal, the method comprising: acquiring the signal frequency of a signal to be detected; determining a plurality of sampling points in a single period of the signal to be detected based on the signal frequency and a preset sampling frequency; forming a polynomial function based on the plurality of sampling point fits, and determining a first candidate peak and a first candidate valley based on the polynomial function; performing differential solution of discrete sampling points based on the plurality of sampling points, and determining a second candidate peak value and a second candidate valley value; and determining the maximum value of the first candidate peak value and the second candidate peak value as a target peak value of the signal to be detected, and determining the maximum value of the first candidate valley value and the second candidate valley value as a target valley value of the signal to be detected.
Further, the logic instructions in the memory 530 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program storable on a machine-readable storage medium, the computer program, when executed by a processor, is capable of performing a method of peak and trough determination of a signal, the method comprising: acquiring the signal frequency of a signal to be detected; determining a plurality of sampling points in a single period of the signal to be detected based on the signal frequency and a preset sampling frequency; forming a polynomial function based on the plurality of sampling point fits, and determining a first candidate peak and a first candidate valley based on the polynomial function; performing differential solution of discrete sampling points based on the plurality of sampling points, and determining a second candidate peak value and a second candidate valley value; and determining the maximum value of the first candidate peak value and the second candidate peak value as a target peak value of the signal to be detected, and determining the maximum value of the first candidate valley value and the second candidate valley value as a target valley value of the signal to be detected.
In yet another aspect, the present invention provides a machine-readable storage medium having stored thereon a computer program which when executed by a processor is implemented to perform a method of peak and valley determination of a signal, the method comprising: acquiring the signal frequency of a signal to be detected; determining a plurality of sampling points in a single period of the signal to be detected based on the signal frequency and a preset sampling frequency; forming a polynomial function based on the plurality of sampling point fits, and determining a first candidate peak and a first candidate valley based on the polynomial function; performing differential solution of discrete sampling points based on the plurality of sampling points, and determining a second candidate peak value and a second candidate valley value; and determining the maximum value of the first candidate peak value and the second candidate peak value as a target peak value of the signal to be detected, and determining the maximum value of the first candidate valley value and the second candidate valley value as a target valley value of the signal to be detected.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (14)

1. A method for determining peaks and valleys of a signal, comprising:
acquiring the signal frequency of a signal to be detected;
determining a plurality of sampling points in a single period of the signal to be detected based on the signal frequency and a preset sampling frequency;
forming a polynomial function based on the plurality of sampling point fits, and determining a first candidate peak and a first candidate valley based on the polynomial function;
performing differential solution of discrete sampling points based on the plurality of sampling points, and determining a second candidate peak value and a second candidate valley value;
and determining the maximum value of the first candidate peak value and the second candidate peak value as a target peak value of the signal to be detected, and determining the maximum value of the first candidate valley value and the second candidate valley value as a target valley value of the signal to be detected.
2. The method of claim 1, wherein the forming a polynomial function based on the plurality of sample point fits and the determining a first candidate peak and a first candidate valley based on the polynomial function comprises:
fitting the plurality of sampling points based on a Taylor regression function to form a polynomial function;
and performing quadratic derivation based on the polynomial function, and determining a first candidate peak value and a first candidate valley value based on the quadratic derivation result.
3. The method of claim 2, wherein the fitting the plurality of sampling points based on a taylor regression function to form a polynomial function comprises:
fitting a symbol equation of a plurality of sampling points approximately by using a Taylor regression function;
performing feature discrimination based on the low-order polynomial of the symbol equation to obtain the functional feature of the symbol equation;
a polynomial function is formed based on the function features.
4. The method of claim 1, wherein said performing a differential solution of discrete sample points based on said plurality of sample points to determine a second candidate peak and a second candidate valley comprises:
splicing a plurality of sampling points to form a sampling vector;
calculating a first-order differential vector based on the sampling vector;
performing sign taking function operation based on the first-order differential vector to obtain a trend vector;
traversing the trend vector to carry out reassignment;
performing first-order differential operation based on the reassigned trend vector to obtain a differential vector;
a second candidate peak and a second candidate valley are determined based on the differential vector.
5. The method of determining peaks and valleys of a signal according to claim 1, wherein said step of determining the most value of said first candidate peak value and said second candidate peak value as a target peak value of the signal under test, and determining the most value of said first candidate valley value and said second candidate valley value as a target valley value of the signal under test, further comprises, after:
and comparing each adjacent value in the set neighborhood range of the target peak value with the target peak value, and comparing each adjacent value in the set neighborhood range of the target valley value with the target valley value to verify the accuracy of the target peak value and the target valley value.
6. The method of claim 1, wherein prior to the step of acquiring the signal frequency of the signal under test, further comprising:
and carrying out smoothing denoising treatment on the signal to be detected based on a weighted moving average filtering method.
7. A peak and valley determining apparatus for a signal, comprising:
the signal frequency acquisition module is used for acquiring the signal frequency of the signal to be detected;
the sampling point determining module is used for determining a plurality of sampling points in a single period of the signal to be detected based on the signal frequency and a preset sampling frequency;
a first peak-to-valley determination module configured to form a polynomial function based on the plurality of sampling point fits, and determine a first candidate peak and a first candidate valley based on the polynomial function;
the second peak-valley value determining module is used for carrying out differential solution of discrete sampling points based on the plurality of sampling points to determine a second candidate peak value and a second candidate valley value;
and the target peak-to-valley value determining module is used for determining the most value of the first candidate peak value and the second candidate peak value as the target peak value of the signal to be detected, and determining the most value of the first candidate valley value and the second candidate valley value as the target valley value of the signal to be detected.
8. The signal peak and valley determining device according to claim 7, wherein said forming a polynomial function based on said plurality of sample point fits and determining a first candidate peak and a first candidate valley based on said polynomial function comprises:
fitting the plurality of sampling points based on a Taylor regression function to form a polynomial function;
and performing quadratic derivation based on the polynomial function, and determining a first candidate peak value and a first candidate valley value based on the quadratic derivation result.
9. The signal peak and valley determining device according to claim 8, wherein said fitting the plurality of sampling points based on a taylor regression function forms a polynomial function, comprising:
fitting a symbol equation of a plurality of sampling points approximately by using a Taylor regression function;
performing feature discrimination based on the low-order polynomial of the symbol equation to obtain the functional feature of the symbol equation;
a polynomial function is formed based on the function features.
10. The apparatus of claim 7, wherein the determining the second candidate peak and the second candidate valley based on the differential solution of the discrete sampling points by the plurality of sampling points comprises:
splicing a plurality of sampling points to form a sampling vector;
calculating a first-order differential vector based on the sampling vector;
performing sign taking function operation based on the first-order differential vector to obtain a trend vector;
traversing the trend vector to carry out reassignment;
performing first-order differential operation based on the reassigned trend vector to obtain a differential vector;
a second candidate peak and a second candidate valley are determined based on the differential vector.
11. The peak and valley determining device of claim 7, wherein the peak and valley determining device of the signal further comprises:
and the verification module is used for comparing each adjacent value in the set neighborhood range of the target peak value with the target peak value and comparing each adjacent value in the set neighborhood range of the target valley value with the target valley value so as to verify the accuracy of the target peak value and the target valley value.
12. The peak and valley determining device of claim 7, wherein the peak and valley determining device of the signal further comprises:
and the smooth denoising module is used for carrying out smooth denoising processing on the signal to be measured based on a weighted moving average filtering method.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the peak and trough signal determination method according to any one of claims 1 to 6 when executing the program.
14. A machine readable storage medium having stored thereon a computer program which when executed by a processor implements the peak and trough signal determination method according to any one of claims 1 to 6.
CN202311108034.8A 2023-08-30 2023-08-30 Method and device for determining peak value and valley value of signal and electronic equipment Pending CN117194892A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311108034.8A CN117194892A (en) 2023-08-30 2023-08-30 Method and device for determining peak value and valley value of signal and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311108034.8A CN117194892A (en) 2023-08-30 2023-08-30 Method and device for determining peak value and valley value of signal and electronic equipment

Publications (1)

Publication Number Publication Date
CN117194892A true CN117194892A (en) 2023-12-08

Family

ID=88984301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311108034.8A Pending CN117194892A (en) 2023-08-30 2023-08-30 Method and device for determining peak value and valley value of signal and electronic equipment

Country Status (1)

Country Link
CN (1) CN117194892A (en)

Similar Documents

Publication Publication Date Title
CN111163690B (en) Arrhythmia detection method, arrhythmia detection device, electronic equipment and computer storage medium
CN108363493B (en) User characteristic model establishing method and system based on brain-computer interface and storage medium
CN111785288B (en) Voice enhancement method, device, equipment and storage medium
CN108919216B (en) Micro-motion characteristic acquisition method and device
CN112765550B (en) Target behavior segmentation method based on Wi-Fi channel state information
CN113325277A (en) Partial discharge processing method
CN111110224A (en) Electrocardiogram classification method and device based on multi-angle feature extraction
US10585130B2 (en) Noise spectrum analysis for electronic device
CN110702986B (en) Method and system for dynamically generating self-adaptive signal search threshold in real time
CN116756594A (en) Method, system, equipment and medium for detecting abnormal points of power grid data
CN110840401B (en) Heart rate value measuring method, device and equipment and readable storage medium
CN113837122B (en) Wi-Fi channel state information-based contactless human body behavior recognition method and system
WO2020061346A1 (en) Methods and apparatuses for tracking weak signal traces
CN114795248A (en) Electroencephalogram signal quality evaluation method and device, electronic equipment and medium
CN111666912B (en) Partial discharge fusion feature extraction method considering electrical feature quantity and graphic feature
CN117194892A (en) Method and device for determining peak value and valley value of signal and electronic equipment
CN116842447A (en) Post-processing method, device and system for classified data and electronic device
CN114118177B (en) Bit plane noise reduction method and system based on singular spectrum analysis and storage medium
CN111860397B (en) Cable force calculation method and calculation device for inhaul cable
CN116257737A (en) Novel power transmission line high-frequency fault signal noise reduction method based on automatic encoder
CN110176968B (en) Jump phenomenon correction method for WiFi human behavior recognition
CN112217749A (en) Blind signal separation method and device
CN115618206B (en) Interference data determining method and device, electronic equipment and storage medium
CN117542537B (en) Blood oxygen saturation change prediction method and device based on artificial intelligence
CN115363598B (en) Electrocardiosignal processing method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination