CN108918982B - Method for acquiring signal peak value - Google Patents

Method for acquiring signal peak value Download PDF

Info

Publication number
CN108918982B
CN108918982B CN201810831616.1A CN201810831616A CN108918982B CN 108918982 B CN108918982 B CN 108918982B CN 201810831616 A CN201810831616 A CN 201810831616A CN 108918982 B CN108918982 B CN 108918982B
Authority
CN
China
Prior art keywords
signal
value
detected
wave signal
steamed bread
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.)
Active
Application number
CN201810831616.1A
Other languages
Chinese (zh)
Other versions
CN108918982A (en
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.)
Hanyu Group JSCL
Original Assignee
Hanyu Group JSCL
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 Hanyu Group JSCL filed Critical Hanyu Group JSCL
Priority to CN201810831616.1A priority Critical patent/CN108918982B/en
Publication of CN108918982A publication Critical patent/CN108918982A/en
Application granted granted Critical
Publication of CN108918982B publication Critical patent/CN108918982B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R29/00Arrangements for measuring or indicating electric quantities not covered by groups G01R19/00 - G01R27/00

Abstract

The invention relates to a method for acquiring a signal peak value, which comprises the following steps: acquiring a signal to be detected, and converting the signal to be detected into a steamed bun wave signal with the same frequency as the signal to be detected; acquiring an AD value of the steamed bread wave signal in real time; counting the AD value of the steamed bun wave signal once every set interval time, and calculating and storing the average value of the AD values of the steamed bun wave signal in the set interval time; and when the number of the stored average values reaches a set number, sorting the average values to obtain the maximum average value as a signal peak value. Compared with the prior art, the method has the advantages that the signal to be detected is converted into the steamed bun wave signal, the average value of the AD values of the steamed bun wave signal is counted once at intervals of the set time, and the maximum value is obtained according to the obtained average value of the AD values, so that the calculation time is shortened, the detection efficiency is improved, and the cost is saved.

Description

