Wave crest detection method and system

文档序号:1941276 发布日期:2021-12-07 浏览:21次 中文

阅读说明:本技术 一种波峰检测方法及系统 (Wave crest detection method and system ) 是由 杨鸿元 于 2021-09-09 设计创作,主要内容包括:本发明公开了一种波峰检测方法及系统,通过获取待测波形波峰的数据序列,并将获取的待测波形波峰的数据序列作为输入值,存入循环数组中;比较循环数组中前一条数据与定义的最小值变量的大小,若循环数组中前一条数据小于预设的最小值变量,则将定义的最小值变量进行更新,将定义的最小值变量更新为循环数组中前一条数据;判定当前波峰振幅与预设的杂波过滤振幅的大小,若当前波峰振幅大于预设的杂波过滤振幅,则比较当前数据与相邻的前后数据的大小,并将比较的结果作为波峰判断依据。本发明可以对低于设定振幅值的杂波进行有效过滤,极大地减少因波形数据丢失造成的波峰数计算错误。(The invention discloses a wave crest detection method and a system, which are characterized in that a data sequence of a waveform wave crest to be detected is obtained, and the obtained data sequence of the waveform wave crest to be detected is stored in a cyclic array as an input value; comparing the previous data in the cyclic array with the defined minimum value variable, if the previous data in the cyclic array is smaller than the preset minimum value variable, updating the defined minimum value variable, and updating the defined minimum value variable into the previous data in the cyclic array; and judging the amplitude of the current wave crest and the preset clutter filtering amplitude, if the amplitude of the current wave crest is larger than the preset clutter filtering amplitude, comparing the current data with the adjacent previous and next data, and taking the comparison result as a wave crest judgment basis. The invention can effectively filter the clutter lower than the set amplitude value, thereby greatly reducing the wave crest number calculation error caused by the loss of waveform data.)

1. A peak detection method is characterized by comprising the following steps:

acquiring a data sequence of a waveform wave crest to be detected, and storing the acquired data sequence of the waveform wave crest to be detected into a cyclic array data [ ]asan input value;

comparing the size of a previous data [ i-1] in the loop array data [ ] with a defined minimum value variable minValue, if the previous data [ i-1] in the loop array data [ ] is smaller than a preset minimum value variable minValue, updating the defined minimum value variable minValue, and updating the defined minimum value variable minValue into the previous data [ i-1] in the loop array;

judging the amplitude of the current wave crest and the preset clutter filtering amplitude LIMIT _ LINE, if the amplitude of the current wave crest is larger than the preset clutter filtering amplitude LIMIT _ LINE, comparing the current data [ i ] with the adjacent front and back data, and taking the comparison result as a wave crest judgment basis; wherein the current peak amplitude is a difference value between the current data [ i ] and an updated minimum value variable minValue; the peak judging basis is that if the current data [ i ] is larger than the adjacent previous and next data, the current data [ i ] is determined to be a peak value.

2. The peak detecting method according to claim 1, wherein the step of obtaining the data sequence of the peak of the waveform to be detected and storing the obtained data sequence of the peak of the waveform to be detected as an input value into the cyclic array data [ ]includes:

and presetting a loop condition of the loop array data [ ], wherein the loop condition is from second data to last data in the data sequence of the loop array data [ ], and the index of the current array is the current loop sequence i.

3. The peak detection method according to claim 2, wherein the step of comparing the size of the previous data [ i-1] in the loop array data [ ] with the defined minimum variable minValue, and if the previous data [ i-1] in the loop array data [ ] is smaller than the preset minimum variable minValue, updating the defined minimum variable minValue, and updating the defined minimum variable minValue to the previous data [ i-1] in the loop array comprises:

judging the size between the previous data [ i-1] and a minimum value variable minValue;

and if the previous piece of data [ i-1] < the minimum variable minValue is identified, updating the value of the minimum variable minValue to the data [ i-1 ].

4. The peak detecting method according to claim 3, wherein the magnitude of the current peak amplitude and the preset clutter filtering amplitude LIMIT _ LINE is determined, and if the current peak amplitude is larger than the preset clutter filtering amplitude LIMIT _ LINE, the magnitude of the current data [ i ] and the magnitude of the adjacent previous and subsequent data are compared, and the comparison result is used as the peak determining basis; wherein the current peak amplitude is a difference value between the current data [ i ] and an updated minimum value variable minValue; the step of determining the current data [ i ] as a crest value if the current data [ i ] is larger than the adjacent previous and subsequent data according to the crest judgment basis comprises:

judging the magnitude between the current wave crest amplitude and the clutter filtering height LIMIT _ LINE, wherein the value of the current wave crest amplitude is the current data [ i ] -minimum variable minValue, if the current data [ i ] -minimum variable minValue > the clutter filtering height LIMIT _ LINE, continuing the next calculation, and if the current data [ i ] does not meet the peak value condition, continuing the next circulation;

comparing the size of the current data with the size of the adjacent previous and next data, taking the comparison result as a crest judgment basis, and if the current data [ i ] is larger than the previous data [ i-1] and the current data [ i ] is larger than the next data [ i +1 ]; or if the current data [ i ] ═ the previous piece of data [ i-1] and the current data [ i ] > the next piece of data [ i +1], determining that the current data [ i ] is a peak value;

and adding 1 to the number peak of the wave peaks in the cyclic array data and the cyclic counter i, and simultaneously recording the related information of the wave peak values.

5. The peak detecting method according to claim 4, wherein the magnitude of the current peak amplitude and the preset clutter filtering amplitude LIMIT _ LINE is determined, and if the current peak amplitude is larger than the preset clutter filtering amplitude LIMIT _ LINE, the magnitude of the current data [ i ] and the magnitude of the adjacent previous and subsequent data are compared, and the comparison result is used as the peak determining basis; wherein the current peak amplitude is a difference value between the current data [ i ] and an updated minimum value variable minValue; the step of determining the current data [ i ] as a crest value if the current data [ i ] is larger than the adjacent previous and subsequent data is further followed by the step of determining the current data [ i ] as a crest value:

and continuing the next cycle until the last data in the cycle array data [ ] is completely processed.

6. A peak detection system, comprising:

the acquisition module (10) is used for acquiring a data sequence of the waveform wave crest to be detected, and storing the acquired data sequence of the waveform wave crest to be detected as an input value into the cyclic array data [ ];

the comparison module (20) is used for comparing the size of the previous data [ i-1] in the loop array data [ ] with the defined minimum variable minValue, if the previous data [ i-1] in the loop array data [ ] is smaller than the preset minimum variable minValue, the defined minimum variable minValue is updated, and the defined minimum variable minValue is updated to the previous data [ i-1] in the loop array;

the judging module (30) is used for judging the amplitude of the current wave crest and the preset clutter filtering amplitude LIMIT _ LINE, if the amplitude of the current wave crest is larger than the preset clutter filtering amplitude LIMIT _ LINE, the current data [ i ] and the adjacent front and back data are compared, and the compared result is used as a wave crest judging basis; wherein the current peak amplitude is a difference value between the current data [ i ] and an updated minimum value variable minValue; the peak judging basis is that if the current data [ i ] is larger than the adjacent previous and next data, the current data [ i ] is determined to be a peak value.

7. The peak detection system according to claim 6, characterized in that the acquisition module (10) comprises:

and the setting unit (11) is used for presetting a loop condition of the loop array data [ ], wherein the loop condition is from second data to last data in a data sequence of the loop array data [ ], and the index of the current array is the current loop sequence i.

8. The peak detection system according to claim 7, wherein the comparison module (20) comprises:

a first decision unit (21) for deciding the size between the previous piece of data [ i-1] and a minimum value variable minValue;

an updating unit (22) for updating the value of the minimum variable minValue to data [ i-1] if the previous piece of data [ i-1] < minimum variable minValue is identified.

