CN110988465B - Frequency detection method and device for specific frequency sine wave signal and computer equipment - Google Patents

Frequency detection method and device for specific frequency sine wave signal and computer equipment Download PDF

Info

Publication number
CN110988465B
CN110988465B CN201911235520.XA CN201911235520A CN110988465B CN 110988465 B CN110988465 B CN 110988465B CN 201911235520 A CN201911235520 A CN 201911235520A CN 110988465 B CN110988465 B CN 110988465B
Authority
CN
China
Prior art keywords
value
frequency
sine wave
sampling
specific
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
CN201911235520.XA
Other languages
Chinese (zh)
Other versions
CN110988465A (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.)
Shenzhen MTC Co Ltd
Original Assignee
Shenzhen MTC 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 Shenzhen MTC Co Ltd filed Critical Shenzhen MTC Co Ltd
Priority to CN201911235520.XA priority Critical patent/CN110988465B/en
Publication of CN110988465A publication Critical patent/CN110988465A/en
Application granted granted Critical
Publication of CN110988465B publication Critical patent/CN110988465B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R23/00Arrangements for measuring frequencies; Arrangements for analysing frequency spectra
    • G01R23/02Arrangements for measuring frequency, e.g. pulse repetition rate; Arrangements for measuring period of current or voltage

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Measuring Frequencies, Analyzing Spectra (AREA)

Abstract

Compared with the prior art, the method and the device for detecting the frequency of the sine wave signal with the specific frequency, the computer equipment and the storage medium have the advantages that whether the output of the processes of detection, sampling, judgment and the like is the judgment result of the sine wave signal with the specific frequency is realized through a software method, a traditional oscilloscope is not used, and the frequency of a signal source can be simply and effectively identified; sampling is carried out by a frequency far higher than a specific sine wave signal, a certain fault-tolerant mechanism is provided, and even if a signal source generates slight deformation due to interference, the measured result can be corrected; compared with the equipment such as an oscilloscope, the algorithm can be implanted into a simple singlechip to operate, so that the cost is greatly reduced; software detection is different from judgment by naked eyes of a user on an oscilloscope, the method is not interfered by artificial subjective judgment, the result can be exported in a software form without manual recording, and the detection efficiency of whether the frequency of the sine wave signal with the specific frequency is correct or not can be effectively improved.

Description

