CN116776070A - Sampling rate setting method, device, equipment and storage medium - Google Patents

Sampling rate setting method, device, equipment and storage medium Download PDF

Info

Publication number
CN116776070A
CN116776070A CN202310746235.4A CN202310746235A CN116776070A CN 116776070 A CN116776070 A CN 116776070A CN 202310746235 A CN202310746235 A CN 202310746235A CN 116776070 A CN116776070 A CN 116776070A
Authority
CN
China
Prior art keywords
data
signal
sampling rate
sampling
triggering
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310746235.4A
Other languages
Chinese (zh)
Inventor
李清石
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Original Assignee
Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center 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 Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd filed Critical Shandong Yunhai Guochuang Cloud Computing Equipment Industry Innovation Center Co Ltd
Priority to CN202310746235.4A priority Critical patent/CN116776070A/en
Publication of CN116776070A publication Critical patent/CN116776070A/en
Pending legal-status Critical Current

Links

Abstract

The application discloses a sampling rate setting method, a device, equipment and a storage medium, which relate to the technical field of instruments and comprise the following steps: the data acquisition unit is controlled to sample the signal to be measured under the triggering of the triggering signal to obtain sampling data; acquiring sampling data of a data acquisition unit, and counting the number of high-level data points and low-level data points in the sampling data to obtain a statistical result; the actual sampling rate is determined among the sampling rates supported by the data collector based on the statistical result. The application controls the data collector to sample the signal to be measured output by the signal generator under the triggering of the triggering signal output by the signal generator, counts the number of high-level data points and low-level data points in the acquired sampling data, and selects the sampling rate which is actually used in the sampling rate possibly supported by the data collector based on the counting result, thereby ensuring that the sampling rate used in the data processing is consistent with the actual sampling rate when the data collector collects the signal.

Description