9. The peak detection system according to claim 8, wherein the decision module (30) comprises:

a second judging unit (31) for judging the magnitude between the current peak amplitude and the clutter filtering height LIMIT _ LINE, wherein the value of the current peak amplitude is the current data [ i ] -minimum value variable minValue, if the current data [ i ] -minimum value variable minValue > the clutter filtering height LIMIT _ LINE, the next calculation is continued, otherwise the current data [ i ] does not meet the peak condition, and the next circulation is continued;

the comparison unit (32) is used for comparing the size of the current data with the size of the adjacent previous and next data, taking the comparison result as a crest judgment basis, and if the current data [ i ] is larger than the previous data [ i-1] and the current data [ i ] is larger than the next data [ i +1 ]; or if the current data [ i ] ═ the previous piece of data [ i-1] and the current data [ i ] > the next piece of data [ i +1], determining that the current data [ i ] is a peak value;

and the calculating unit (33) is used for adding 1 to the number peak of the wave peaks in the cyclic array data and the cyclic counter i, and simultaneously recording the related information of the wave peak values.

10. The peak detection system of claim 9, further comprising:

and the processing module (40) is used for continuing the next cycle until all the penultimate data in the cycle array data [ ] are processed.

Technical Field

The invention relates to the technical field of communication, and particularly discloses a wave crest detection method and system.

Background

In the application of the internet of things, data of the internet of things equipment is usually remotely returned through a wireless network, and under the condition of large data volume and large calculation amount, the data is calculated and analyzed at a server end by adopting a framework of a light application end. However, due to problems such as network delay and interruption, phenomena such as data loss and hysteresis may occur, and when waveform data is processed in real time, partial data in a waveform may be lost or clutter interference may occur, which affects the counting of waveform frequency, i.e. the calculation of the number of wave peaks. As shown in fig. 1, there are (i) typical data loss and (ii) clutter.

In the process of calculating the number of peaks, if the peak is not properly processed, inaccurate counting can be caused due to data loss and clutter interference, and the situation of counting less or more occurs.

Therefore, the inaccurate wave crest number counting caused by data loss and clutter interference is a technical problem to be solved urgently.

Disclosure of Invention

The invention provides a wave crest detection method and a wave crest detection system, and aims to solve the technical problem of inaccurate wave crest counting caused by data loss and clutter interference.

One aspect of the present invention relates to a peak detection method, including the steps of:

acquiring a data sequence of a waveform wave crest to be detected, and storing the acquired data sequence of the waveform wave crest to be detected into a cyclic array data [ ]asan input value;

comparing the size of a previous data [ i-1] in the loop array data [ ] with a defined minimum value variable minValue, if the previous data [ i-1] in the loop array data [ ] is smaller than a preset minimum value variable minValue, updating the defined minimum value variable minValue, and updating the defined minimum value variable minValue into the previous data [ i-1] in the loop array;

judging the amplitude of the current wave crest and the preset clutter filtering amplitude LIMIT _ LINE, if the amplitude of the current wave crest is larger than the preset clutter filtering amplitude LIMIT _ LINE, comparing the current data [ i ] with the adjacent front and back data, and taking the comparison result as a wave crest judgment basis; wherein, the amplitude of the current peak is the difference value between the current data [ i ] and the updated minimum variable minValue; the crest judgment basis is that if the current data [ i ] is larger than the adjacent previous and next data, the current data [ i ] is determined to be a crest value.

Further, the step of obtaining a data sequence of the waveform wave peak to be detected, and storing the obtained data sequence of the waveform wave peak to be detected as an input value into the cyclic array data [ ], includes:

and presetting a loop condition of the loop array data [ ], wherein the loop condition is from second data to last data in the data sequence of the loop array data [ ], and the index of the current array is the current loop sequence i.

Further, the step of comparing the size of the previous data [ i-1] in the loop array data [ ] with the defined minimum variable minValue, and if the previous data [ i-1] in the loop array data [ ] is smaller than the preset minimum variable minValue, updating the defined minimum variable minValue, and updating the defined minimum variable minValue to the previous data [ i-1] in the loop array includes:

judging the size between the previous data [ i-1] and a minimum value variable minValue;

and if the previous piece of data [ i-1] < the minimum variable minValue is identified, updating the value of the minimum variable minValue to the data [ i-1 ].

Further, judging the amplitude of the current wave crest and the preset clutter filtering amplitude LIMIT _ LINE, if the amplitude of the current wave crest is larger than the preset clutter filtering amplitude LIMIT _ LINE, comparing the current data [ i ] with the adjacent front and back data, and taking the comparison result as a wave crest judgment basis; wherein, the amplitude of the current peak is the difference value between the current data [ i ] and the updated minimum variable minValue; the step of determining the current data [ i ] as a crest value if the current data [ i ] is larger than the adjacent previous and subsequent data according to the crest judgment basis comprises:

judging the magnitude between the current wave crest amplitude and the clutter filtering height LIMIT _ LINE, wherein the value of the current wave crest amplitude is current data [ i ] -minimum variable minValue, if the current data [ i ] -minimum variable minValue > the clutter filtering height LIMIT _ LINE, continuing the next calculation, and if the current data [ i ] does not meet the peak value condition, continuing the next circulation;

comparing the size of the current data with the size of the adjacent data before and after, taking the comparison result as a crest judgment basis, and if the current data [ i ] is larger than the previous data [ i-1] and the current data [ i ] is larger than the next data [ i +1 ]; or if the current data [ i ] ═ the previous piece of data [ i-1] and the current data [ i ] > the next piece of data [ i +1], determining that the current data [ i ] is a peak value;

and adding 1 to the number peak of the wave peaks in the cyclic array data and the cyclic counter i, and simultaneously recording the related information of the wave peak values.

Further, judging the amplitude of the current wave crest and the preset clutter filtering amplitude LIMIT _ LINE, if the amplitude of the current wave crest is larger than the preset clutter filtering amplitude LIMIT _ LINE, comparing the current data [ i ] with the adjacent front and back data, and taking the comparison result as a wave crest judgment basis; wherein, the amplitude of the current peak is the difference value between the current data [ i ] and the updated minimum variable minValue; the step of determining the current data [ i ] as a crest value further includes, after the step of determining the current data [ i ] as the crest value if the current data [ i ] is larger than the adjacent previous and subsequent data:

and continuing the next cycle until the last data in the cycle array data [ ] is completely processed.

Another aspect of the invention relates to a peak detection system comprising:

the acquisition module is used for acquiring a data sequence of the waveform wave crest to be detected, and storing the acquired data sequence of the waveform wave crest to be detected into the cyclic array data [ ]asan input value;

the comparison module is used for comparing the size of a previous data [ i-1] in the cyclic array data and a defined minimum variable minValue, if the previous data [ i-1] in the cyclic array data is smaller than the preset minimum variable minValue, the defined minimum variable minValue is updated, and the defined minimum variable minValue is updated to the previous data [ i-1] in the cyclic array;

the judging module is used for judging the amplitude of the current wave crest and the preset clutter filtering amplitude LIMIT _ LINE, if the amplitude of the current wave crest is larger than the preset clutter filtering amplitude LIMIT _ LINE, comparing the current data [ i ] with the adjacent front and back data, and taking the compared result as a wave crest judging basis; wherein, the amplitude of the current peak is the difference value between the current data [ i ] and the updated minimum variable minValue; the crest judgment basis is that if the current data [ i ] is larger than the adjacent previous and next data, the current data [ i ] is determined to be a crest value.

Further, the acquisition module includes:

and the setting unit is used for presetting a cycle condition of the cycle array data [ ], wherein the cycle condition is from second data to last data in a data sequence of the cycle array data [ ], and the index of the current array is the current cycle sequence i.

Further, the comparison module includes:

a first decision unit for deciding the size between the previous piece of data [ i-1] and a minimum value variable minValue;

and the updating unit is used for updating the value of the minimum value variable minValue into the data [ i-1] if the previous piece of data [ i-1] is identified to be less than the minimum value variable minValue.

Further, the determination module includes:

the second judging unit is used for judging the size between the current wave crest amplitude and the clutter filtering height LIMIT _ LINE, the value of the current wave crest amplitude is the current data [ i ] -minimum value variable minValue, if the current data [ i ] -minimum value variable minValue > the clutter filtering height LIMIT _ LINE, the next step of calculation is continued, and if the current data [ i ] does not meet the peak value condition, the next cycle is continued;

the comparison unit is used for comparing the size of the current data with the size of the adjacent data before and after the current data, taking the comparison result as a wave crest judgment basis, and if the current data [ i ] is larger than the previous data [ i-1] and the current data [ i ] is larger than the next data [ i +1 ]; or if the current data [ i ] ═ the previous piece of data [ i-1] and the current data [ i ] > the next piece of data [ i +1], determining that the current data [ i ] is a peak value;

and the calculating unit is used for adding 1 to the number peak of the wave peaks in the cyclic array data and the cyclic counter i, and simultaneously recording the related information of the wave peak values.

Further, the peak detecting system further comprises:

and the processing module is used for continuing the next cycle until all the data of the penultimate data in the cycle array data [ ] are processed.

The beneficial effects obtained by the invention are as follows:

the invention discloses a wave crest detection method and a system, which are characterized in that a data sequence of a waveform wave crest to be detected is obtained, and the obtained data sequence of the waveform wave crest to be detected is used as an input value and is stored into a cyclic array data [ ]; comparing the size of a previous data [ i-1] in the loop array data [ ] with a defined minimum value variable minValue, if the previous data [ i-1] in the loop array data [ ] is smaller than a preset minimum value variable minValue, updating the defined minimum value variable minValue, and updating the defined minimum value variable minValue into the previous data [ i-1] in the loop array; judging the amplitude of the current wave crest and the preset clutter filtering amplitude LIMIT _ LINE, if the amplitude of the current wave crest is larger than the preset clutter filtering amplitude LIMIT _ LINE, comparing the current data [ i ] with the adjacent front and back data, and taking the comparison result as a wave crest judgment basis; wherein, the amplitude of the current peak is the difference value between the current data [ i ] and the updated minimum variable minValue; the crest judgment basis is that if the current data [ i ] is larger than the adjacent previous and next data, the current data [ i ] is determined to be a crest value. The wave crest detection method and the system can still accurately calculate the number of the wave crests under the condition that a large amount of data is lost in a single waveform period; meanwhile, clutter lower than a set amplitude value can be effectively filtered, and wave crest number calculation errors caused by waveform data loss are greatly reduced.

Drawings

FIG. 1 is a diagram illustrating a waveform frequency count affected by partial data loss and clutter interference during data processing of a conventional waveform;

FIG. 2 is a schematic flow chart of a first embodiment of a peak detection method according to the present invention;

FIG. 3 is a schematic flow chart of a peak detection method according to a second embodiment of the present invention;

FIG. 4 is a schematic diagram illustrating a refinement flow of an embodiment of the step of comparing the previous data [ i-1] in the loop array data [ ] with the defined minimum variable minValue shown in FIG. 2, and if the previous data [ i-1] in the loop array data [ ] is smaller than the preset minimum variable minValue, updating the defined minimum variable minValue, and updating the defined minimum variable minValue to the previous data [ i-1] in the loop array;

fig. 5 is a diagram illustrating the judgment of the amplitude of the current peak and the preset clutter filtering amplitude LIMIT _ LINE shown in fig. 2, and if the amplitude of the current peak is greater than the preset clutter filtering amplitude LIMIT _ LINE, the current data [ i ] is compared with the adjacent previous and subsequent data, and the comparison result is used as a peak judgment basis; wherein, the amplitude of the current peak is the difference value between the current data [ i ] and the updated minimum variable minValue; the peak judging basis is that if the current data [ i ] is larger than the adjacent previous and next data, the current data [ i ] is determined to be a refining flow diagram of an embodiment in the step of peak value;

FIG. 6 is a schematic flow chart of a third embodiment of a peak detection method according to the present invention;

FIG. 7 is a schematic flow chart of a peak detection method according to a fourth embodiment of the present invention;

FIG. 8 is a waveform diagram illustrating a first test sample detection using the peak detection method of the present invention;

FIG. 9 is a waveform diagram illustrating a second test sample using the peak detection method of the present invention;

FIG. 10 is a waveform diagram illustrating a third exemplary test using the peak detection method of the present invention;

FIG. 11 is a functional block diagram of a first embodiment of a peak detection system provided in the present invention;

FIG. 12 is a functional block diagram of an embodiment of the acquisition module shown in FIG. 11;

FIG. 13 is a functional block diagram of one embodiment of a comparison module shown in FIG. 11;

FIG. 14 is a functional block diagram of one embodiment of a decision block shown in FIG. 11;

fig. 15 is a functional block diagram of a second embodiment of a peak detection system provided by the present invention.

The reference numbers illustrate:

10. an acquisition module; 20. a comparison module; 30. a decision module; 40. a processing module; 11. a setting unit; 21. a first determination unit; 22. an update unit; 31. a second determination unit; 32. a comparison unit; 33. and a computing unit.

Detailed Description

In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.

As shown in fig. 2, a first embodiment of the present invention provides a peak detection method, which includes the following steps:

step S100, acquiring a data sequence of the waveform wave crest to be detected, and storing the acquired data sequence of the waveform wave crest to be detected into a cyclic array data [ ] as an input value.

Initializing and configuring the system, wherein the configuration items comprise a defined global peak number counter peak, a data sequence, a clutter filtering amplitude LIMIT _ LINE and a minimum value variable minValue, and the initialization value of the global peak number counter peak is 0. The minimum variable minValue is used for storing the minimum value of each peak; and also for comparison calculations, initialised to the first record data 0 of the array. And acquiring a data sequence of the waveform wave crest to be detected, and storing the acquired data sequence of the waveform wave crest to be detected into the cyclic array data [ ] as an input value.

Step S200, comparing the size of the previous data [ i-1] in the loop array data [ ] with the defined minimum value variable minValue, and if the previous data [ i-1] in the loop array data [ ] is smaller than the preset minimum value variable minValue, updating the defined minimum value variable minValue, and updating the defined minimum value variable minValue into the previous data [ i-1] in the loop array.

And comparing the size of the previous data [ i-1] in the loop array data [ ] with a defined minimum value variable minValue, if the previous data [ i-1] in the loop array data [ ] is smaller than the preset minimum value variable minValue, updating the defined minimum value variable minValue, and taking the previous data [ i-1] in the loop array as the updated minimum value variable minValue.

Step S300, judging the amplitude of the current wave crest and the preset clutter filtering amplitude LIMIT _ LINE, if the amplitude of the current wave crest is larger than the preset clutter filtering amplitude LIMIT _ LINE, comparing the current data [ i ] with the adjacent front and back data, and taking the compared result as a wave crest judgment basis; wherein, the amplitude of the current peak is the difference value between the current data [ i ] and the updated minimum variable minValue; the crest judgment basis is that if the current data [ i ] is larger than the adjacent previous and next data, the current data [ i ] is determined to be a crest value.

Judging the amplitude of the current wave crest and a preset clutter filtering amplitude LIMIT _ LINE, if the amplitude of the current wave crest is larger than the preset clutter filtering amplitude LIMIT _ LINE, comparing the current data [ i ] with the adjacent data in the front and the back, and taking the comparison result as a wave crest judgment basis; wherein, the amplitude of the current peak is equal to the difference value between the current data [ i ] and the updated minimum variable minValue; the crest judgment basis is that if the current data [ i ] is larger than a plurality of adjacent previous and next data, the current data [ i ] is determined to be a crest value.