Frequency detection method and device for specific frequency sine wave signal and computer equipment
Technical Field
The present application relates to the field of signal detection technologies, and in particular, to a frequency detection method and a computer device for a specific frequency sine wave signal.
Background
When the frequency of a sine wave signal source (hereinafter referred to as a signal source) with a specific frequency needs to be detected whether to be a preset value, the currently used method is complex, and the detection is needed in equipment such as an oscilloscope, and the oscilloscope is observed manually to judge manually. When the oscilloscope is used for artificially judging the sine wave signal source with the specific frequency, the interference of artificial subjective judgment is easy to happen, and the cost is high.
Content of application
Therefore, it is necessary to provide a frequency detection method, device, computer equipment and storage medium for a specific frequency sine wave signal to solve the technical problems of high cost and susceptibility to interference from artificial subjective judgment when an oscilloscope is used to perform an artificial judgment on a sine wave signal source with a specific frequency.
To achieve the above object, the present application proposes a frequency detection method of a specific-frequency sine wave signal, the method comprising:
detecting voltages of a signal source to be detected at different time periods;
sampling the voltage value of the signal source by a frequency far higher than a specific sine wave signal, and drawing the frequency of the signal source according to the voltage value of the signal source;
and judging whether the frequency of the signal source accords with the frequency of the specific sine wave signal or not and outputting a judgment result.
Optionally, the method comprises:
step 2, sampling the voltage value of the currently input signal to be detected according to the set sampling times, storing the voltage value as a voltage sample value, and simultaneously storing a sampling timestamp;
step 3, screening out the maximum value and the minimum value from all the obtained voltage sample values;
step 4, sampling the signal to be detected uninterruptedly, wherein the sampling time length is longer than the period of a preset number of specific frequency sine waves;
step 5, subtracting the absolute value of the maximum value from the currently sampled voltage sample value, and recording the currently sampled voltage sample value as a first sample value if the absolute value of the maximum value minus the absolute value of the minimum value is smaller than a preset coefficient;
step 6, sequentially carrying out the same calculation as the step 5 on the voltage sample value of the next sample, and sequentially recording a second sample value and a third sample value which meet the conditions until the Nth sample value of the preset number is recorded;
step 7, subtracting the time stamp of the previous sample value from the time stamp of the latter sample value to obtain a difference value of the Nth sample value … …; if any one of the difference values is larger than the set multiple of the period of the specific sine wave, determining that the sampling is abnormal, returning to the step 4 to execute again, if the threshold number of times is executed, ending the test, and determining that the test result is abnormal.
Optionally, after step 7, the method further comprises:
step 8, if any difference value is not larger than the set multiple of the period of the specific sine wave, subtracting the timestamp of the first sample value from the timestamp of the Nth sample value to obtain a value, and dividing the value by N-1 to obtain the frequency of the measurement result of the signal source to be measured;
and 9, comparing the frequency of the measurement result with the standard frequency value, and judging that the test is passed if the results are the same.
Optionally, after step 9, the method further comprises:
if the results are different, returning to the step 2 for retesting; and if the results of the preset times of tests are different, judging that the tests do not pass, and ending the tests.
Optionally, before step 2, the method further comprises:
step 1, obtaining the set sampling times set by the outside and the standard frequency value of the sine wave signal with the specific frequency.
Optionally, the specific frequency sine wave signal is a 1KHz sine wave signal, and the period of the specific frequency sine wave is 20 us.
Optionally, the set sampling times range from 50 to 550.
To achieve the above object, the present application also proposes a frequency detection apparatus for a specific frequency sine wave signal, the apparatus comprising:
the detection module is used for detecting the voltages of the signal source to be detected in different time periods;
the sampling and drawing module is used for sampling the voltage value of the signal source by the frequency far higher than the specific sine wave signal and drawing the frequency of the signal source according to the voltage value of the signal source;
and the judging and outputting module is used for judging whether the frequency of the signal source accords with the frequency of the specific sine wave signal and outputting a judging result.
To achieve the above object, the present application also proposes a computer device, which includes a processor, a memory, and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the computer device further comprises a frequency detection program of a specific-frequency sine wave signal stored on the memory and executable on the processor, the frequency detection program of a specific-frequency sine wave signal implementing the steps of the method of frequency detection of a specific-frequency sine wave signal as described above when executed by the processor.
To achieve the above object, the present application also proposes a computer readable storage medium, on which a frequency detection program of a specific-frequency sine wave signal is stored, the frequency detection program of the specific-frequency sine wave signal, when executed by the processor, implementing the steps of the frequency detection method of the specific-frequency sine wave signal as described above.
Compared with the prior art, the frequency detection method, the device, the computer equipment and the storage medium for the sine wave signal with the specific frequency provided by the embodiment of the application have the advantages that whether the output of the processes of detection, sampling, judgment and the like is the judgment result of the sine wave signal with the specific frequency is realized by a software method, a traditional oscilloscope is not used, and the frequency of a signal source can be simply and effectively identified; sampling is carried out by a frequency far higher than a specific sine wave signal, a certain fault-tolerant mechanism is provided, and even if a signal source generates slight deformation due to interference, the measured result can be corrected; compared with the equipment such as an oscilloscope, the algorithm can be implanted into a simple singlechip to operate, so that the cost is greatly reduced; software detection is different from judgment by naked eyes of a user on an oscilloscope, the method is not interfered by artificial subjective judgment, the result can be exported in a software form without manual recording, and the detection efficiency of whether the frequency of the sine wave signal with the specific frequency is correct or not can be effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the structures shown in the drawings without creative efforts.
FIG. 1 is a flow chart of a method for detecting a frequency of a sine wave signal with a specific frequency according to an embodiment of the present application;
FIG. 2 is a flow chart of a frequency detection method of a specific frequency sine wave signal according to another embodiment of the present application;
FIG. 3 is a flow chart of a frequency detection method for a specific frequency sine wave signal according to another embodiment of the present application;
FIG. 4 is a waveform diagram illustrating a frequency detection method for a specific-frequency sine wave signal according to an embodiment of the present application;
FIG. 5 is a waveform diagram illustrating a frequency detection method for a specific frequency sine wave signal according to another embodiment of the present application;
fig. 6 is a block diagram of a frequency detection device for a specific-frequency sine wave signal according to an embodiment of the present application;
fig. 7 is a block diagram of a frequency detection device for a specific frequency sine wave signal according to another embodiment of the present application;
fig. 8 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that all the directional indications (such as up, down, left, right, front, and rear … …) in the embodiment of the present application are only used to explain the relative position relationship between the components, the movement situation, and the like in a specific posture (as shown in the drawing), and if the specific posture is changed, the directional indication is changed accordingly.
In addition, the descriptions referred to as "first", "second", etc. in this application are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicit ly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
In this application, unless expressly stated or limited otherwise, the terms "connected," "secured," and the like are to be construed broadly, and for example, "secured" may be a fixed connection, a removable connection, or an integral part; can be mechanically or electrically connected; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate.
Example one
As shown in fig. 1, an embodiment of the present application provides a frequency detection method for a specific-frequency sine wave signal, the method including:
step 11, detecting voltages of a signal source to be detected in different time periods;
step 12, sampling the voltage value of the signal source by the frequency far higher than the specific sine wave signal, and drawing the frequency of the signal source according to the voltage value of the signal source;
and step 13, judging whether the frequency of the signal source accords with the frequency of the specific sine wave signal and outputting a judgment result.
Specifically, the specific frequency sine wave signal is a 1KHz sine wave signal, and the cycle of the specific frequency sine wave is 20 us.
Optionally, the set sampling times range from 50 to 550, such as 100, 150, 200, 250, 300, 350, 400, 450, 500.
In another embodiment, as shown in fig. 2, the method comprises:
step 1, obtaining the set sampling time iTime set by the outside and the standard frequency value iFreq of the sine wave signal with the specific frequency.
Further, after step 1, the method further comprises:
step 2, sampling a voltage value of a currently input signal to be detected according to a set sampling frequency iTime, storing the voltage value as a voltage sample value, and simultaneously storing a sampling timestamp; alternatively, the time stamp may not be saved in the sea-based sampling in step 2, and may be saved after step 4.
Step 3, screening out a maximum value MAX and a minimum value MIN from all the obtained voltage sample values;
step 4, sampling the signal to be detected uninterruptedly, wherein the sampling time length is longer than the period of a preset number of specific frequency sine waves; when the preset number iS 5, the sampling time length iS longer than the inverse number of the iFreq (the inverse number of the iFreq iS the sine wave period, recorded as iS, and the unit iS time), and then the sampling time length iS multiplied by 5, namely the sampling time length iS longer than the time used by the period of the sine wave generated by 5 iFreq frequencies.
Specifically, the predetermined number ranges from 4 to 10, for example, the sampling duration is greater than 6, 7, 8, or 9 cycles of the specific frequency sine wave.
Optionally, the voltage sample value and the time stamp of the sampling obtained after step 4 are saved.
Step 5, subtracting the absolute value of the maximum value from the currently sampled voltage sample value, and recording the currently sampled voltage sample value as a first sample value if the absolute value of the maximum value minus the absolute value of the minimum value is smaller than a preset coefficient;
specifically, the preset coefficient ranges from 2% to 5%.
The obtained voltage sample values were compared one by one as follows: when the absolute value of the sampled voltage value sample minus MAX is less than MAX minus MIN by 3%, the timestamp corresponding to the sample value is recorded as sample _ 1.
Step 6, sequentially carrying out the same calculation as the step 5 on the voltage sample value of the next sample, and sequentially recording a second sample value and a third sample value which meet the conditions until the Nth sample value of the preset number is recorded;
specifically, the timestamp corresponding to the voltage sample value is also referred to as a time value sample or a sample value; the first sample value is sample _1, the second sample value is sample _2, the third sample value is sample _3, the fourth sample value is sample _4, and the fifth sample value is sample _ 5.
And (5) sequentially finding out adjacent qualified values according to the idea of the step 5, and recording the adjacent qualified values as sample _2, sample _3, sample _4 and sample _ 5.
Step 7, subtracting the previous sample value from the later sample value to obtain a difference value according to the first sample value, the second sample value and the third sample value … … Nth sample value; if any one of the difference values is larger than the set multiple of the period of the specific sine wave, determining that the sampling is abnormal, returning to the step 4 to execute again, if the threshold number of times is executed, ending the test, and determining that the test result is abnormal.
Specifically, the multiple range is set to 0.8 to 2.2 times, for example, 1 time, 1.3 times, 1.6 times, 1.8 times, or 2 times. The threshold number of times ranges from 3 to 6 times.
Specifically, the obtained 5 sample values represent the time stamps subtracted from one another, sample _2-sample _1, sample _3-sample _2 … sample _5-sample _ 4. If any result iS larger than the product of iS multiplied by 1.5 (the set multiple), namely that the sampling iS judged to be abnormal, the step 4 iS returned to be executed again, if the results of 5 times of execution are all failed, the test iS ended, and the test result iS judged to be abnormal.
As shown in fig. 3, in some embodiments, after step 7, the method further comprises:
step 8, if any difference value is not larger than the set multiple of the period of the specific sine wave, subtracting the timestamp of the first sample value from the timestamp of the Nth sample value to obtain a value, and dividing the value by N-1 to obtain the frequency of the measurement result of the signal source to be measured; for example, the time stamp of the first sample is subtracted from the time stamp of the fifth sample to obtain a value divided by 4, which is the measurement result frequency of the signal to be measured.
And 9, comparing the frequency of the measurement result with the standard frequency value iFreq, and judging that the test is passed if the results are the same.
In other embodiments, after step 9, the method further comprises:
step 10, if the results are different, returning to the step 2 for retesting; and if the results of the preset times of tests are different, judging that the tests do not pass, and ending the tests. Specifically, the preset times are 3-6 times; and if the results of the three tests are different, judging that the test is not passed, and ending the test.
In the frequency detection method of the sine wave signal with the specific frequency, voltage values of a signal source to be detected in different time periods are input; the output is the result (whether the frequency is in accordance with 1 KHz) and the frequency of the signal source to be tested.
The voltage value of the signal source is sampled by the frequency far higher than 1KHz, and then the input waveform, amplitude and frequency of the signal source are drawn.
As shown in fig. 4 below, the standard 1KHz sine wave period should be 1ms, with the short arrow between the numbers 1 and 2 being the signal source voltage sampling frequency, which can be seen to be well above 1 KHz.
As shown in fig. 4, the voltage sampling period is 20us, the voltage value is continuously obtained by the set sampling time iTime (iTime >500), that is, the y value of the cycle time of 5 standard 1Khz sine waves is continuously obtained by taking 20us as one cycle, and then the maximum value (MAX value) and the minimum value (MIN value) are recorded from the 500 y values.
It should be noted that the sampling times are at least more than 50 times, and the more the sampling times are, the more accurate the MAX and MIN values of the obtained voltage sample values are. Where 20(us) × 500 ═ 10000(us), i.e., 10ms, theoretically, 5 sinusoids are generated by the signal source during the time of voltage sampling, and the peak and valley y values of the sinusoids must be measured.
As shown in fig. 5, the black circle at 5 positions of the non-waveform peak in the graph is an invalid value obtained by sampling, and the waveform peak circle pointed by the arrow is an effective value. The iTime is sampled successively, and each time the y value is compared with the MAX value, if the deviation is within the acceptable range, the sample is considered to be the MAX value, and the x value is recorded. The x and y values obtained for each sampled valid value are noted. When the 5 th valid value is obtained, the sampling is stopped. 5 x (ms) values are obtained, the sine wave period f is 1000/[ (x 5-x 1])/4 (Hz), i.e. the 5 th x time minus the 1 st x time, resulting in 4 period times divided by the time taken for 4 bits of the sine wave.
Determining the relative positions of the sine waves at the sampling time; the peak value of the sine wave can be determined by the process of screening out the maximum value MAX and the minimum value MIN in step <3 >.
Compared with the prior art, the frequency detection method for the sine wave signal with the specific frequency provided by the embodiment of the application realizes automatic detection through the following method steps, and comprises the following steps: receiving voltage values of a signal source to be detected in different time periods; sampling the voltage value of the signal source by a frequency far higher than a specific sine wave signal, and drawing the frequency of the signal source according to the voltage value of the signal source; and judging whether the frequency of the signal source accords with the frequency of the specific sine wave signal or not and outputting a judgment result. Whether the output of the processes of detection, sampling, judgment and the like is a sine wave signal judgment result with a specific frequency is realized by a software method, so that a traditional oscilloscope is not used, and the frequency of a signal source can be simply and effectively identified; sampling is carried out by a frequency far higher than a specific sine wave signal, a certain fault-tolerant mechanism is provided, and even if a signal source generates slight deformation due to interference, the measured result can be corrected; compared with the equipment such as an oscilloscope, the algorithm can be implanted into a simple singlechip to operate, so that the cost is greatly reduced; software detection is different from judgment by naked eyes of a user on an oscilloscope, the method is not interfered by artificial subjective judgment, the result can be exported in a software form without manual recording, and the detection efficiency of whether the frequency of the sine wave signal with the specific frequency is correct or not can be effectively improved.
Example two
As shown in fig. 6, a second embodiment of the present application provides a frequency detection apparatus 100 for a specific-frequency sine wave signal, the apparatus including:
the detection module 110 is configured to detect voltages of the signal source to be detected at different time periods;
a sampling and drawing module 120 for sampling a voltage value of the signal source by a frequency much higher than a specific sine wave signal, and drawing the frequency of the signal source according to the voltage value of the signal source;
and a judging and outputting module 130, configured to judge whether the frequency of the signal source matches the frequency of the specific sine wave signal, and output a judgment result.
As shown in fig. 7, in some embodiments, the frequency detection apparatus 100 for a specific-frequency sine wave signal further includes:
a sampling and storing module 142, configured to sample a voltage value of a currently input signal to be detected according to a set sampling frequency, store the voltage value as a voltage sample value, and store a time stamp of the sampling;
the screening module 143 is configured to screen out a maximum value and a minimum value from all currently acquired voltage sample values;
the sampling module 144 is configured to perform uninterrupted sampling on the signal to be detected, where the sampling duration is longer than a preset number of periods of the sine waves with specific frequencies;
a calculating and recording module 145, configured to subtract the absolute value of the maximum value from the currently sampled voltage sample value, and record the currently sampled voltage sample value as a first sample value if the absolute value of the maximum value minus the absolute value of the minimum value is smaller than a preset coefficient;
the calculating and recording module 145 is further configured to sequentially perform the same calculation on the voltage sample value of the next sample, and sequentially record the second sample value and the third sample value meeting the condition until the nth sample value of the preset number is recorded;
a calculation and decision module 147 for subtracting the timestamp of the previous sample value from the timestamp of the next sample value to obtain a difference value for the nth sample value … …; if any one of the difference values is greater than the set multiple of the period of the specific sine wave, the sampling is determined to be abnormal, the return calculation and recording module 145 performs the sampling again, if the threshold number of times is failed, the test is ended, and the test result is determined to be abnormal.
Further, the apparatus further comprises:
a measurement result frequency calculation module 148, configured to subtract the timestamp of the first sample value from the timestamp of the nth sample value to obtain a value divided by N-1 to obtain a measurement result frequency of the signal source to be measured if any one of the difference values is not greater than the set multiple of the period of the specific sine wave;
and the comparing module 149 is configured to compare the measurement result frequency with the standard frequency value, and if the results are the same, determine that the test is passed.
In some embodiments, the apparatus further comprises:
a retest and end module 150, configured to return to the retest in step 2 if the results are different; and if the results of the preset times of tests are different, judging that the tests do not pass, and ending the tests.
Further, the apparatus further comprises:
the obtaining module 141 is configured to obtain the set sampling frequency and the standard frequency value of the sine wave signal with a specific frequency, which are set externally.
It should be noted that the frequency detection apparatus for a specific frequency sine wave signal of the present embodiment and the frequency detection method for a specific frequency sine wave signal of the first embodiment are based on the same inventive concept, and the specific implementation process thereof is detailed in the method embodiment, and the technical features in the method embodiment are applicable to the present embodiment, and will not be described in detail herein.
Compared with the prior art, the frequency detection device for the sine wave signal with the specific frequency provided by the embodiment of the application realizes automatic detection through the following method steps, and comprises the following steps: receiving voltage values of a signal source to be detected in different time periods; sampling the voltage value of the signal source by a frequency far higher than a specific sine wave signal, and drawing the frequency of the signal source according to the voltage value of the signal source; and judging whether the frequency of the signal source accords with the frequency of the specific sine wave signal or not and outputting a judgment result. Whether the output of the processes of detection, sampling, judgment and the like is a sine wave signal judgment result with a specific frequency is realized by a software method, so that a traditional oscilloscope is not used, and the frequency of a signal source can be simply and effectively identified; sampling is carried out by a frequency far higher than a specific sine wave signal, a certain fault-tolerant mechanism is provided, and even if a signal source generates slight deformation due to interference, the measured result can be corrected; compared with the equipment such as an oscilloscope, the algorithm can be implanted into a simple singlechip to operate, so that the cost is greatly reduced; software detection is different from judgment by naked eyes of a user on an oscilloscope, the method is not interfered by artificial subjective judgment, the result can be exported in a software form without manual recording, and the detection efficiency of whether the frequency of the sine wave signal with the specific frequency is correct or not can be effectively improved.
EXAMPLE III
As shown in fig. 8, the present embodiment provides a computer device 5, where the computer device 5 includes a communication bus, a memory 51, and a processor 52. The computer device 5 further comprises a frequency detection program of a specific frequency sine wave signal stored on the memory 51 and operable on the processor 52; the communication bus is used for realizing connection communication between the processor and the memory;
the frequency detection program of the specific-frequency sine wave signal, when executed by the processor 52, is configured to implement the following steps of the method for detecting the frequency of the specific-frequency sine wave signal:
the method comprises the following steps:
step 11, detecting voltages of a signal source to be detected in different time periods;
step 12, sampling the voltage value of the signal source by the frequency far higher than the specific sine wave signal, and drawing the frequency of the signal source according to the voltage value of the signal source;
and step 13, judging whether the frequency of the signal source accords with the frequency of the specific sine wave signal and outputting a judgment result.
Compared with the prior art, the computer device provided by the embodiment of the application realizes automatic detection through the following method steps, and comprises the following steps: receiving voltage values of a signal source to be detected in different time periods; sampling the voltage value of the signal source by a frequency far higher than a specific sine wave signal, and drawing the frequency of the signal source according to the voltage value of the signal source; and judging whether the frequency of the signal source accords with the frequency of the specific sine wave signal or not and outputting a judgment result. Whether the output of the processes of detection, sampling, judgment and the like is a sine wave signal judgment result with a specific frequency is realized by a software method, so that a traditional oscilloscope is not used, and the frequency of a signal source can be simply and effectively identified; sampling is carried out by a frequency far higher than a specific sine wave signal, a certain fault-tolerant mechanism is provided, and even if a signal source generates slight deformation due to interference, the measured result can be corrected; compared with the equipment such as an oscilloscope, the algorithm can be implanted into a simple singlechip to operate, so that the cost is greatly reduced; software detection is different from judgment by naked eyes of a user on an oscilloscope, the method is not interfered by artificial subjective judgment, the result can be exported in a software form without manual recording, and the detection efficiency of whether the frequency of the sine wave signal with the specific frequency is correct or not can be effectively improved.
It should be noted that the computer device of this embodiment has the same concept as the method of the first embodiment, and the specific implementation process thereof is described in detail in the method embodiment, and the technical features in the method embodiment are all applicable in this embodiment, which is not described herein again.
Example four
The present embodiment provides a computer-readable storage medium, on which a frequency detection program of a specific-frequency sine wave signal is stored, and the frequency detection program of the specific-frequency sine wave signal is executed by a processor to implement the steps of the frequency detection method of the specific-frequency sine wave signal according to the first embodiment.
It should be noted that the computer-readable storage medium of this embodiment belongs to the same concept as the method of the first embodiment, and specific implementation processes thereof are detailed in the method embodiment, and technical features in the method embodiment are all correspondingly applicable in this embodiment, which is not described herein again.
The computer-readable storage medium of the embodiment of the application realizes automatic detection through the following method steps, including: receiving voltage values of a signal source to be detected in different time periods; sampling the voltage value of the signal source by a frequency far higher than a specific sine wave signal, and drawing the frequency of the signal source according to the voltage value of the signal source; and judging whether the frequency of the signal source accords with the frequency of the specific sine wave signal or not and outputting a judgment result. Whether the output of the processes of detection, sampling, judgment and the like is a sine wave signal judgment result with a specific frequency is realized by a software method, so that a traditional oscilloscope is not used, and the frequency of a signal source can be simply and effectively identified; sampling is carried out by a frequency far higher than a specific sine wave signal, a certain fault-tolerant mechanism is provided, and even if a signal source generates slight deformation due to interference, the measured result can be corrected; compared with the equipment such as an oscilloscope, the algorithm can be implanted into a simple singlechip to operate, so that the cost is greatly reduced; software detection is different from judgment by naked eyes of a user on an oscilloscope, the method is not interfered by artificial subjective judgment, the result can be exported in a software form without manual recording, and the detection efficiency of whether the frequency of the sine wave signal with the specific frequency is correct or not can be effectively improved.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
The preferred embodiments of the present application have been described above with reference to the accompanying drawings, and are not intended to limit the scope of the claims of the application accordingly. Any modifications, equivalents and improvements which may occur to those skilled in the art without departing from the scope and spirit of the present application are intended to be within the scope of the claims of the present application.