Sampling rate setting method, device, equipment and storage medium
Technical Field
The present application relates to the field of instruments, and in particular, to a method, an apparatus, a device, and a storage medium for setting a sampling rate.
Background
Currently, when a data collector is used for signal collection and data processing software analyzes a time domain signal acquired by the data collector, the time domain signal is often required to be converted to a frequency domain for processing, and the sampling rate when the data collector is required to be used for collecting the signal in the conversion process is required to be known, however, in actual engineering implementation, setting of different sampling rates of the data collector can be realized by adopting different crystal oscillators and corresponding FPGA (Field Programmable Gate Array ) programs, that is, the data collector supporting different sampling rates is supported, only the crystal oscillators and the corresponding FPGA programs have differences, the data collector with different sampling rates has no difference in hardware, and for a user, the problem that the sampling rate actually used by the data collector is difficult to know from the appearance of the data collector is different from the actual sampling rate when the data collector collects the signal is caused, so that an error data processing result is obtained.
Therefore, how to provide a solution to the above technical problem is a problem that a person skilled in the art needs to solve at present.
Disclosure of Invention
In view of the above, an object of the present application is to provide a method, apparatus, device and storage medium for setting a sampling rate, which can ensure that a sampling rate used in data processing is consistent with an actual sampling rate when a data collector collects signals. The specific scheme is as follows:
in a first aspect, the present application discloses a sampling rate setting method, including:
the data acquisition unit is controlled to sample the signal to be measured under the triggering of the triggering signal to obtain corresponding sampling data; the trigger signal and the signal to be measured are signals input to the data acquisition device by the signal generator;
acquiring the sampling data of the data acquisition device, and counting the number of high-level data points and low-level data points in the sampling data to obtain corresponding statistical results;
and determining an actual sampling rate among the sampling rates supported by the data collector based on the statistical result.
Optionally, the sampling rate setting method further includes:
and controlling the data acquisition device to set corresponding sampling points, triggering behaviors of the triggering signals and response times for responding to the triggering signals.
Optionally, the control data collector samples the signal to be measured under the triggering of the trigger signal to obtain corresponding sampling data, including:
and controlling the data acquisition unit to sample the signal to be measured according to the sampling point number under the triggering of the trigger signal based on the triggering behavior and the response times to obtain corresponding sampling data.
Optionally, the signal to be measured is a first square wave signal with a first preset frequency and a first preset dynamic range generated by the signal generator, and the trigger signal is a second square wave signal with a second preset frequency and a second preset dynamic range generated by the signal generator.
Optionally, the sampling rate setting method further includes:
and adjusting the phases of the signal to be measured and the trigger signal input into the oscilloscope so as to synchronously output the signal to be measured and the trigger signal.
Optionally, the determining, based on the statistics, an actual sampling rate among sampling rates supported by the data collector includes:
if the statistical result shows that the first number of the high-level data points and the second number of the low-level data points meet the preset condition, determining the first sampling rate supported by the data collector as an actual sampling rate;
and if the statistics result shows that the first number of the high-level data points and the second number of the low-level data points do not meet the preset condition, determining the second sampling rate supported by the data collector as an actual sampling rate.
Optionally, after determining the actual sampling rate among the sampling rates supported by the data collector based on the statistics, the method further includes:
writing the actual sampling rate into a sampling rate configuration file to process the data acquired by the data acquisition device by utilizing the actual sampling rate.
In a second aspect, the present application discloses a sampling rate setting device, comprising:
the sampling control module is used for controlling the data acquisition device to sample the signal to be measured under the triggering of the triggering signal to obtain corresponding sampling data; the trigger signal and the signal to be measured are signals input to the data acquisition device by the signal generator;
the data acquisition module is used for acquiring the sampling data of the data acquisition device;
the quantity counting module is used for counting the quantity of high-level data points and low-level data points in the sampling data to obtain corresponding counting results;
and the sampling rate determining module is used for determining an actual sampling rate from sampling rates supported by the data collector based on the statistical result.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the previously disclosed sample rate setting method.
In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the steps of the previously disclosed sample rate setting method.
It can be seen that the present application provides a sampling rate setting method, comprising: the data acquisition unit is controlled to sample the signal to be measured under the triggering of the triggering signal to obtain corresponding sampling data; the trigger signal and the signal to be measured are signals input to the data acquisition device by the signal generator; acquiring the sampling data of the data acquisition device, and counting the number of high-level data points and low-level data points in the sampling data to obtain corresponding statistical results; and determining an actual sampling rate among the sampling rates supported by the data collector based on the statistical result. Therefore, the application controls the data collector to sample the signal to be measured output by the signal generator under the triggering of the triggering signal output by the signal generator, and then the number of high-level and low-level data points in the acquired sampling data is counted, and the sampling rate which is actually used is selected from the sampling rates possibly supported by the data collector based on the counting result, so that the problem that the sampling rate which is used when the data collector is actually used is difficult to know from the appearance of the data collector and the actual sampling rate when the data collector is used for collecting the signal are different from the actual sampling rate when the data collector is used for collecting the signal can be solved, and the sampling rate which is used when the data is processed is ensured to be consistent with the actual sampling rate when the data collector is used for collecting the signal.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a sample rate setting method of the present disclosure;
FIG. 2 is a flowchart of a specific sample rate setting method disclosed in the present application;
FIG. 3 is a flowchart of a specific sample rate setting method disclosed in the present application;
FIG. 4 is a schematic diagram of a sample rate setting system according to one embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a sample rate setting device according to the present disclosure;
fig. 6 is a block diagram of an electronic device according to the present disclosure.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
At present, the data collectors supporting different sampling rates have only the difference between the crystal oscillator and the corresponding FPGA program, the data collectors with different sampling rates have no difference in hardware, and for users, the actual sampling rate of the data collectors is difficult to know from the appearance of the data collectors, so that the problem that the sampling rate used in data processing is different from the actual sampling rate of the data collectors when signals are collected is caused, and an error data processing result is obtained. Therefore, the application provides a sampling rate setting scheme which can ensure that the sampling rate used in data processing is consistent with the actual sampling rate when a data collector collects signals.
The embodiment of the application discloses a sampling rate setting method, which is shown in fig. 1 and comprises the following steps:
step S11: the data acquisition unit is controlled to sample the signal to be measured under the triggering of the triggering signal to obtain corresponding sampling data; the trigger signal and the signal to be measured are signals input to the data acquisition device by the signal generator.
It should be noted that the sampling rate setting method disclosed in the present embodiment may be applied to a computer that executes a data collector sampling rate setting program and a data processing program.
In this embodiment, a data collector sampling rate setting program in a computer controls a data collector to collect a signal to be measured output by a signal generator under the triggering of a trigger signal output by the signal generator to obtain corresponding sampling data. It can be understood that the trigger signal and the signal to be measured are signals input to the data collector by the signal generator, specifically, the signal to be measured is input to a signal input channel of the data collector, the trigger signal is input to an external trigger input channel of the data collector, and the cable transmitting the signal to be measured is equal to the cable transmitting the trigger signal, and the signal to be measured is a first square wave signal with a first preset frequency and a first preset dynamic range generated by the signal generator, and the trigger signal is a second square wave signal with a second preset frequency and a second preset dynamic range generated by the signal generator. That is, the signal to be measured is a square wave signal with a first predetermined frequency and a first predetermined dynamic range, which are output by one output channel of the signal generator, and the first predetermined frequency of the signal to be measured is within a frequency range where the data collector can collect signals, and the selection of the predetermined frequency is to comprehensively consider various factors such as a frequency range where the data collector can collect signals, a maximum length where the data collector can collect signals, a sampling rate supported by the data collector, a data processing time, an accuracy of sampling rate judgment, and the first predetermined dynamic range of the signal to be measured depends on an input dynamic range of the signal input channel of the data collector, for example, the first predetermined frequency may be set to 1MHz, the first predetermined dynamic range is between minus 0.9V and plus 0.9V, and a difference between a high level and a low level of the signal to be measured after analog-digital conversion is to increase accuracy of a high level and a low level of a judgment signal. The trigger signal is also a square wave signal with a second preset frequency and a second preset dynamic range, which are output by one output channel of the signal generator, and the square wave signal is used for triggering the data acquisition device to perform a data acquisition process, the second preset frequency of the trigger signal is in a frequency range in which the data acquisition device can respond to the trigger signal, and the second preset dynamic range of the trigger signal depends on a trigger level range of an external trigger input port of the data acquisition device. For example, the second predetermined frequency may be set to 1MHz, and the second preset dynamic range is 0V to plus 2.5V.
In this embodiment, the method may further include: and adjusting the phases of the signal to be measured and the trigger signal input into the oscilloscope so as to synchronously output the signal to be measured and the trigger signal. It can be understood that the signal to be measured and the trigger signal output by the signal generator can be input into the oscilloscope through an equal length cable, and the two paths of signals can be synchronously output by adjusting the phases of the signal to be measured and the trigger signal output by the signal generator, so that the data acquisition device further starts a data acquisition process at a position near the appointed jump edge of the signal to be measured under the triggering of the trigger signal.
Step S12: and acquiring the sampling data of the data acquisition device, and counting the number of high-level data points and low-level data points in the sampling data to obtain corresponding statistical results.
In this embodiment, after the data acquisition is completed by the data acquisition device, the data acquisition device sampling rate setting program acquires the sampled data of the data acquisition device, and then counts the number of high-level and low-level data points in the acquired sampled data.
It should be noted that setting a certain noise margin for the decisions of the high and low levels allows a range of fluctuations in the high and low levels of the input signal.
Step S13: and determining an actual sampling rate among the sampling rates supported by the data collector based on the statistical result.
In this embodiment, the data collector sampling rate setting program selects the sampling rate actually used among the sampling rates supported by the data collector according to the statistical result of the number of high-level and low-level data points. It is understood that if the statistics indicate that the first number of high level data points and the second number of low level data points meet a preset condition, determining the first sampling rate supported by the data collector as an actual sampling rate; and if the statistics result shows that the first number of the high-level data points and the second number of the low-level data points do not meet the preset condition, determining the second sampling rate supported by the data collector as an actual sampling rate.
Therefore, in the embodiment of the application, the data collector is controlled to sample the signal to be measured output by the signal generator under the triggering of the triggering signal output by the signal generator, and then the number of high-level data points and low-level data points in the acquired sampling data is counted, so that the sampling rate actually used is selected from the sampling rates possibly supported by the data collector based on the counting result, thereby solving the problem that the sampling rate used in the data processing is different from the actual sampling rate used in the data collecting process due to the fact that the sampling rate actually used by the data collector is difficult to know from the appearance of the data collector, and further ensuring that the sampling rate used in the data processing is consistent with the actual sampling rate used in the data collecting process.
Referring to fig. 2, an embodiment of the present application discloses a specific sampling rate setting method, and compared with the previous embodiment, the present embodiment further describes and optimizes a technical solution.
Step S21: the data acquisition unit is controlled to set corresponding sampling points, triggering behaviors of the triggering signals and response times for responding to the triggering signals.
It may be appreciated that the data collector sampling rate setting program controls the data collector to set a predetermined number of points for signal sampling, that is, a sampling point, a trigger behavior of a trigger signal and a number of times of responding to the trigger signal, where the predetermined number of points for signal sampling does not exceed a maximum length of a signal that the data collector may collect, for example, the predetermined number of points is set to 1000, the trigger behavior of the trigger signal may be set to a rising edge trigger or a falling edge trigger, and the number of times of responding to the trigger signal may be set to one time. And the data collector sampling rate setting program may also control the data collector to set the input dynamic range, for example, to negative 1V to positive 1V.
Step S22: and controlling the data acquisition unit to sample the signal to be measured according to the sampling point number under the triggering of the trigger signal based on the triggering behavior and the response times to obtain corresponding sampling data.
In this embodiment, the data collector sampling rate setting program controls the data collector to sample the signal to be measured according to the sampling point number under the triggering of the trigger signal based on the triggering behavior and the response times to obtain corresponding sampling data. For example, the data collector sampling rate setting program controls the data collector to sample the signal to be measured output by the signal generator once with the predetermined point number of 1000 under the triggering of the triggering signal output by the signal generator. When the triggering behavior of the triggering signal is set to be that the falling edge triggers the sampling process of the data acquisition device, since the signal to be measured of the signal generator and the triggering signal are synchronously output, the data acquisition device starts the data acquisition process at a nearby position after the falling edge of the signal to be measured, that is, the data acquisition device starts the data acquisition process at a nearby position after the signal to be measured just begins to become low level.
Step S23: and acquiring the sampling data of the data acquisition device, and counting the number of high-level data points and low-level data points in the sampling data to obtain corresponding statistical results.
Step S24: and determining an actual sampling rate among the sampling rates supported by the data collector based on the statistical result.
For example, the data collector sampling rate setting program controls the data collector to sample the signal to be measured output by the signal generator with the number of sampling points of 1000 under the triggering of the triggering signal output by the signal generator, the data collector sampling rate setting program acquires 1000 pieces of sampling data collected by the data collector, and the data collector sampling rate setting program counts the number of high-level and low-level data points in the 1000 pieces of sampling data acquired from the data collector.
Since the sampling rate of the data collector 1 is 1GSa/s, the time required for sampling the predetermined number of points is 1us, the time required for collecting the data is equal to the period of the signal to be measured in 1MHz, that is, the sampling of the whole period of the signal to be measured in 1MHz can be completed, if the problem of judging the high level and the low level at the jump of the level of the signal to be measured in the sampling is ignored, the data collector 1 just starts to collect the low level data, and collects the high level data in one half period after collecting the low level data in one half period. The number of high level and low level data points collected by the data collector 1 is approximately equal, and the ratio of the number of high level data points to the number of low level data points is approximately equal to 1.
Since the sampling rate of the data collector 2 is 1.5GSa/s, the time required for sampling the predetermined number of points 1000 is about 0.667us, and the time required for collecting data is equal to two-thirds of the period of the signal to be measured at 1MHz, that is, the sampling of two-thirds of the period of the signal to be measured at 1MHz can be completed. If the signal to be measured is sampled and the high level and the low level at the level jump position are ignored, the data collector 2 just starts to collect the low level data, and then collects the high level data of one sixth period after collecting the low level data of one half period, the number of the high level data points collected by the data collector 2 and the number of the low level data points have larger phase difference, and the ratio of the number of the high level data points to the number of the low level data points is larger than 1.
The data collector sampling rate setting program selects an actually used sampling rate among sampling rates that the data collector may support based on the statistical results of the high-level and low-level data points, for example, if the statistical results indicate that the number of the high-level data points and the number of the low-level data points are equal or approximately equal, determining that the actually used sampling rate is 1GS/s; if the statistical result shows that the number of the high-level data points and the number of the low-level data points are greatly different, the sampling rate actually used is judged to be 1.5GS/s.
For the specific content of the above steps S23 to S24, reference may be made to the corresponding content disclosed in the foregoing embodiment, and no detailed description is given here.
Therefore, in the embodiment of the application, the data collector is controlled to sample the signal to be measured output by the signal generator under the triggering of the triggering signal output by the signal generator, and then the number of high-level data points and low-level data points in the acquired sampling data is counted, so that the sampling rate actually used is selected from the sampling rates possibly supported by the data collector based on the counting result, thereby solving the problem that the sampling rate used in the data processing is different from the actual sampling rate used in the data collecting process due to the fact that the sampling rate actually used by the data collector is difficult to know from the appearance of the data collector, and further ensuring that the sampling rate used in the data processing is consistent with the actual sampling rate used in the data collecting process.
Referring to fig. 3, an embodiment of the present application discloses a specific sampling rate setting method, and compared with the previous embodiment, the present embodiment further describes and optimizes a technical solution.
Step S31: the data acquisition unit is controlled to sample the signal to be measured under the triggering of the triggering signal to obtain corresponding sampling data; the trigger signal and the signal to be measured are signals input to the data acquisition device by the signal generator;
step S32: acquiring the sampling data of the data acquisition device, and counting the number of high-level data points and low-level data points in the sampling data to obtain corresponding statistical results;
step S33: and determining an actual sampling rate among the sampling rates supported by the data collector based on the statistical result.
Step S34: writing the actual sampling rate into a sampling rate configuration file to process the data acquired by the data acquisition device by utilizing the actual sampling rate.
It can be understood that the actual sampling rate is written into the sampling rate configuration file, and the data processing program can process the data acquired by the data acquisition unit by using the actual sampling rate in the sampling rate configuration file, so that the problem that the sampling rate used in data processing is different from the actual sampling rate used in signal acquisition by the data acquisition unit can be solved, and the sampling rate used in data processing is consistent with the actual sampling rate used in signal acquisition by the data acquisition unit, thereby obtaining an accurate data processing result.
For the specific content of the above steps S31 to S33, reference may be made to the corresponding content disclosed in the foregoing embodiment, and a detailed description is omitted herein.
Therefore, in the embodiment of the application, the data collector is controlled to sample the signal to be measured output by the signal generator under the triggering of the triggering signal output by the signal generator, and then the number of high-level data points and low-level data points in the acquired sampling data is counted, so that the sampling rate actually used is selected from the sampling rates possibly supported by the data collector based on the counting result, thereby solving the problem that the sampling rate used in the data processing is different from the actual sampling rate used in the data collecting process due to the fact that the sampling rate actually used by the data collector is difficult to know from the appearance of the data collector, and further ensuring that the sampling rate used in the data processing is consistent with the actual sampling rate used in the data collecting process.
For example, referring to FIG. 4, the system components for data collector sampling rate setting include: the system comprises a computer, a signal generator, an oscilloscope and a data acquisition unit, wherein the computer executes a data acquisition unit sampling rate setting program and a data processing program, the signal generator generates a signal to be measured and a trigger signal, the signal to be measured is a square wave signal with a first preset frequency and a first preset dynamic range, which are output by one output channel of the signal generator, the trigger signal is also a square wave signal with a second preset frequency and a second preset dynamic range, which are output by one output channel of the signal generator, the signal to be measured is input to one signal input channel of the data acquisition unit, and the trigger signal is input to one external trigger input channel of the data acquisition unit. For example, the first predetermined frequency may be 1MHz, and the first preset dynamic range may be: negative 0.9V to positive 0.9V; the second predetermined frequency may be 1MHz, and the second preset dynamic range may be: 0V to plus 2.5V. The data collector sampling rate setting program controls the predetermined number of points at which the data collector samples a signal to be set to 1000, the triggering behavior of the trigger signal may be set to a falling edge trigger and the number of times of responding to the trigger signal may be set to one time. And the data collector sampling rate setting program may also control the data collector to set the input dynamic range, for example, to negative 1V to positive 1V. The oscilloscope displays the signal to be measured and the trigger signal generated by the signal generator, and the two paths of signals can be synchronously output by adjusting the phases of the signal to be measured and the trigger signal of the signal generator. The data collector sampling rate setting program controls the data collector to sample the signal to be measured output by the signal generator with a preset point number of 1000 under the triggering of the triggering signal output by the signal generator, and as the signal to be measured of the signal generator and the triggering signal are synchronously output, the data collector starts the data collection process at a nearby position after the falling edge of the signal to be measured, that is, the data collector starts the data collection process at a nearby position after the signal to be measured just begins to become low level, the data collector sampling rate setting program acquires 1000 pieces of sampling data collected by the data collector, the data collector sampling rate setting program counts the number of high level data points and low level data points in the sampling data, and then selects the sampling rate to be actually used among the sampling rates possibly supported by the data collector according to the counting result, and writes the sampling rate into a sampling rate configuration file, for example, if the counting result indicates that the number of high level data points and the number of low level data points are equal or approximately equal, the sampling rate to be 1GS/s is judged, and the sampling rate to be actually used is written into the sampling rate configuration file; if the statistics result shows that the number of high-level data points and the number of low-level data points are greatly different, the actually used sampling rate is judged to be 1.5GS/s, and the sampling rate is written into the sampling rate configuration file. The data processing program processes the data acquired by the data acquisition unit by using the sampling rate set in the sampling rate configuration file.
Correspondingly, the embodiment of the application also discloses a sampling rate setting device, which is shown in fig. 5, and comprises:
the sampling control module 11 is used for controlling the data acquisition unit to sample the signal to be measured under the triggering of the triggering signal to obtain corresponding sampling data; the trigger signal and the signal to be measured are signals input to the data acquisition device by the signal generator;
a data acquisition module 12 for acquiring the sampled data of the data collector;
the quantity counting module 13 is used for counting the quantity of high-level data points and low-level data points in the sampling data to obtain corresponding counting results;
a sampling rate determination module 14 is configured to determine an actual sampling rate among sampling rates supported by the data collector based on the statistics.
From the above, in the embodiment of the present application, the data collector is controlled to sample the signal to be measured output by the signal generator under the triggering of the triggering signal output by the signal generator, and then the number of high-level and low-level data points in the obtained sampled data is counted, so that the sampling rate actually used is selected from the sampling rates possibly supported by the data collector based on the counted result, thereby solving the problem that the sampling rate used when the data collector actually uses is difficult to know from the appearance of the data collector, and the actual sampling rate used when the data collector collects the signal is different from the actual sampling rate used when the data collector collects the signal, and further ensuring that the sampling rate used when the data processing is consistent with the actual sampling rate used when the data collector collects the signal.
In some specific embodiments, the sampling rate setting device may specifically further include:
and the parameter setting control module is used for controlling the data acquisition device to set corresponding sampling points, the triggering behavior of the triggering signal and the response times for responding to the triggering signal.
In some specific embodiments, the sampling control module 11 may specifically include:
and the sampling control unit is used for controlling the data acquisition unit to sample the signal to be measured according to the sampling point number under the triggering of the trigger signal based on the triggering behavior and the response times to obtain corresponding sampling data.
In some specific embodiments, the sampling rate setting device may specifically further include:
and the phase adjustment module is used for adjusting the phases of the signal to be measured and the trigger signal input into the oscilloscope so as to synchronously output the signal to be measured and the trigger signal.
In some specific embodiments, the sampling rate determination module 14 may specifically include:
a first sampling rate determining unit, configured to determine a first sampling rate supported by the data collector as an actual sampling rate if the statistics result indicates that the first number of high-level data points and the second number of low-level data points meet a preset condition;
and the second sampling rate determining unit is used for determining the second sampling rate supported by the data collector as an actual sampling rate if the statistical result shows that the first number of the high-level data points and the second number of the low-level data points do not meet the preset condition.
In some specific embodiments, the sampling rate setting device may specifically further include:
and the sampling rate writing module is used for writing the actual sampling rate into a sampling rate configuration file so as to process the data acquired by the data acquisition device by utilizing the actual sampling rate.
Further, the embodiment of the application also provides electronic equipment. Fig. 6 is a block diagram of an electronic device 20, according to an exemplary embodiment, and is not intended to limit the scope of use of the present application in any way.
Fig. 6 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. Wherein the memory 22 is configured to store a computer program that is loaded and executed by the processor 21 to implement the relevant steps of the sample rate setting method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 25 is used for acquiring external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application requirement, which is not limited herein.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon may include an operating system 221, a computer program 222, and the like, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device 20 and computer programs 222, which may be Windows Server, netware, unix, linux, etc. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the sample rate setting method performed by the electronic device 20 as disclosed in any of the previous embodiments.
Further, the embodiment of the application also discloses a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and when the computer program is loaded and executed by a processor, the steps of the sampling rate setting method disclosed in any embodiment are realized.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description of the method, the device, the equipment and the storage medium for setting the sampling rate provided by the application applies specific examples to illustrate the principle and the implementation of the application, and the description of the above examples is only used for helping to understand the method and the core idea of the application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A sampling rate setting method, comprising:
the data acquisition unit is controlled to sample the signal to be measured under the triggering of the triggering signal to obtain corresponding sampling data; the trigger signal and the signal to be measured are signals input to the data acquisition device by the signal generator;
acquiring the sampling data of the data acquisition device, and counting the number of high-level data points and low-level data points in the sampling data to obtain corresponding statistical results;
and determining an actual sampling rate among the sampling rates supported by the data collector based on the statistical result.
2. The sampling rate setting method according to claim 1, further comprising:
and controlling the data acquisition device to set corresponding sampling points, triggering behaviors of the triggering signals and response times for responding to the triggering signals.
3. The method for setting a sampling rate according to claim 2, wherein the controlling data collector samples the signal to be measured under the triggering of the trigger signal to obtain the corresponding sampling data, comprising:
and controlling the data acquisition unit to sample the signal to be measured according to the sampling point number under the triggering of the trigger signal based on the triggering behavior and the response times to obtain corresponding sampling data.
4. The method according to claim 1, wherein the signal to be measured is a first square wave signal of a first preset frequency and a first preset dynamic range generated by the signal generator, and the trigger signal is a second square wave signal of a second preset frequency and a second preset dynamic range generated by the signal generator.
5. The sampling rate setting method according to claim 1, further comprising:
and adjusting the phases of the signal to be measured and the trigger signal input into the oscilloscope so as to synchronously output the signal to be measured and the trigger signal.
6. The sampling rate setting method according to claim 5, wherein the determining an actual sampling rate among sampling rates supported by the data collector based on the statistical result comprises:
if the statistical result shows that the first number of the high-level data points and the second number of the low-level data points meet the preset condition, determining the first sampling rate supported by the data collector as an actual sampling rate;
and if the statistics result shows that the first number of the high-level data points and the second number of the low-level data points do not meet the preset condition, determining the second sampling rate supported by the data collector as an actual sampling rate.
7. The sampling rate setting method according to any one of claims 1 to 6, characterized in that after determining an actual sampling rate among sampling rates supported by the data collector based on the statistical result, further comprising:
writing the actual sampling rate into a sampling rate configuration file to process the data acquired by the data acquisition device by utilizing the actual sampling rate.
8. A sampling rate setting device, comprising:
the sampling control module is used for controlling the data acquisition device to sample the signal to be measured under the triggering of the triggering signal to obtain corresponding sampling data; the trigger signal and the signal to be measured are signals input to the data acquisition device by the signal generator;
the data acquisition module is used for acquiring the sampling data of the data acquisition device;
the quantity counting module is used for counting the quantity of high-level data points and low-level data points in the sampling data to obtain corresponding counting results;
and the sampling rate determining module is used for determining an actual sampling rate from sampling rates supported by the data collector based on the statistical result.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the steps of the sample rate setting method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program; wherein the computer program when executed by a processor implements the steps of the sample rate setting method as claimed in any one of claims 1 to 7.
CN202310746235.4A 2023-06-21 2023-06-21 Sampling rate setting method, device, equipment and storage medium Pending CN116776070A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310746235.4A CN116776070A (en) 2023-06-21 2023-06-21 Sampling rate setting method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310746235.4A CN116776070A (en) 2023-06-21 2023-06-21 Sampling rate setting method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116776070A true CN116776070A (en) 2023-09-19