In the peak detection method provided by this embodiment, a data sequence of a waveform peak to be detected is obtained, and the obtained data sequence of the waveform peak to be detected is stored in a cyclic array data [ ] as an input value; comparing the size of a previous data [ i-1] in the loop array data [ ] with a defined minimum value variable minValue, if the previous data [ i-1] in the loop array data [ ] is smaller than a preset minimum value variable minValue, updating the defined minimum value variable minValue, and updating the defined minimum value variable minValue into the previous data [ i-1] in the loop array; judging the amplitude of the current wave crest and the preset clutter filtering amplitude LIMIT _ LINE, if the amplitude of the current wave crest is larger than the preset clutter filtering amplitude LIMIT _ LINE, comparing the current data [ i ] with the adjacent front and back data, and taking the comparison result as a wave crest judgment basis; wherein, the amplitude of the current peak is the difference value between the current data [ i ] and the updated minimum variable minValue; the crest judgment basis is that if the current data [ i ] is larger than the adjacent previous and next data, the current data [ i ] is determined to be a crest value. The wave crest detection method provided by the embodiment can still accurately calculate the number of wave crests under the condition that a large amount of data is lost in a single waveform period; meanwhile, clutter lower than a set amplitude value can be effectively filtered, and wave crest number calculation errors caused by waveform data loss are greatly reduced.

Further, please refer to fig. 3, where fig. 3 is a schematic flowchart of a second embodiment of the peak detection method provided in the present invention, and on the basis of the first embodiment, the step S100 of the peak detection method provided in the present embodiment includes:

step S110, presetting a loop condition of the loop array data [ ], wherein the loop condition is from the second data to the last-but-one data in the data sequence of the loop array data [ ], and the index of the current array is the current loop sequence i.

Presetting a cycle condition of a cycle array data [ ], wherein the cycle condition is from the second data of the cycle array data [ ] to the penultimate data; and the current array is indexed as the current loop sequence i.

In the peak detection method provided by this embodiment, a loop condition of the loop array data [ ] is preset, where the loop condition is from the second data to the last data in the data sequence of the loop array data [ ], and a subscript of the current array is the current loop sequence i. The wave crest detection method provided by the embodiment can still accurately calculate the number of wave crests under the condition that a large amount of data is lost in a single waveform period; meanwhile, clutter lower than a set amplitude value can be effectively filtered, and wave crest number calculation errors caused by waveform data loss are greatly reduced.

Preferably, referring to fig. 4, fig. 4 is a detailed flowchart of step S200 shown in fig. 2, in this embodiment, step S200 includes:

and step S210, judging the size between the previous piece of data [ i-1] and the minimum value variable minValue.

The size between the previous piece of data i-1 in the loop array data [ ] and the minimum variable minValue is compared.

Step S220, if the previous piece of data [ i-1] is identified to be less than the minimum value variable minValue, updating the value of the minimum value variable minValue to data [ i-1 ].

And if the previous data [ i-1] in the cyclic array data [ ] is identified to be smaller than the minimum variable minValue, updating the value of the minimum variable minValue to the data [ i-1 ].

In the peak detection method provided by the embodiment, the size between the previous data [ i-1] and the minimum variable minValue is judged; and if the previous piece of data [ i-1] < the minimum variable minValue is identified, updating the value of the minimum variable minValue to the data [ i-1 ]. The wave crest detection method provided by the embodiment can still accurately calculate the number of wave crests under the condition that a large amount of data is lost in a single waveform period; meanwhile, clutter lower than a set amplitude value can be effectively filtered, and wave crest number calculation errors caused by waveform data loss are greatly reduced.

Further, referring to fig. 5, fig. 5 is a detailed flowchart of step S200 shown in fig. 2, and in this embodiment, step S300 includes:

and S310, judging the magnitude between the current peak amplitude and the clutter filtering height LIMIT _ LINE, wherein the value of the current peak amplitude is the current data [ i ] -the minimum value variable minValue, if the current data [ i ] -the minimum value variable minValue > the clutter filtering height LIMIT _ LINE, continuing the next calculation, and if the current data [ i ] does not meet the peak value condition, continuing the next circulation.

And presetting a filtering height, filtering the waveform (clutter) lower than the preset height, and considering the waveform as invalid data without participating in calculation. The filtering method adopts relative values to calculate, namely the difference between the data and the minimum value in a single wave is compared with the filtering height for judgment without the value of the data, so that the filtering method is not influenced by the integral deviation of the data.

Step S320, comparing the size of the current data with the size of the adjacent data before and after, taking the comparison result as a crest judgment basis, and if the current data [ i ] is larger than the previous data [ i-1] and the current data [ i ] is larger than the next data [ i +1 ]; or the current data [ i ] ═ the previous piece of data [ i-1] and the current data [ i ] > the next piece of data [ i +1], determining that the current data [ i ] is a peak value.

The data exceeding the filtering height is recorded as effective data to judge the wave peak value, and the judgment is carried out by comparing with two adjacent points for four times instead of using a single peak value (maximum value) as a judgment basis, so that the misjudgment under the condition of smooth wave peaks can be avoided.

And step S330, adding 1 to the number peak of the wave peaks in the cyclic array data and the cyclic counter i, and simultaneously recording the related information of the wave peak values.

After identifying the wave peak, adding 1 to the wave peak number peak in the cyclic array data and the cyclic counter i, adding 1 to the wave peak number peak, and adding 1 to the cyclic counter i. And simultaneously recording the related information of the wave peak value: the method comprises the steps of recording peak value data position, peak point numerical value, single peak height (relative value), current peak number peak, current recording serial number i, trough value minValue, peak value data [ i ] and amplitude data [ i ] -minValue, wherein the recording mode can be direct output or file or database storage.

According to the wave crest detection method provided by the embodiment, the magnitude between the current wave crest amplitude and the clutter filtering height LIMIT _ LINE is judged, the value of the current wave crest amplitude is the current data [ i ] -minimum value variable minValue, if the current data [ i ] -minimum value variable minValue > the clutter filtering height LIMIT _ LINE, the next step of calculation is continued, and if the current data [ i ] does not meet the peak value condition, the next cycle is continued; comparing the size of the current data with the size of the adjacent data before and after, taking the comparison result as a crest judgment basis, and if the current data [ i ] is larger than the previous data [ i-1] and the current data [ i ] is larger than the next data [ i +1 ]; or if the current data [ i ] ═ the previous piece of data [ i-1] and the current data [ i ] > the next piece of data [ i +1], determining that the current data [ i ] is a peak value; and adding 1 to the number peak of the wave peaks in the cyclic array data and the cyclic counter i, and simultaneously recording the related information of the wave peak values. The wave crest detection method provided by the embodiment can still accurately calculate the number of wave crests under the condition that a large amount of data is lost in a single waveform period; meanwhile, clutter lower than a set amplitude value can be effectively filtered, and wave crest number calculation errors caused by waveform data loss are greatly reduced.

Preferably, please refer to fig. 6 and 7, fig. 6 is a schematic flowchart of a third embodiment of the peak detection method provided by the present invention, and on the basis of the first embodiment, after step S300, the method further includes:

and S400, continuing the next cycle until all the data of the penultimate data in the cycle array data are processed.

And continuing the next cycle until the last data in the cycle array data is finished, and finishing all data processing.

In the peak detection method provided by this embodiment, the next cycle is continued until all the data of the penultimate data in the cycle array data [ ] is processed. The wave crest detection method provided by the embodiment can still accurately calculate the number of wave crests under the condition that a large amount of data is lost in a single waveform period; meanwhile, clutter lower than a set amplitude value can be effectively filtered, and wave crest number calculation errors caused by waveform data loss are greatly reduced.

According to the method, a large amount of data loss can occur in a single waveform period (under the condition that the measured non-critical information loss reaches 60%), the number of wave crests can still be accurately calculated by the method for detecting the wave crests, and meanwhile, clutter lower than a set amplitude value can be effectively filtered. The following are experimental samples, sample data is real data collected from the internet of things equipment, and the sampling frequency is about 60-90 (the number of data records contained in each waveform):

[ example 1]

A data sequence (529 strip records) comprising 8 waveform records data [529] {104.8, 104.8, 104.8, 104.8, 106.2, 106.2, 106.2, 106.2, 106.2, 106.2, 105.4, 105.1, 105.1, 105.1, 105.1, 105.1, 104.8, 105.9, 106.2, 106.2, 104.8, 104.5, 104.5, 105.1, 105.9, 106.8, 107.9, 109.1, 110.5, 112.2, 113.9, 115.3, 117.3, 119.3, 121, 123, 124.7, 126.7, 128.4, 130.4, 132.4, 134.1, 136.1, 137.8, 139.8, 141.8, 143.5, 145.5, 147.2, 149.2, 150.9, 154.9, 154.4, 132.4, 134.1, 136.1, 136.8, 139.8, 141.8, 143.5, 145.5, 147.2, 117.2, 117.9, 117.9, 117.2, 117.9, 9.2, 167.2, 117.9.9.9, 117.9.1, 117.9.9, 117.9.9.2, 117.9.9.9, 122.1, 117.9.9.9.1, 117.9.9.9.2,117, 117, 117.2,117, 117.2,117.2,117, 117, 117.9.9.2,117, 122.2,117, 117.1, 117.2,117.9.9,117.9,117,117,117,117,117,117,117,117,117,117,117,117,117,122.9,117,122.9,117,122.9,122.9,122.1,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,120,117,117,122,117,117,117,117,122,120,120,122,117,120,117,117,117,120,120,117,117,117,117,117,117,117,117,117,117,117,117,120,117,117,120,117,117,117,117,117,117,117,117,117,117,120,117,120,120,117,117,117,117,117,117,117,117,117,117,117,120,120,117,117,120,117,117,120,117,117,117,120,120,117,117,120,120,120,117,117,117,117,117,120,117,117,101,117,117,117,117,120,120,117,117,117,117,117,117,117,117,117,117,117,117,117,117,120,117,117,117,117,117,117,120,120,120,117,117,117,101,101,120,101,101,117,117,117,117,117,117,120,117,117,120,120,117,120,120,117,117,117,117,117,117,120,117,117,117,120,120,120,117,117,120,120,101,101,120,101,120,120,101,101,117,101,101,117,117,101,120,117,117,117,117,117,117,117,117,117,117,117,101,120,117,117,117,117,117,117,117,117,117,117,117,117,120,120,117,117,117,120,101,101,101,101,120,117,117,117,117,117,117,117,120,117,117,117,117,117, 139.2, 141, 142.9, 144.7, 146.6, 148.4, 150.3, 152.3, 154.1, 156, 157.8, 159.7, 161.5, 163.4, 165.2, 167.1, 168.9, 170.9, 172.6, 174.6, 176.3, 178, 178, 178.3, 178, 176, 172.8, 168.6, 162.9, 155.8, 148.9, 139, 127.6, 114.5, 103.1, 100.5, 99.1, 99.1, 99.1, 99.9, 100.8, 101.9, 103.1, 104.5, 105.6, 107.1, 110.5, 108.5, 112.5, 114.2, 116.2, 119.9, 121.6, 123.6, 125.3, 151.5, 153.2, 155.2, 156.9, 158.9, 160.6, 162.6, 164.3, 166.3, 168, 170, 171.7, 173.7, 175.4, 177.4, 178, 178, 176.8, 174, 170.3, 164.9, 158.3, 150.3, 141, 129.8, 117.3, 102.8, 99.1, 98.2, 98.2, 98.2, 98, 98, 98.8, 100.2, 101.4, 102.5, 103.1, 103.1, 101.9, 99.1, 98.2, 98, 97.7, 98.2, 98.8, 98.8, 99.4, 99.4, 99.4, 99.4, 98.5, 97.4, 97.7, 98.8, 99.9, 101.4, 102.5, 103.9, 105.4, 107.1, 109.1, 110.8, 112.8, 114.8, 116.5, 118.5, 122.2, 120.2, 123.9, 125.9, 127.6, 129.6, 131.3, 133.3, 135.3, 137, 139, 140.7, 142.7, 142.7, 144.4, 146.4, 148.1, 150.1, 151.8, 153.8, 155.5, 157.5, 159.2, 161.2, 162.9, 164.9, 166.6, 168.6, 170.3, 172.3, 174, 176, 177.7, 178.3, 178.3, 176.8, 174.3, 170.6, 165.2, 158.6, 150.6, 141.2, 130.1, 117.6, 103.4, 98.5, 96.5, 97.1, 96.5, 98.2, 99.4, 100.8, 102.2, 103.6, 105.4, 107.1, 109.1, 110.8, 112.8, 114.5, 116.5, 118.2, 120.2, 121.9, 123.9, 125.6, 127.6, 129.3, 131.3, 133, 135, 136.7, 138.7, 140.1, 142.1, 143.8, 145.8, 145.8, 147.5, 149.5, 151.5, 153.2, 155.2, 156.9, 158.9, 160.9, 162.6, 164.6, 166.3, 168.3, 170, 172, 173.7, 175.7, 177.7, 178.3, 178.3, 177.1, 174.6, 170.9, 165.4, 158.9, 151.2, 141.8, 130.7, 118.2, 103.9, 99.1, 97.1, 95.7, 96.2, 95.7, 97.4, 98.5, 99.9, 101.4, 102.8, 104.5, 106.5, 108.2, 110.2, 112.2, 113.9, 115.6, 117.6, 119.6, 121.3, 123, 125, 127, 128.7, 130.4, 132.4, 134.4, 136.1, 138.1, 139.8, 141.8, 143.5, 145.5, 147.2, 147.2, 149.2, 150.9, 152.9, 154.6, 156.6, 158.3, 160.3, 162, 164, 165.7, 167.7, 169.4, 171.4, 172.8, 174.8, 176.5, 178.3, 178.3, 177.7, 175.7, 172.3, 167.7, 161.7, 154.3, 145.2, 135, 122.7, 108.8, 99.7, 96.8, 95.1, 95.1, 95.7, 96.8, 98.2, 99.4, 101.1, 102.5, 104.2, 106.2, 107.9, 109.9, 111.6, 113.6, 115.3, 117.3, 119, 121, 122.7, 124.7, 126.4, 128.4, 130.1, 132.1, 133.8, 135.8, 137.5, 139.5, 141.2, 143.2, 144.9, 146.9, 148.6, 148.6, 150.6, 152.3, 154.3, 156, 158, 159.7, 161.7, 163.4, 165.4, 167.1, 169.1, 170.9, 172.8, 174.6, 176.5, 178.3, 178.3, 177.7, 176, 172.8, 168.6, 162.6, 155.8, 147.2, 137.2, 125.3, 112.2, 101.4, 97.7, 94.8, 94.5, 94.5, 95.1, 96.2, 97.4, 98.8, 100.5, 102.2, 103.9, 107.6, 105.6, 109.6, 111.3, 113, 115, 117, 118.7, 120.7, 122.4, 124.4, 126.1, 127.9, 129.8, 131.6, 133.5, 135.5, 137.2, 139, 141, 142.9, 144.7, 146.4, 146.4, 148.4, 150.1, 152.1, 154.1, 155.8, 157.8, 159.5, 161.2, 163.2, 165.2, 166.9, 168.9, 170.6, 172.6, 174.3, 176.3, 178.3, 178, 176.3, 173.4, 111.6, 113.3}

The data waveform is shown in fig. 8, and the calculation result is shown in table 1:

wave crest meterNumber of Peak value of wave Wave trough value Amplitude of vibration Number of wave peak
1 178.3 104.5 73.8 65
2 178.3 100.8 77.5 139
3 178 99.1 78.9 187
4 178.3 97.4 80.9 272
5 178.3 96.5 81.8 334
6 178.3 95.7 82.6 397
7 178.3 95.1 83.2 460
8 178.3 94.5 83.8 523

TABLE 1

The calculation result is consistent with the actual result.

[ example 2 ]

The simulation data loss rate is 15%, 8-11 records of each data deletion section of the data sequence data [529] are unequal, and the remaining data sequence (447 records) data [447] - {104.8, 104.8, 104.1, 105.1, 105.1, 105.1, 105.1, 105.1, 104.8, 105.9, 106.2, 106.2, 104.8, 104.5, 104.5, 105.1, 105.9, 106.8, 107.9, 109.1, 110.5, 112.2, 113.9, 115.3, 117.3, 119.3, 121, 123, 124.7, 126.7, 128.4, 130.4, 132.4, 134.1, 136.1, 137.8, 139.8, 141.8, 143.5, 145.5, 147.2, 149.2, 150.9, 154.9, 156.6, 160.1, 136.8, 137.8, 139.7, 117.1, 117.9, 117.1, 117.2, 117.9.2, 117.9, 117.1, 117.2, 117.3.2, 117.3, 117.7, 117.2, 117.7, 117.9, 117.9, 117.9, 117.9, 160.9.1, 117.7, 117.9.1, 117.2, 117.9, 117.9, 117.9, 117.1, 117.9.9, 117.1, 117.9.1, 117.9, 117.9, 117.9, 117.9.1, 117.1, 117.9.1, 117.9.9.1, 117.9.9.1.1, 117.1, 117.9.9, 117.9.1, 117.9.9.9.9.1, 117.1, 117.9.1, 117.1, 117.9.9.9.9, 117.1, 117.9.9.1, 117.9, 117.9.9, 117.1, 117.9, 117.9.1, 117.1, 117.9.1, 117.9, 117.9.9, 117.1, 117.9.9.1, 117.1, 117.9.1, 117.9.9.9.9.9.9.9.9.9.1, 117.1, 117.9.9.9.9.9.1, 117.9.9.9.9.9.9.9.1, 117.1, 117.9.1, 117.9.9.9.9.9.1, 117.1, 117.9.9.1, 117.9.9.9.9.9.1, 117.9.9.9.9.1, 117.1, 117.9.1, 117.9.9.9.9.1, 117.1, 117.9.1, 117.9.9.1, 117.9.7, 117.9.9.7, 117.1, 117.9.9.1, 117.9.9.9.9.1, 117.9.1, 117.9.9.9.9.1, 117.1, 117.9.9.1, 117.1, 163.4, 165.2, 167.1, 168.9, 170.9, 172.6, 174.6, 176.3, 178, 178, 178.3, 99.1, 99.1, 99.1, 99.9, 100.8, 101.9, 103.1, 104.5, 105.6, 107.1, 110.5, 108.5, 112.5, 114.2, 116.2, 119.9, 121.6, 123.6, 125.3, 151.5, 153.2, 155.2, 156.9, 158.9, 160.6, 162.6, 164.3, 166.3, 168, 170, 171.7, 173.7, 175.4, 177.4, 178, 178, 176.8, 174, 170.3, 164.9, 158.3, 150.3, 141, 129.8, 117.3, 102.8, 99.1, 98.2, 98.2, 98.2, 98, 98, 98.8, 100.2, 101.4, 102.5, 103.1, 98.5, 97.4, 97.7, 98.8, 99.9, 101.4, 102.5, 103.9, 105.4, 107.1, 109.1, 110.8, 112.8, 114.8, 116.5, 118.5, 122.2, 120.2, 123.9, 125.9, 127.6, 129.6, 131.3, 133.3, 135.3, 137, 139, 140.7, 142.7, 142.7, 144.4, 146.4, 148.1, 150.1, 151.8, 153.8, 155.5, 157.5, 159.2, 161.2, 162.9, 164.9, 166.6, 168.6, 170.3, 172.3, 174, 176, 177.7, 178.3, 178.3, 176.8, 174.3, 170.6, 165.2, 158.6, 150.6, 141.2, 130.1, 117.6, 103.4, 98.5, 96.5, 97.1, 96.5, 98.2, 99.4, 100.8, 102.2, 103.6, 105.4, 107.1, 109.1, 110.8, 112.8, 114.5, 116.5, 118.2, 120.2, 142.1, 143.8, 145.8, 145.8, 147.5, 149.5, 151.5, 153.2, 155.2, 156.9, 158.9, 160.9, 162.6, 164.6, 166.3, 168.3, 170, 172, 173.7, 175.7, 99.1, 97.1, 95.7, 96.2, 95.7, 97.4, 98.5, 99.9, 101.4, 102.8, 104.5, 106.5, 108.2, 110.2, 112.2, 113.9, 115.6, 117.6, 119.6, 121.3, 123, 125, 127, 128.7, 130.4, 132.4, 134.4, 136.1, 138.1, 139.8, 141.8, 143.5, 145.5, 147.2, 147.2, 149.2, 150.9, 152.9, 154.6, 156.6, 158.3, 160.3, 162, 164, 165.7, 167.7, 169.4, 171.4, 172.8, 174.8, 176.5, 178.3, 178.3, 177.7, 175.7, 172.3, 167.7, 161.7, 154.3, 145.2, 135, 122.7, 108.8, 99.7, 96.8, 95.1, 95.1, 95.7, 96.8, 98.2, 99.4, 101.1, 102.5, 104.2, 106.2, 107.9, 109.9, 111.6, 113.6, 115.3, 117.3, 119, 121, 122.7, 124.7, 126.4, 128.4, 130.1, 132.1, 133.8, 135.8, 137.5, 139.5, 141.2, 143.2, 144.9, 146.9, 148.6, 148.6, 150.6, 152.3, 154.3, 156, 158, 159.7, 161.7, 163.4, 165.4, 167.1, 169.1, 170.9, 172.8, 174.6, 176.5, 178.3, 178.3, 177.7, 176, 172.8, 168.6, 162.6, 155.8, 147.2, 137.2, 125.3, 112.2, 101.4, 97.7, 94.8, 94.5, 94.5, 95.1, 96.2, 97.4, 98.8, 100.5, 102.2, 103.9, 107.6, 105.6, 109.6, 111.3, 113, 115, 117, 118.7, 120.7, 122.4, 124.4, 126.1, 127.9, 129.8, 131.6, 133.5, 135.5, 137.2, 139, 141, 142.9, 144.7, 146.4, 157.8, 159.5, 161.2, 163.2, 165.2, 166.9, 168.9, 170.6, 172.6, 174.3, 176.3, 178.3, 178, 176.3, 173.4, 111.6, 113.3}

The data waveform is shown in fig. 9, and the calculation result is shown in table 2:

wave peak counting Peak value of wave Wave trough value Amplitude of vibration Number of wave peak
1 178.3 104.5 73.8 56
2 178.3 100.8 77.5 112
3 178.0 99.1 78.9 148
4 178.3 97.4 80.9 220
5 175.7 96.5 79.2 268
6 178.3 95.7 82.6 321
7 178.3 95.1 83.2 384
8 178.3 94.5 83.8 441

TABLE 2

[ example 3 ]

The simulation data loss rate is 62%, each segment of data of the data sequence data [529] is deleted with 8-11 records unequal, and the remaining data sequence (199 records) data [199] is {104.8, 104.8, 106.8, 107.9, 109.1, 110.5, 112.2, 113.9, 115.3, 117.3, 119.3, 121, 123, 124.7, 126.7, 128.4, 130.4, 132.4, 134.1, 136.1, 137.8, 139.8, 141.8, 143.5, 166, 167.7, 169.7, 171.4, 173.4, 175.1, 177.1, 178.3, 117.9, 117.9, 117.9, 117.9, 117.9, 117.9, 117.9, 117.9, 117.9, 117.9, 117.9, 117, 114.8, 111.1, 105.9, 102.2, 101.9, 117.9, 117.9, 117.9, 117.9, 117.9, 117.9, 117.9, 117.117.9, 117.9, 117.1, 114.8, 111.1, 105.9, 101.2, 2, 123.1, 165.1, 123.1, 170.1, 170.2.1, 170.1, 170.2.2.2.2.1, 170.1, 170.2.1, 170.1, 123.1, 170.2.1, 123.1, 123.3.1, 123.1, 123.3.1, 123.9, 123.1, 123.7.9, 123.9, 123.8, 123.7, 123.9, 123.2.9, 123.9, 123.2.9, 123.9, 150.9, 123.2.2.9, 123.9, 123.2.2.2.2.2.2.2.2, 123.2.2.2.2.2.2.2.2.2.2.1, 170.2.2.2.2.2.2.2.2.2, 170.2, 123.2, 170.2, 170.8, 123.2, 170.1, 123.2.1, 123.1, 170.2.1, 150, 170.8, 170.1, 170.8, 170.2.7, 170.8, 170.2.1, 123.2.2.2.1, 170.1, 170.3.8, 170.7.7, 170.1, 170.7, 170.8, 123.7, 170.3.3.3.3.3.3.3.8, 123.7, 123.8, 123.7, 123.3.8, 123.8, 123.7.7, 123.7, 123.8, 123.7, 123.8, 123.7.1, 123.7.7, 123.7, 123.7.7.7, 123.7.9, 123.1, etc., 99.1, 98.2, 98.2, 120.2, 123.9, 125.9, 127.6, 129.6, 131.3, 133.3, 135.3, 137, 139, 140.7, 142.7, 161.2, 176.8, 174.3, 170.6, 165.2, 158.6, 150.6, 141.2, 130.1, 117.6, 103.4, 98.5, 96.5, 97.1, 160.9, 162.6, 164.6, 166.3, 168.3, 170, 172, 173.7, 175.7, 99.1, 97.1, 97.4, 115.6, 117.6, 119.6, 121.3, 123, 125, 127, 128.7, 130.4, 132.4, 147.2, 149.2, 156.6, 158.3, 160.3, 162, 164, 165.7, 167.7, 178.3, 177.7, 175.7, 172.3, 167.7, 161.7, 154.3, 145.2, 135, 122.7, 108.8, 99.7, 96.8, 95.1, 115.3, 117.3, 119, 121, 122.7, 124.7, 126.4, 128.4, 130.1, 132.1, 133.8, 135.8, 158, 159.7, 161.7, 163.4, 165.4, 167.1, 169.1, 170.9, 172.8, 174.6, 176.5, 125.3, 112.2, 101.4, 97.7, 94.8, 94.5, 94.5, 95.1, 96.2, 97.4, 98.8, 100.5, 129.8, 131.6, 133.5, 135.5, 137.2, 139, 141, 142.9, 144.7, 146.4, 157.8, 159.5, 161.2, 163.2, 165.2, 166.9, 168.9, 170.6, 172.6, 174.3, 176.3, 111.6, 113.3}

The data waveform is shown in fig. 10, and the calculation result is shown in table 3:

wave peak counting Peak value of wave Wave trough value Amplitude of vibration Number of wave peak
1 178.3 104.8 73.5 25
2 172.6 101.4 71.1 52
3 178.0 100.8 77.2 68
4 176.8 98.2 78.6 93
5 175.7 96.5 79.1 114
6 178.3 96.5 81.8 133
7 176.5 95.1 81.4 169
8 176.3 94.5 81.8 196

TABLE 3

As shown in fig. 11, the present embodiment further provides a peak detection system, which includes an obtaining module 10, a comparing module 20, and a determining module 30, where the obtaining module 10 is configured to obtain a data sequence of a waveform peak to be detected, and store the obtained data sequence of the waveform peak to be detected as an input value into a cyclic array data [ ]; the comparison module 20 is configured to compare the size of a previous data [ i-1] in the loop array data [ ] with a defined minimum variable minValue, and update the defined minimum variable minValue if the previous data [ i-1] in the loop array data [ ] is smaller than a preset minimum variable minValue, and update the defined minimum variable minValue into the previous data [ i-1] in the loop array; the judging module 30 is configured to judge the amplitude of the current peak and a preset clutter filtering amplitude LIMIT _ LINE, and if the amplitude of the current peak is greater than the preset clutter filtering amplitude LIMIT _ LINE, compare the current data [ i ] with the adjacent previous and subsequent data, and use the comparison result as a peak judgment basis; wherein, the amplitude of the current peak is the difference value between the current data [ i ] and the updated minimum variable minValue; the crest judgment basis is that if the current data [ i ] is larger than the adjacent previous and next data, the current data [ i ] is determined to be a crest value.

The obtaining module 10 initializes and configures the system, where the configuration items include a defined global peak number counter peak, a data sequence, a clutter filtering amplitude LIMIT _ LINE, and a minimum value variable minValue, where an initialization value of the global peak number counter peak is 0. The minimum variable minValue is used for storing the minimum value of each peak; and also for comparison calculations, initialised to the first record data 0 of the array. And acquiring a data sequence of the waveform wave crest to be detected, and storing the acquired data sequence of the waveform wave crest to be detected into the cyclic array data [ ] as an input value.

The comparison module 20 compares the size of the previous data [ i-1] in the loop array data [ ] with a defined minimum value variable minValue, and updates the defined minimum value variable minValue if the previous data [ i-1] in the loop array data [ ] is smaller than a preset minimum value variable minValue, and takes the previous data [ i-1] in the loop array as the updated minimum value variable minValue.

The judging module 30 judges the amplitude of the current peak and a preset clutter filtering amplitude LIMIT _ LINE, if the amplitude of the current peak is larger than the preset clutter filtering amplitude LIMIT _ LINE, the current data [ i ] and the adjacent data before and after the current data are compared, and the compared result is used as a peak judging basis; wherein, the amplitude of the current peak is equal to the difference value between the current data [ i ] and the updated minimum variable minValue; the crest judgment basis is that if the current data [ i ] is larger than a plurality of adjacent previous and next data, the current data [ i ] is determined to be a crest value.

In the wave crest detection system provided by the embodiment, the data sequence of the waveform wave crest to be detected is obtained and is stored into the cyclic array data [ ] as an input value; comparing the size of a previous data [ i-1] in the loop array data [ ] with a defined minimum value variable minValue, if the previous data [ i-1] in the loop array data [ ] is smaller than a preset minimum value variable minValue, updating the defined minimum value variable minValue, and updating the defined minimum value variable minValue into the previous data [ i-1] in the loop array; judging the amplitude of the current wave crest and the preset clutter filtering amplitude LIMIT _ LINE, if the amplitude of the current wave crest is larger than the preset clutter filtering amplitude LIMIT _ LINE, comparing the current data [ i ] with the adjacent front and back data, and taking the comparison result as a wave crest judgment basis; wherein, the amplitude of the current peak is the difference value between the current data [ i ] and the updated minimum variable minValue; the crest judgment basis is that if the current data [ i ] is larger than the adjacent previous and next data, the current data [ i ] is determined to be a crest value. The wave crest detection system provided by the embodiment can still accurately calculate the number of wave crests under the condition that a large amount of data is lost in a single waveform period; meanwhile, clutter lower than a set amplitude value can be effectively filtered, and wave crest number calculation errors caused by waveform data loss are greatly reduced.