Method for acquiring signal peak value
Technical Field
The present invention relates to the field of signal detection, and in particular, to a method for obtaining a signal peak.
Background
The peak value, which is the size of the variation range of the signal value, reflects the very important aspect of the signal, and the detection and/or acquisition of the peak value becomes a problem to be emphasized in the fields of electronic measurement, automation meters and other related technologies.
In the conventional technique, the peak is detected and/or obtained by detecting the zero crossing point of the signal and then obtaining the peak through time delay. This approach requires the addition of a zero-crossing detection circuit, which increases the cost; and after a zero-crossing detection circuit is added, the problem of signal distortion is easy to occur, the detection precision is not high, and the reliability is reduced.
Disclosure of Invention
Based on this, the present invention provides a method for obtaining a signal peak, which has the advantages of reducing the calculation time, improving the detection efficiency and saving the cost.
A method for obtaining a signal peak, comprising the steps of:
acquiring a signal to be detected, and converting the signal to be detected into a steamed bun wave signal with the same frequency as the signal to be detected; the signal to be detected is a periodic alternating current signal;
acquiring an AD value of the steamed bread wave signal in real time;
counting the AD values of the steamed bread wave signals once every set time interval, sequencing the AD values of the steamed bread wave signals within the set time interval, removing the maximum value and the minimum value of the set number, calculating the average value of the AD values of the rest steamed bread wave signals, and storing the average value;
when the number of the stored average values reaches a set number, sorting the average values to obtain the maximum average value as a signal peak value; the set number is N1000/(f × T), where f is the frequency of the signal to be measured, and T is the interval set time.
Compared with the prior art, the method has the advantages that the signal to be detected is converted into the steamed bun wave signal, the average value of the AD values of the steamed bun wave signal is counted once at intervals of the set time, and the maximum value is obtained according to the obtained average value of the AD values, so that the calculation time is shortened, the detection efficiency is improved, and the cost is saved.
Further, the steamed bread wave signal is: the positive value part of the steamed bread wave signal is the positive value of the signal to be detected, and the 0 value of the steamed bread wave signal is the 0 value of the signal to be detected or the negative value of the signal to be detected.
Further, the steamed bread wave signal is: the positive value part of the steamed bread wave signal is the positive value of the signal to be detected and/or the positive value of the inverted negative value of the signal to be detected.
Further, the acquiring the AD value of the steamed bread wave signal in real time includes: performing analog-to-digital conversion on the steamed bun wave signal to obtain a digital signal; and acquiring the value of the digital signal in real time as the AD value of the steamed bread wave signal.
The invention also provides a computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method for obtaining a peak value of a signal as described above.
The invention also provides a computer device comprising a storage, a processor and a computer program stored in the storage and executable by the processor, wherein the processor executes the computer program to implement the steps of the signal peak value obtaining method as described above.
For a better understanding and practice, the invention is described in detail below with reference to the accompanying drawings.
Drawings
FIG. 1 is a flow chart of a method for obtaining a signal peak according to an embodiment of the present invention;
fig. 2 is a waveform diagram of a signal to be measured and a steamed bread wave signal in the embodiment of the invention.
Detailed Description
Referring to fig. 1 and fig. 2, fig. 1 is a flowchart illustrating a method for obtaining a signal peak according to an embodiment of the present invention; fig. 2 is a waveform diagram of a signal to be measured and a steamed bread wave signal in the embodiment of the invention. The method for acquiring the signal peak value comprises the following steps:
step S1: and acquiring a signal to be detected, and converting the signal to be detected into a steamed bun wave signal with the same frequency as the signal to be detected.
In one embodiment, the signal under test is a periodic cross-flow signal.
In one embodiment, the signal to be measured is a periodic alternating current signal with the frequency of 50Hz or 60 Hz.
The steamed bun wave signal is a signal obtained by filtering a signal to be detected, and the signal to be detected is converted into the steamed bun wave signal, so that the calculation time can be saved, and the calculation accuracy is improved. In one embodiment, the steamed bun wave signal is: the positive value part of the steamed bread wave signal is the positive value of the signal to be detected, and the 0 value of the steamed bread wave signal is the 0 value of the signal to be detected or the negative value of the signal to be detected. In another embodiment, the steamed bun wave signal is: the positive value part of the steamed bun wave signal is the positive value of the signal to be detected and/or the positive value of the signal to be detected after the negative value of the signal to be detected is turned up, namely the positive value part of the signal to be detected is reserved, the negative value of the signal to be detected is turned up by taking the abscissa as the symmetry axis, and the steamed bun wave signal is obtained.
In one embodiment, the signal to be measured is subjected to capacitance filtering through a capacitance filtering circuit, and then is subjected to filtering through the MCU to obtain a steamed bun wave signal.
Step S2: and acquiring the AD value of the steamed bread wave signal in real time.
In one embodiment, the acquiring the AD value of the steamed bread wave signal in real time comprises: performing analog-to-digital conversion on the steamed bun wave signal to obtain a digital signal; and acquiring the value of the digital signal in real time as the AD value of the steamed bread wave signal.
In one embodiment, analog-to-digital conversion of the steamed bread wave signal is realized through the MCU, and the value of the digital signal of the steamed bread wave is acquired in real time through the MCU.
Step S3: and counting the AD value of the steamed bun wave signal once every set interval time, and calculating and storing the average value of the AD values of the steamed bun wave signal in the set interval time.
In one embodiment, the interval setting time is 0.2-0.8 ms.
In one embodiment, in order to improve the accuracy of data acquisition and reduce errors in data acquisition caused by interference signals, after the AD values of the steamed bun wave signals are counted once at the set time intervals, the AD values of the steamed bun wave signals obtained by counting are sorted, the maximum value and the minimum value of the set number are removed, and then the AD values of the remaining steamed bun wave signals are averaged to obtain the average value. Wherein the set number is 1-10, preferably the set number is 5, i.e. each minus 5 maxima and 5 minima.
Step S4: and when the number of the stored average values reaches a set number, sorting the average values to obtain the maximum average value as a signal peak value.
And the maximum average value is the peak value of the signal to be measured.
In one embodiment, when the number of the stored average values does not reach the set number, the calculation of the average value is continued by counting the AD values of the steamed bread wave signals once at the set interval time until the number of the stored average values reaches the set number.
In one embodiment, the set number is N1000/(f × T), where f is the frequency of the signal to be measured and T is the interval set time, and therefore, the set number in this application may be the number of average values of the AD values obtained by the signal to be measured in one period, or the average value of the AD values obtained by a plurality of periods.
Compared with the prior art, the method has the advantages that the signal to be detected is converted into the steamed bun wave signal, the average value of the AD values of the steamed bun wave signal is counted once at intervals of the set time, and the maximum value is obtained according to the obtained average value of the AD values, so that the calculation time is shortened, the detection efficiency is improved, and the cost is saved. Furthermore, after the AD values of the steamed bread wave signals are counted at intervals of set time, the maximum value and the minimum value of the same set quantity are removed, and then the average value of the AD values of the steamed bread wave signals is obtained, so that the problem of error of the acquired data caused by interference signals is reduced, and the accuracy of data acquisition is further improved.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention.

Claims (7)