Claims (9)

1. A method for frequency detection of a specific frequency sine wave signal, the method comprising:
step 2, sampling the voltage value of the currently input signal to be detected according to the set sampling times, storing the voltage value as a voltage sample value, and simultaneously storing a sampling timestamp;
step 3, screening out the maximum value and the minimum value from all the obtained voltage sample values;
step 4, sampling the signal to be detected uninterruptedly, wherein the sampling time length is longer than the period of a preset number of specific frequency sine waves;
step 5, subtracting the absolute value of the maximum value from the currently sampled voltage sample value, and recording the currently sampled voltage sample value as a first sample value if the absolute value of the maximum value minus the absolute value of the minimum value is smaller than a preset coefficient;
step 6, sequentially carrying out the same calculation as the step 5 on the voltage sample value of the next sample, and sequentially recording a second sample value and a third sample value which meet the conditions until the Nth sample value of the preset number is recorded;
step 7, subtracting the time stamp of the previous sample value from the time stamp of the latter sample value to obtain a difference value of the Nth sample value … …; if any one of the difference values is larger than the set multiple of the period of the specific sine wave, determining that the sampling is abnormal, returning to the step 4 to execute again, if the threshold number of times is executed, ending the test, and determining that the test result is abnormal.
2. The method of claim 1, wherein after step 7, the method further comprises:
step 8, if any difference value is not larger than the set multiple of the period of the specific sine wave, subtracting the timestamp of the first sample value from the timestamp of the Nth sample value to obtain a value, and dividing the value by N-1 to obtain the frequency of the measurement result of the signal source to be measured;
and 9, comparing the frequency of the measurement result with the standard frequency value, and judging that the test is passed if the results are the same.
3. The method of claim 2, wherein after step 9, the method further comprises:
if the results are different, returning to the step 2 for retesting; and if the results of the preset times of tests are different, judging that the tests do not pass, and ending the tests.
4. The method according to any one of claims 1-3, wherein prior to step 2, the method further comprises:
and step 1, obtaining the set sampling times and the standard frequency value of the sine wave signal with the specific frequency which are set externally.
5. The method of claim 4, wherein the specific frequency sine wave signal is a 1KHz sine wave signal and the period of the specific frequency sine wave is 20 us.
6. The method of claim 5, wherein the set number of samplings ranges from 50 to 550.
7. An apparatus for frequency detection of a sine wave signal of a specific frequency, the apparatus comprising:
the sampling and storing module is used for sampling the voltage value of the currently input signal to be detected according to the set sampling times, storing the voltage value as a voltage sample value and storing a sampling timestamp;
the screening module is used for screening out the maximum value and the minimum value from all the currently acquired voltage sample values;
the sampling module is used for sampling the signal to be detected uninterruptedly, and the sampling time length is longer than the period of a preset number of specific frequency sine waves;
the calculating and recording module is used for subtracting the absolute value of the maximum value from the current sampled voltage sample value, and recording the current sampled voltage sample value as a first sample value if the absolute value of the maximum value minus the absolute value of the minimum value is smaller than a preset coefficient; the voltage sampling device is also used for sequentially carrying out the same-way calculation on the voltage sample value of the next sampling, and sequentially recording a second sample value and a third sample value which meet the conditions until the Nth sample value of the preset number is recorded;
the calculating and judging module is used for subtracting the time stamp of the previous sample value from the time stamp of the latter sample value to obtain a difference value of the first sample value, the second sample value and the third sample value … … Nth sample value; if any difference is larger than the set multiple of the period of the specific sine wave, the sampling is judged to be abnormal, the return calculation and recording module executes the sampling again, if the threshold value execution times result is failure, the test is ended, and the test result is judged to be abnormal.
8. A computer device, wherein the computer device comprises a processor, a memory, and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the computer device further comprises a frequency detection program of a specific-frequency sine wave signal stored on the memory and executable on the processor, the frequency detection program of a specific-frequency sine wave signal implementing the steps of the method of frequency detection of a specific-frequency sine wave signal according to any one of claims 1 to 6 when executed by the processor.
9. A computer-readable storage medium, characterized in that a frequency detection program of a specific-frequency sine wave signal is stored on the computer-readable storage medium, and the frequency detection program of a specific-frequency sine wave signal realizes the steps of the frequency detection method of a specific-frequency sine wave signal according to any one of claims 1 to 6 when executed by a processor.
CN201911235520.XA 2019-12-05 2019-12-05 Frequency detection method and device for specific frequency sine wave signal and computer equipment Active CN110988465B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911235520.XA CN110988465B (en) 2019-12-05 2019-12-05 Frequency detection method and device for specific frequency sine wave signal and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911235520.XA CN110988465B (en) 2019-12-05 2019-12-05 Frequency detection method and device for specific frequency sine wave signal and computer equipment

Publications (2)

Publication Number Publication Date
CN110988465A CN110988465A (en) 2020-04-10
CN110988465B true CN110988465B (en) 2022-01-11

Family

ID=70090535

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911235520.XA Active CN110988465B (en) 2019-12-05 2019-12-05 Frequency detection method and device for specific frequency sine wave signal and computer equipment

Country Status (1)

Country Link
CN (1) CN110988465B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112485226B (en) * 2020-11-06 2024-03-26 航天新气象科技有限公司 Interface detection method, device, equipment and computer equipment
CN113848380B (en) * 2021-10-22 2023-10-20 深圳市兆驰数码科技股份有限公司 Power detection circuit and method, and direct current and phase detection system and method

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101603984B (en) * 2009-07-01 2011-04-06 湖南大学 Real-time detection method for the digitalization of electrical signal frequency
WO2012117551A1 (en) * 2011-03-03 2012-09-07 三菱電機株式会社 Ac electric quantity measuring device and ac electric quantity measuring method
CN102401856B (en) * 2011-11-01 2014-01-08 山东电力集团公司菏泽供电公司 Real-time frequency measuring method for power frequency voltage signal based on fuzzy clustering method
CN104198809B (en) * 2014-06-30 2015-05-20 中国南方电网有限责任公司 Frequency measuring method for multi-frequency oscillation of electrical power system
CN104849545B (en) * 2015-04-30 2018-04-17 许继集团有限公司 A kind of power system frequency measuring method and measuring device
FR3044098B1 (en) * 2015-11-19 2017-12-22 St Microelectronics Sa METHOD AND DEVICE FOR MEASURING THE FREQUENCY OF A SIGNAL
CN106405230B (en) * 2016-08-23 2019-04-12 北京德威特电气科技股份有限公司 Frequency measurement method and device
CN106645939A (en) * 2017-03-03 2017-05-10 北京中电普华信息技术有限公司 Method and device for power grid frequency detection based on frequency spectrum extreme point

Also Published As

Publication number Publication date
CN110988465A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
CN110988465B (en) Frequency detection method and device for specific frequency sine wave signal and computer equipment
CN105630158B (en) Sensing data processing method, device and terminal device
US6448782B1 (en) Arrangement and method for defining the location of source of partial discharges
CN108571997B (en) Method and device for detecting stable contact of probe with measured point
US20210088562A1 (en) Method, apparatus and device for detecting abnormality of electric signal
CN109541401B (en) Cable detection method and device and electronic equipment
US20110060554A1 (en) Interference Detector and Methods
CN111474482A (en) Electric quantity detection model establishing method, electric quantity detection method and device and electronic equipment
CN117871945A (en) High-precision frequency measurement method, system, electronic equipment and storage medium
US11580382B2 (en) Method and apparatus providing a trained signal classification neural network
CN111781526B (en) Method and device for detecting vehicle battery and battery detection equipment
CN107506067B (en) Method and device for debugging working frequency of touch screen and terminal equipment
EP3754351B1 (en) Device for determining abnormality in secondary battery
CN116930789A (en) Accurate identification method and system for jump inflection point of battery capacity decline
JP3236710B2 (en) Measurement device for RMS values
CN115047396A (en) Error detection method and device based on ammeter, equipment and storage medium
CN106645856B (en) Digital oscilloscope abnormal signal detection method and system based on singular spectrum entropy
US11131696B2 (en) Method for estimating a signal property
Radil et al. Power quality detection and classification method for IEC 61000-4-30 Class A instruments
CN111489531B (en) Method for adapting to line tail resistance of alarm host, electronic device and storage medium
CN113382348A (en) Earphone detection method, device and system and computer readable storage medium
US10643657B1 (en) Signal acquisition apparatus and signal acquisition method
FI130776B1 (en) Method and apparatus for fault detection
CN116893383A (en) Waveform precision detection method and device for power distribution terminal
CN117668445A (en) Calculation method of pulse waveform parameters

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
GR01 Patent grant
GR01 Patent grant