Further, referring to fig. 12, fig. 12 is a functional module schematic diagram of an embodiment of the obtaining module shown in fig. 11, in this embodiment, the obtaining module 10 includes a setting unit 11, where the setting unit 11 is configured to preset a loop condition of the loop array data [ ], the loop condition is from second data to last data in a data sequence of the loop array data [ ], and a current array index is a current loop sequence i.

The setting unit 11 presets a cycle condition of the cycle array data [ ], wherein the cycle condition is from the second data to the penultimate data of the cycle array data [ ]; and the current array is indexed as the current loop sequence i.

In the peak detection system provided by this embodiment, a loop condition of the loop array data [ ] is preset, where the loop condition is from the second data to the last data in the data sequence of the loop array data [ ], and an index of the current array is the current loop sequence i. The wave crest detection system provided by the embodiment can still accurately calculate the number of wave crests under the condition that a large amount of data is lost in a single waveform period; meanwhile, clutter lower than a set amplitude value can be effectively filtered, and wave crest number calculation errors caused by waveform data loss are greatly reduced.

Preferably, referring to fig. 13, fig. 13 is a functional module schematic diagram of an embodiment of the comparison module shown in fig. 11, in this embodiment, the comparison module 20 includes a first determination unit 21 and an update unit 22, where the first determination unit 21 is configured to determine a size between a previous piece of data [ i-1] and a minimum value variable minValue; and the updating unit 22 is used for updating the value of the minimum value variable minValue into the data [ i-1] if the previous piece of data [ i-1] is identified to be less than the minimum value variable minValue.

The first decision unit 21 compares the magnitude between the previous piece of data i-1 in the loop array data and the minimum value variable minValue.

If the updating unit 22 identifies that the previous data [ i-1] in the loop array data [ ] is smaller than the minimum value variable minValue, the value of the minimum value variable minValue is updated to data [ i-1 ].

In the peak detection system provided by the embodiment, the size between the previous data [ i-1] and the minimum variable minValue is judged; and if the previous piece of data [ i-1] < the minimum variable minValue is identified, updating the value of the minimum variable minValue to the data [ i-1 ]. The wave crest detection system provided by the embodiment can still accurately calculate the number of wave crests under the condition that a large amount of data is lost in a single waveform period; meanwhile, clutter lower than a set amplitude value can be effectively filtered, and wave crest number calculation errors caused by waveform data loss are greatly reduced.

Further, referring to fig. 14, fig. 14 is a functional module schematic diagram of an embodiment of the determining module shown in fig. 11, in this embodiment, the determining module 30 includes a second determining unit 31, a comparing unit 32 and a calculating unit 33, where the second determining unit 31 is configured to determine a magnitude between a current peak amplitude and a clutter filtering height LIMIT _ LINE, a value of the current wave amplitude is current data [ i ] -a minimum value variable minValue, if the current data [ i ] -the minimum value variable minValue > the clutter filtering height LIMIT _ LINE, the next calculation is continued, otherwise, the current data [ i ] does not satisfy a peak condition, and the next cycle is continued; the comparison unit 32 is used for comparing the size of the current data with the size of the adjacent data before and after, taking the comparison result as a wave crest judgment basis, and if the current data [ i ] is larger than the previous data [ i-1] and the current data [ i ] is larger than the next data [ i +1 ]; or if the current data [ i ] ═ the previous piece of data [ i-1] and the current data [ i ] > the next piece of data [ i +1], determining that the current data [ i ] is a peak value; and the calculating unit 33 is used for adding 1 to the number peak of the wave peaks in the loop array data and the loop counter i, and simultaneously recording the relevant information of the wave peak values.

And presetting a filtering height, filtering the waveform (clutter) lower than the preset height, and considering the waveform as invalid data without participating in calculation. The filtering method adopts relative values to calculate, namely the difference between the data and the minimum value in a single wave is compared with the filtering height for judgment without the value of the data, so that the filtering method is not influenced by the integral deviation of the data.

The data exceeding the filtering height is recorded as effective data to judge the wave peak value, and the judgment is carried out by comparing with two adjacent points for four times instead of using a single peak value (maximum value) as a judgment basis, so that the misjudgment under the condition of smooth wave peaks can be avoided.

After identifying the wave peak, adding 1 to the wave peak number peak in the cyclic array data and the cyclic counter i, adding 1 to the wave peak number peak, and adding 1 to the cyclic counter i. And simultaneously recording the related information of the wave peak value: the method comprises the steps of recording peak value data position, peak point numerical value, single peak height (relative value), current peak number peak, current recording serial number i, trough value minValue, peak value data [ i ] and amplitude data [ i ] -minValue, wherein the recording mode can be direct output or file or database storage.

According to the wave crest detection system provided by the embodiment, the magnitude between the current wave crest amplitude and the clutter filtering height LIMIT _ LINE is judged, the value of the current wave crest amplitude is the current data [ i ] -the minimum value variable minValue, if the current data [ i ] -the minimum value variable minValue > the clutter filtering height LIMIT _ LINE, the next step of calculation is continued, and if the current data [ i ] does not meet the peak value condition, the next cycle is continued; comparing the size of the current data with the size of the adjacent data before and after, taking the comparison result as a crest judgment basis, and if the current data [ i ] is larger than the previous data [ i-1] and the current data [ i ] is larger than the next data [ i +1 ]; or if the current data [ i ] ═ the previous piece of data [ i-1] and the current data [ i ] > the next piece of data [ i +1], determining that the current data [ i ] is a peak value; and adding 1 to the number peak of the wave peaks in the cyclic array data and the cyclic counter i, and simultaneously recording the related information of the wave peak values. The wave crest detection system provided by the embodiment can still accurately calculate the number of wave crests under the condition that a large amount of data is lost in a single waveform period; meanwhile, clutter lower than a set amplitude value can be effectively filtered, and wave crest number calculation errors caused by waveform data loss are greatly reduced.

Preferably, please refer to fig. 15, fig. 15 is a functional block diagram of a second embodiment of the peak detection system provided by the present invention, and on the basis of the first embodiment, the peak detection system further includes a processing module 40, where the processing module 40 is configured to continue the next cycle until all the penultimate data in the cycle array data [ ] is processed.

The processing module 40 continues the next cycle until the cycle is completed to the last data in the cycle array data [ ], and all the data are processed.

The peak detection system provided by this embodiment continues the next cycle until all the data of the penultimate data in the cycle array data [ ] is processed. The wave crest detection system provided by the embodiment can still accurately calculate the number of wave crests under the condition that a large amount of data is lost in a single waveform period; meanwhile, clutter lower than a set amplitude value can be effectively filtered, and wave crest number calculation errors caused by waveform data loss are greatly reduced.

The method and the system for detecting the wave crest provided by the embodiment have the following beneficial effects:

1. and presetting a filtering height, filtering the waveform (clutter) lower than the preset height, and considering the waveform as invalid data without participating in calculation.

2. The calculation is carried out by adopting a relative value, namely, the judgment is carried out by comparing the difference between the data and the minimum value in a single wave with the filtering height instead of the value of the data, so that the influence of the integral deviation of the data can be avoided.

2. The data exceeding the filtering height is recorded as effective data to judge the wave peak value, and the judgment is carried out by comparing with two adjacent points for four times instead of using a single peak value (maximum value) as a judgment basis, so that the misjudgment under the condition of smooth wave peaks can be avoided.

3. After identifying the peak, recording peak data position, peak point value and single peak height (relative value).

While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention. It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

27页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:无线电测向定位方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!