Family

ID=87990891

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310746235.4A Pending CN116776070A (en) 2023-06-21 2023-06-21 Sampling rate setting method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116776070A (en)

Similar Documents

Publication Publication Date Title
EP2418498B1 (en) Time-domain triggering in a test and measurement instrument
CN108181492B (en) Oscilloscope signal processing method and device and oscilloscope
US20120038369A1 (en) Time-domain measurements in a test and measurement instrument
CN1965270B (en) Measuring clock jitter
CN110717122A (en) Page performance acquisition method and device and electronic equipment
CN116776070A (en) Sampling rate setting method, device, equipment and storage medium
CN114047378A (en) Signal voltage detection method, system, equipment and server
CN114077540A (en) Interface test system and interface test method
US6856924B2 (en) Mixer-based timebase for sampling multiple input signal references asynchronous to each other
CN114465927B (en) DNS server pressure testing method, electronic equipment and readable storage medium
KR102593293B1 (en) Method and sensor system for processing continuous sensor signals
CN112255994B (en) Real-time response test method and device for control system
CN108037362B (en) A kind of method and device based on spectrum analysis measurement number BPM sampling clock shake
CN112564996A (en) Pressure test flow scheduling method, pressure test flow control device and computer readable medium
CN109444530A (en) The method of sampling and device of AC signal
US6700516B1 (en) Mixer-based timebase for signal sampling
CN109446050A (en) A kind of function test method and device
CN108255672A (en) The method, apparatus and storage medium and electronic equipment of data check
CN109085492B (en) Method and apparatus for determining phase difference of integrated circuit signal, medium, and electronic device
CN112763778A (en) Waveform display method, device, equipment and storage medium
CN111371453A (en) Signal period measuring circuit and method
CN116467151B (en) Program performance information acquisition method, device, equipment and storage medium
CN116560967B (en) Working method, device, equipment and medium of data acquisition device
Aumala Turning interference and noise into improved resolution
CN101764651A (en) Method and device for realizing signal testing

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