1. A method for obtaining a peak value of a signal, comprising the steps of:
acquiring a signal to be detected, and converting the signal to be detected into a steamed bun wave signal with the same frequency as the signal to be detected; the signal to be detected is a periodic alternating current signal;
acquiring an AD value of the steamed bread wave signal in real time, wherein the AD value is a digital signal value obtained after analog-to-digital conversion is carried out on the steamed bread wave signal;
counting the AD values of the steamed bread wave signals once every set time interval, sequencing the AD values of the steamed bread wave signals within the set time interval, removing the maximum value and the minimum value of the set number, calculating the average value of the AD values of the rest steamed bread wave signals, and storing the average value;
when the number of the stored average values reaches a set number, sorting the average values to obtain the maximum average value as a signal peak value; the set number is N1000/(f × T), where f is the frequency of the signal to be measured, and T is the interval set time.
2. The method of claim 1, wherein: the positive value part of the steamed bread wave signal is the positive value of the signal to be detected, and the 0 value of the steamed bread wave signal is the 0 value of the signal to be detected or the negative value of the signal to be detected.
3. The method of claim 1, wherein: the positive value part of the steamed bread wave signal is the positive value of the signal to be detected and/or the positive value of the inverted negative value of the signal to be detected.
4. The method of claim 1, wherein: the step of acquiring the AD value of the steamed bread wave signal in real time comprises the following steps:
performing analog-to-digital conversion on the steamed bun wave signal to obtain a digital signal;
and acquiring the value of the digital signal in real time as the AD value of the steamed bread wave signal.
5. The method of claim 1, wherein: the interval setting time is 0.2-0.8 ms.
6. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for signal peak acquisition according to any one of claims 1 to 5.
7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable by the processor, the processor implementing the steps of the signal peak value acquisition method according to any one of claims 1 to 5 when executing the computer program.
CN201810831616.1A 2018-07-26 2018-07-26 Method for acquiring signal peak value Active CN108918982B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810831616.1A CN108918982B (en) 2018-07-26 2018-07-26 Method for acquiring signal peak value

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810831616.1A CN108918982B (en) 2018-07-26 2018-07-26 Method for acquiring signal peak value

Publications (2)

Publication Number Publication Date
CN108918982A CN108918982A (en) 2018-11-30
CN108918982B true CN108918982B (en) 2021-08-17

Family

ID=64418498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810831616.1A Active CN108918982B (en) 2018-07-26 2018-07-26 Method for acquiring signal peak value

Country Status (1)

Country Link
CN (1) CN108918982B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113848440A (en) * 2021-09-30 2021-12-28 珠海黑石电气自动化科技有限公司 Partial discharge detection system based on ultrasonic sensor

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003004476A (en) * 2001-06-21 2003-01-08 National Institute Of Advanced Industrial & Technology Search-type signal detecting device, signal detecting method, signal detecting program, and recording medium for recording the same
CN101271018A (en) * 2007-03-22 2008-09-24 克门塔斯特仪器有限公司 Method and system for vibration signal processing
CN108234042A (en) * 2018-01-03 2018-06-29 深圳科立讯通信有限公司 Digital signal detection method, apparatus, computer equipment and readable storage medium storing program for executing

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203911762U (en) * 2014-06-06 2014-10-29 华中科技大学 LLC resonance converting device
CN106888006B (en) * 2017-03-17 2020-11-03 华自科技股份有限公司 Signal peak value detection device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003004476A (en) * 2001-06-21 2003-01-08 National Institute Of Advanced Industrial & Technology Search-type signal detecting device, signal detecting method, signal detecting program, and recording medium for recording the same
CN101271018A (en) * 2007-03-22 2008-09-24 克门塔斯特仪器有限公司 Method and system for vibration signal processing
CN108234042A (en) * 2018-01-03 2018-06-29 深圳科立讯通信有限公司 Digital signal detection method, apparatus, computer equipment and readable storage medium storing program for executing

Also Published As

Publication number Publication date
CN108918982A (en) 2018-11-30

Similar Documents

Publication Publication Date Title
CN102033161A (en) Frequency measuring method of alternating current signal
CN101915874A (en) Harmonic wave detection method based on Fourier transformation
CN108918982B (en) Method for acquiring signal peak value
WO2016004687A1 (en) Method for distinguishing initial time point of ultra-high-frequency partial discharge signal
CN106802293B (en) Waveform peak detection method and device
CN109116183A (en) Harmonic-model parameter identification method, device, storage medium and electronic equipment
CN110873822A (en) Method for calculating frequency in alternating current sampling of feeder terminal
CN111190043B (en) Method and device for acquiring alternating current signal parameters
CN104391176A (en) Software and hardware frequency measurement circuit compatible with electric power system signals
CN109085414B (en) Voltage detection method and device
CN106918731A (en) A kind of digital oscilloscope and its signal frequency measuring method
CN114614825B (en) Low-cost high-speed pulse signal data sampling and peak value detection method
CN108008183B (en) Electric quantity measuring method, system, equipment and computer storage medium
CN111568419B (en) Detection method, detector and terminal equipment
CN111812404B (en) Signal processing method and processing device
CN112611929B (en) Abnormality detection method and related device applied to three-phase alternating current
CN110470903B (en) Voltage frequency soft measurement device and method
CN108037352B (en) Method and system for improving electric energy measurement accuracy
CN111239482A (en) Electric energy metering system and implementation method thereof
TWI672004B (en) Frequency detector
KR20170006067A (en) Apparatus for estimating frequency of power system
CN105044455A (en) Method for measuring frequency and phase of alternating current signal
CN110927504A (en) Analysis method, device and equipment of combined network based on LCR
CN111220843A (en) Signal level duration time measuring method and device
CN220344406U (en) Structure for improving dynamic range of oximeter measured value

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
CB02 Change of applicant information

Address after: 529000 No. 336 Qinglan Road, Jiangmen High-tech Development Zone, Guangdong Province

Applicant after: Hanyu Group Co., Ltd.

Address before: 529000 No. 336 Qinglan Road, Jiangmen High-tech Development Zone, Guangdong Province

Applicant before: Jiangmen Idear-hanyu Electrical Joint-stock Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant