A sampling rate setting method, device, apparatus and storage medium

By controlling sampling and counting the number of high and low level data points in the data acquisition unit, the actual sampling rate is determined and written, thus solving the problem of inconsistent sampling rates in data processing and achieving consistency of sampling rate and accuracy of data processing.

CN116776070BActive Publication Date: 2026-08-25SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310746235.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-21
Publication Date
2026-08-25
Estimated Expiration
2043-06-21

AI Technical Summary

Technical Problem

During data processing, it is difficult to determine the actual sampling rate used by the data acquisition device from its appearance. This can lead to a discrepancy between the sampling rate used during data processing and the actual sampling rate when the data acquisition device collects signals, resulting in incorrect data processing results.

Method used

By controlling the data acquisition unit to sample the signal to be measured under the trigger signal, the number of high-level and low-level data points in the sampled data is obtained. Based on the statistical results, the actual sampling rate is determined from the sampling rate supported by the data acquisition unit, and written into the configuration file to ensure that the sampling rate during data processing is consistent with the actual sampling rate.

Benefits of technology

This solves the problem of inconsistent sampling rates during data processing, ensuring that the sampling rate used during data processing is consistent with the actual sampling rate when the data acquisition device collects signals, thus obtaining accurate data processing results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116776070B_ABST
    Figure CN116776070B_ABST
Patent Text Reader

Abstract

The application discloses a sampling rate setting method and device, equipment and a storage medium, and relates to the technical field of instruments. The method comprises the following steps: controlling a data collector to sample a to-be-measured signal under the triggering of a trigger signal to obtain sampling data; obtaining the sampling data of the data collector, and counting the number of high-level and low-level data points in the sampling data to obtain a statistical result; and determining an actual sampling rate from the sampling rates supported by the data collector based on the statistical result. The application controls the data collector to sample the to-be-measured signal output by a signal generator under the triggering of a trigger signal output by the signal generator, counts the number of high-level and low-level data points in the obtained sampling data, and selects an actual sampling rate from the sampling rates that can be supported by the data collector based on the statistical result, so that the sampling rate used in data processing can be kept consistent with the actual sampling rate when the data collector collects signals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of instrument technology, and in particular to a sampling rate setting method, apparatus, device, and storage medium. Background Technology

[0002] Currently, data acquisition units are used for signal acquisition. When data processing software analyzes the time-domain signals acquired by the data acquisition unit, it often needs to transform the time-domain signals to the frequency domain for processing. This transformation process requires the sampling rate at which the data acquisition unit acquired the signal. Therefore, it is necessary to know the actual sampling rate at which the data acquisition unit acquired the signal. However, in actual engineering implementations, different sampling rates can be set for the data acquisition unit by using different crystal oscillators and corresponding FPGA (Field Programmable Gate Array) programs. In other words, data acquisition units that support different sampling rates only differ in the crystal oscillator and the corresponding FPGA program; the hardware of the data acquisition units with different sampling rates is the same. For users, it is difficult to understand the actual sampling rate used by the data acquisition unit from its appearance. This leads to the problem that the sampling rate used during data processing is different from the actual sampling rate at which the data acquisition unit acquired the signal, resulting in incorrect data processing results.

[0003] Therefore, how to provide a solution to the above-mentioned technical problems is a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a sampling rate setting method, apparatus, device, and storage medium that can ensure that the sampling rate used during data processing is consistent with the actual sampling rate when the data acquisition device acquires the signal. The specific solution is as follows:

[0005] Firstly, this application discloses a sampling rate setting method, including:

[0006] The control data acquisition unit samples the signal to be measured under the trigger signal to obtain the corresponding sampled data; the trigger signal and the signal to be measured are signals input from the signal generator to the data acquisition unit;

[0007] The sampling data from the data acquisition device is obtained, and the number of high-level and low-level data points in the sampling data is counted to obtain the corresponding statistical results;

[0008] The actual sampling rate is determined based on the statistical results from the sampling rates supported by the data acquisition device.

[0009] Optionally, the sampling rate setting method further includes:

[0010] The data acquisition device is controlled to set the corresponding number of sampling points, the triggering behavior of the trigger signal, and the number of times the trigger signal is responded to.

[0011] Optionally, the control data acquisition unit samples the signal to be measured to obtain corresponding sampled data upon triggering by a trigger signal, including:

[0012] Based on the triggering behavior and the number of responses, the data acquisition unit is controlled to sample the signal to be measured according to the number of sampling points to obtain the corresponding sampling data under the triggering signal.

[0013] 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.

[0014] Optionally, the sampling rate setting method further includes:

[0015] Adjust the phase of the measured signal and the trigger signal input to the oscilloscope to output the measured signal and the trigger signal synchronously.

[0016] Optionally, determining the actual sampling rate based on the statistical results from the sampling rates supported by the data collector includes:

[0017] If the statistical results show that the first number of high-level data points and the second number of low-level data points meet a preset condition, then the first sampling rate supported by the data acquisition device is determined as the actual sampling rate.

[0018] If the statistical results indicate that the first number of high-level data points and the second number of low-level data points do not meet the preset condition, then the second sampling rate supported by the data acquisition device is determined as the actual sampling rate.

[0019] Optionally, after determining the actual sampling rate based on the statistical results among the sampling rates supported by the data collector, the method further includes:

[0020] The actual sampling rate is written into the sampling rate configuration file to process the data acquired by the data collector using the actual sampling rate.

[0021] Secondly, this application discloses a sampling rate setting device, comprising:

[0022] The sampling control module is used to control the data acquisition unit to sample the signal to be measured and obtain the corresponding sampling data when triggered by a trigger signal; the trigger signal and the signal to be measured are signals input from the signal generator to the data acquisition unit;

[0023] The data acquisition module is used to acquire the sampled data from the data collector;

[0024] The quantity statistics module is used to count the number of high-level and low-level data points in the sampled data to obtain the corresponding statistical results;

[0025] The sampling rate determination module is used to determine the actual sampling rate based on the statistical results among the sampling rates supported by the data collector.

[0026] Thirdly, this application discloses an electronic device, including:

[0027] Memory, used to store computer programs;

[0028] A processor is configured to execute the computer program to implement the steps of the aforementioned disclosed sampling rate setting method.

[0029] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed sampling rate setting method.

[0030] As can be seen, this application provides a sampling rate setting method, including: controlling a data acquisition unit to sample a signal to be measured under the trigger of a trigger signal to obtain corresponding sampling data; the trigger signal and the signal to be measured are signals input from a signal generator to the data acquisition unit; acquiring the sampling data of the data acquisition unit, and counting the number of high-level and low-level data points in the sampling data to obtain corresponding statistical results; determining the actual sampling rate based on the statistical results from the sampling rates supported by the data acquisition unit. Therefore, this application controls the data acquisition unit to sample the signal to be measured output by the signal generator under the trigger of a trigger signal output by the signal generator, and then, by counting the number of high-level and low-level data points in the acquired sampling data, selects the actual sampling rate to be used from the sampling rates that the data acquisition unit may support based on the statistical results. This solves the problem that it is difficult to know the actual sampling rate used by the data acquisition unit from its appearance, leading to a difference between the sampling rate used during data processing and the actual sampling rate when the data acquisition unit acquires the signal, thus ensuring that the sampling rate used during data processing is consistent with the actual sampling rate when the data acquisition unit acquires the signal. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0032] Figure 1 This is a flowchart of a sampling rate setting method disclosed in this application;

[0033] Figure 2 This is a flowchart of a specific sampling rate setting method disclosed in this application;

[0034] Figure 3 This is a flowchart of a specific sampling rate setting method disclosed in this application;

[0035] Figure 4 This is a schematic diagram of a specific sampling rate setting system disclosed in this application;

[0036] Figure 5 This is a schematic diagram of a sampling rate setting device disclosed in this application;

[0037] Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0039] Currently, data acquisition devices supporting different sampling rates differ only in the crystal oscillator and the corresponding FPGA program; the hardware is identical. This makes it difficult for users to discern the actual sampling rate used by the data acquisition device from its appearance. This can lead to discrepancies between the sampling rate used during data processing and the actual sampling rate at which the data acquisition device acquires the signal, resulting in incorrect data processing results. Therefore, this application provides a sampling rate setting scheme that ensures the sampling rate used during data processing remains consistent with the actual sampling rate at which the data acquisition device acquires the signal.

[0040] This invention discloses a sampling rate setting method, see [link to relevant documentation]. Figure 1 As shown, the method includes:

[0041] Step S11: Control the data acquisition unit to sample the signal to be measured under the trigger signal to obtain the corresponding sampled data; the trigger signal and the signal to be measured are signals input from the signal generator to the data acquisition unit.

[0042] It should be noted that the sampling rate setting method disclosed in this embodiment can be applied to a computer that executes the data acquisition device sampling rate setting program and the data processing program.

[0043] In this embodiment, the sampling rate setting program of the data acquisition unit in the computer controls the data acquisition unit to acquire the measured signal output by the signal generator under the trigger signal output by the signal generator to obtain the corresponding sampling data. It can be understood that the trigger signal and the measured signal are signals input from the signal generator to the data acquisition unit. Specifically, the measured signal is input to a signal input channel of the data acquisition unit, and the trigger signal is input to an external trigger input channel of the data acquisition unit. The cables transmitting the measured signal and the trigger signal are of equal length. Furthermore, the measured signal 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. In other words, the signal to be measured is a square wave signal with a first predetermined frequency and a first preset dynamic range output by an output channel of a signal generator. The first predetermined frequency of the signal to be measured is within the frequency range of the signal that the data acquisition device can acquire. The selection of the predetermined frequency should comprehensively consider various factors such as the frequency range of the signal that the data acquisition device can acquire, the maximum length of the signal that the data acquisition device can acquire, the sampling rate supported by the data acquisition device, the data processing time, and the accuracy of the sampling rate judgment. The first preset dynamic range of the signal to be measured depends on the input dynamic range of the signal input channel of the data acquisition device. For example, the first predetermined frequency can be set to 1MHz, and the first preset dynamic range is from -0.9V to +0.9V. The difference between the high level and low level of the signal to be measured after analog-to-digital conversion should be relatively large to increase the accuracy of the high and low level judgment signals. The trigger signal is also a square wave signal with a second predetermined frequency and a second preset dynamic range output from one output channel of the signal generator. Its function is to trigger the data acquisition unit to perform a data acquisition process. The second predetermined frequency of the trigger signal is within the frequency range within which the data acquisition unit can respond to trigger signals, and the second preset dynamic range of the trigger signal depends on the trigger level range of the external trigger input port of the data acquisition unit. For example, the second predetermined frequency can be set to 1MHz, and the second preset dynamic range can be 0V to +2.5V.

[0044] In this embodiment, the method may further include: adjusting the phase of the measured signal and the trigger signal input to the oscilloscope to synchronously output the measured signal and the trigger signal. It is understood that the measured signal output from the signal generator and the trigger signal may also be input to the oscilloscope via cables of equal length. By adjusting the phase of the measured signal and the trigger signal output from the signal generator, the two signals can be output synchronously, further enabling the data acquisition unit to begin a data acquisition process near the specified edge of the measured signal upon triggering by the trigger signal.

[0045] Step S12: Obtain the sampling data from the data acquisition device, and count the number of high-level and low-level data points in the sampling data to obtain the corresponding statistical results.

[0046] In this embodiment, after the data acquisition device completes data acquisition, the data acquisition device sampling rate setting program obtains the sampled data from the data acquisition device, and then counts the number of high-level and low-level data points in the obtained sampled data.

[0047] It should be noted that a certain noise margin is set for the decision of high and low levels, allowing the high and low levels of the input signal to have a fluctuation range.

[0048] Step S13: Determine the actual sampling rate based on the statistical results among the sampling rates supported by the data acquisition device.

[0049] In this embodiment, the data acquisition device sampling rate setting program selects the actual sampling rate to be used from the sampling rates supported by the data acquisition device based on the statistical results of the number of high-level and low-level data points. It can be understood that if the statistical results show that the first number of high-level data points and the second number of low-level data points meet a preset condition, then the first sampling rate supported by the data acquisition device is determined as the actual sampling rate; if the statistical results show that the first number of high-level data points and the second number of low-level data points do not meet the preset condition, then the second sampling rate supported by the data acquisition device is determined as the actual sampling rate.

[0050] As can be seen, in this embodiment, the control data acquisition unit samples the signal to be measured output by the signal generator under the trigger signal output by the signal generator. Then, by statistically analyzing the number of high-level and low-level data points in the acquired sampled data, the actual sampling rate to be used is selected from the sampling rates that the data acquisition unit may support based on the statistical results. This solves the problem that it is difficult to know the actual sampling rate used by the data acquisition unit from its appearance, which leads to a difference between the sampling rate used during data processing and the actual sampling rate when the data acquisition unit acquires the signal. This ensures that the sampling rate used during data processing is consistent with the actual sampling rate when the data acquisition unit acquires the signal.

[0051] See Figure 2 As shown, this embodiment of the invention discloses a specific sampling rate setting method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution.

[0052] Step S21: Control the data acquisition device to set the corresponding number of sampling points, the triggering behavior of the trigger signal, and the number of times to respond to the trigger signal.

[0053] It is understood that the data acquisition device sampling rate setting program controls the predetermined number of signal sampling points, i.e., the number of sampling points, the triggering behavior of the trigger signal, and the number of times the trigger signal is responded to. The predetermined number of signal sampling points does not exceed the maximum length of the signal that the data acquisition device can acquire; for example, the predetermined number of points can be set to 1000. The triggering behavior of the trigger signal can be set to rising edge triggering or falling edge triggering, and the number of times the trigger signal is responded to can be set to once. Furthermore, the data acquisition device sampling rate setting program can also control the data acquisition device to set the input dynamic range; for example, the input dynamic range can be set to -1V to +1V.

[0054] Step S22: Based on the triggering behavior and the number of responses, control the data acquisition unit to sample the signal to be measured according to the number of sampling points under the triggering signal to obtain the corresponding sampling data.

[0055] In this embodiment, the data acquisition rate setting program controls the data acquisition unit to sample the signal to be measured according to the number of sampling points under the trigger signal, based on the trigger behavior and the number of responses, to obtain the corresponding sampled data. For example, the data acquisition unit sampling rate setting program controls the data acquisition unit to perform a predetermined sampling of 1000 points on the signal to be measured output by the signal generator under the trigger signal output by the signal generator. When the trigger behavior of the trigger signal is set to trigger the sampling process of the data acquisition unit on the falling edge, since the signal to be measured by the signal generator and the trigger signal are output synchronously, the data acquisition unit starts the data acquisition process near the falling edge of the signal to be measured, that is, near the moment the signal to be measured just begins to go low.

[0056] Step S23: Obtain the sampling data from the data acquisition device, and count the number of high-level and low-level data points in the sampling data to obtain the corresponding statistical results.

[0057] Step S24: Determine the actual sampling rate based on the statistical results among the sampling rates supported by the data acquisition device.

[0058] For example, the data acquisition rate setting program controls the data acquisition unit to perform a sampling of 1000 sampling points on the signal to be measured output by the signal generator under the trigger signal output by the signal generator. The data acquisition rate setting program acquires the 1000 sampled data points acquired by the data acquisition unit and counts the number of high-level and low-level data points in these 1000 sampled data points acquired by the data acquisition unit.

[0059] Since the sampling rate of data acquisition unit 1 is 1 GSa / s, the time required to perform one sampling of 1000 predetermined points is 1 µs. The time required to acquire data is equal to the period of the 1 MHz signal under test. In other words, it can complete the sampling of the entire period of the 1 MHz signal under test. If we ignore the high-level and low-level decision-making issues at the level transitions of the signal under test, data acquisition unit 1 initially acquires low-level data, acquires low-level data for half a period, and then acquires high-level data for half a period. The number of high-level and low-level data points acquired by data acquisition unit 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 1.

[0060] Since the sampling rate of data acquisition unit 2 is 1.5GSa / s, the time required to perform a sampling of 1000 predetermined points is approximately 0.667µs. The time required to acquire data is equal to two-thirds of the period of the 1MHz signal under test. In other words, it can complete the sampling of two-thirds of the period of the 1MHz signal under test. If the high-level and low-level decision-making issues at the level transitions of the signal under test are ignored, data acquisition unit 2 will initially acquire low-level data. After acquiring low-level data for half a period, it will then acquire high-level data for one-sixth of the period. The number of high-level data points acquired by data acquisition unit 2 will differ significantly from the number of low-level data points, and the ratio of high-level data points to low-level data points will be significantly different from 1.

[0061] The data acquisition unit's sampling rate setting program selects the actual sampling rate to be used from the sampling rates that the data acquisition unit may support based on the statistical results of the high-level and low-level data points. For example, if the statistical results show that the number of high-level data points is equal to or approximately equal to the number of low-level data points, the actual sampling rate is determined to be 1GS / s; if the statistical results show that the number of high-level data points differs significantly from the number of low-level data points, the actual sampling rate is determined to be 1.5GS / s.

[0062] For details regarding steps S23 to S24, please refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.

[0063] As can be seen, in this embodiment, the control data acquisition unit samples the signal to be measured output by the signal generator under the trigger signal output by the signal generator. Then, by statistically analyzing the number of high-level and low-level data points in the acquired sampled data, the actual sampling rate to be used is selected from the sampling rates that the data acquisition unit may support based on the statistical results. This solves the problem that it is difficult to know the actual sampling rate used by the data acquisition unit from its appearance, which leads to a difference between the sampling rate used during data processing and the actual sampling rate when the data acquisition unit acquires the signal. This ensures that the sampling rate used during data processing is consistent with the actual sampling rate when the data acquisition unit acquires the signal.

[0064] See Figure 3 As shown, this embodiment of the invention discloses a specific sampling rate setting method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution.

[0065] Step S31: Control the data acquisition unit to sample the signal to be measured under the trigger signal to obtain the corresponding sampled data; the trigger signal and the signal to be measured are signals input from the signal generator to the data acquisition unit;

[0066] Step S32: Obtain the sampled data from the data acquisition device, and count the number of high-level and low-level data points in the sampled data to obtain the corresponding statistical results;

[0067] Step S33: Determine the actual sampling rate based on the statistical results among the sampling rates supported by the data acquisition device.

[0068] Step S34: Write the actual sampling rate into the sampling rate configuration file to process the data acquired by the data collector using the actual sampling rate.

[0069] It is understood that by writing the actual sampling rate into the sampling rate configuration file, the data processing program can use the actual sampling rate in the sampling rate configuration file to process the data acquired by the data acquisition device. This can solve the problem that the sampling rate used during data processing is different from the actual sampling rate when the data acquisition device acquires the signal, thereby ensuring that the sampling rate used during data processing is consistent with the actual sampling rate when the data acquisition device acquires the signal, and obtaining accurate data processing results.

[0070] For details regarding steps S31 to S33, please refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.

[0071] As can be seen, in this embodiment, the control data acquisition unit samples the signal to be measured output by the signal generator under the trigger signal output by the signal generator. Then, by statistically analyzing the number of high-level and low-level data points in the acquired sampled data, the actual sampling rate to be used is selected from the sampling rates that the data acquisition unit may support based on the statistical results. This solves the problem that it is difficult to know the actual sampling rate used by the data acquisition unit from its appearance, which leads to a difference between the sampling rate used during data processing and the actual sampling rate when the data acquisition unit acquires the signal. This ensures that the sampling rate used during data processing is consistent with the actual sampling rate when the data acquisition unit acquires the signal.

[0072] For example, see Figure 4As shown, the system components for setting the sampling rate of the data acquisition unit include: a computer, a signal generator, an oscilloscope, and a data acquisition unit. 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 predetermined frequency and a first preset dynamic range output from one output channel of the signal generator. The trigger signal is also a square wave signal with a second predetermined frequency and a second preset dynamic range output from one output channel of the signal generator. The signal to be measured is input to a signal input channel of the data acquisition unit, and the trigger signal is input to an external trigger input channel of the data acquisition unit. For example, the first predetermined frequency can be 1MHz, and the first preset dynamic range can be -0.9V to +0.9V; the second predetermined frequency can be 1MHz, and the second preset dynamic range can be 0V to +2.5V. The data acquisition unit sampling rate setting program controls the data acquisition unit to sample the signal at the predetermined number of points, setting it to 1000. The trigger behavior of the trigger signal can be set to falling edge triggering, and the number of times the trigger signal is responded to can be set to once. Furthermore, the data acquisition sampling rate setting program can also control the data acquisition unit to set the input dynamic range, for example, the input dynamic range can be set to -1V to +1V. The oscilloscope displays the measured signal and the trigger signal generated by the signal generator, and the two signals can be output synchronously by adjusting the phase of the measured signal and the trigger signal. The data acquisition sampling rate setting program controls the data acquisition unit to perform a predetermined sampling of 1000 points on the measured signal output by the signal generator under the trigger signal. Since the measured signal and the trigger signal are output synchronously, the data acquisition unit starts the data acquisition process near the falling edge of the measured signal, that is, near the beginning of the measured signal going low. The data acquisition sampling rate setting program acquires the 1000 sampled data points collected by the data acquisition unit. The program counts the number of high and low level data points in the sampled data. Based on the statistical results, it selects the actual sampling rate to use from the sampling rates that the data acquisition device can support, and writes the sampling rate into the sampling rate configuration file. For example, if the statistical results show that the number of high-level data points is equal to or approximately equal to the number of low-level data points, the actual sampling rate is determined to be 1GS / s, and the sampling rate is written into the sampling rate configuration file; if the statistical results show that the number of high-level data points differs significantly from the number of low-level data points, the actual sampling rate is determined to be 1.5GS / s, and the sampling rate is written into the sampling rate configuration file. The data processing program uses the sampling rate set in the sampling rate configuration file to process the data acquired by the data acquisition device.

[0073] Accordingly, this application also discloses a sampling rate setting device, see [link to relevant documentation]. Figure 5 As shown, the device includes:

[0074] The sampling control module 11 is used to control the data acquisition unit to sample the signal to be measured under the trigger of the trigger signal to obtain the corresponding sampling data; the trigger signal and the signal to be measured are signals input from the signal generator to the data acquisition unit;

[0075] Data acquisition module 12 is used to acquire the sampled data from the data collector;

[0076] The quantity statistics module 13 is used to count the number of high-level and low-level data points in the sampled data to obtain the corresponding statistical results;

[0077] The sampling rate determination module 14 is used to determine the actual sampling rate based on the statistical results among the sampling rates supported by the data collector.

[0078] As can be seen from the above, in this embodiment, the control data acquisition unit samples the signal to be measured output by the signal generator under the trigger signal output by the signal generator. Then, by statistically analyzing the number of high-level and low-level data points in the acquired sampled data, the actual sampling rate to be used is selected from the sampling rates that the data acquisition unit may support based on the statistical results. This solves the problem that it is difficult to know the actual sampling rate used by the data acquisition unit from its appearance, which leads to a difference between the sampling rate used during data processing and the actual sampling rate when the data acquisition unit acquires the signal. This ensures that the sampling rate used during data processing is consistent with the actual sampling rate when the data acquisition unit acquires the signal.

[0079] In some specific embodiments, the sampling rate setting device may further include:

[0080] The parameter setting control module is used to control the data acquisition device to set the corresponding number of sampling points, the triggering behavior of the trigger signal, and the number of times to respond to the trigger signal.

[0081] In some specific embodiments, the sampling control module 11 may specifically include:

[0082] A sampling control unit is used to control the data acquisition unit to sample the signal to be measured according to the number of sampling points under the trigger signal, based on the triggering behavior and the number of responses, to obtain the corresponding sampling data.

[0083] In some specific embodiments, the sampling rate setting device may further include:

[0084] A phase adjustment module is used to adjust the phase of the measured signal and the trigger signal input to the oscilloscope so as to synchronously output the measured signal and the trigger signal.

[0085] In some specific embodiments, the sampling rate determination module 14 may specifically include:

[0086] The first sampling rate determination unit is used to determine the first sampling rate supported by the data acquisition device as the actual sampling rate if the statistical results show that the first number of high-level data points and the second number of low-level data points meet a preset condition.

[0087] The second sampling rate determination unit is used to determine the second sampling rate supported by the data acquisition device as the actual sampling rate if the statistical results show that the first number of high-level data points and the second number of low-level data points do not meet the preset condition.

[0088] In some specific embodiments, the sampling rate setting device may further include:

[0089] The sampling rate writing module is used to write the actual sampling rate into the sampling rate configuration file so as to process the data acquired by the data collector using the actual sampling rate.

[0090] Furthermore, embodiments of this application also provide an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0091] Figure 6 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may 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. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the sampling rate setting method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0092] In this embodiment, the power supply 23 is used to provide 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 external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0093] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0094] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the sampling rate setting method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.

[0095] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program. When the computer program is loaded and executed by a processor, it implements the sampling rate setting method steps disclosed in any of the foregoing embodiments.

[0096] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0097] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0098] The above provides a detailed description of a sampling rate setting method, apparatus, device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A sampling rate setting method, characterized in that, include: The control data acquisition unit samples the signal to be measured under the trigger of the trigger signal to obtain corresponding sampling data; the trigger signal and the signal to be measured are signals input from the signal generator to the data acquisition unit; 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; The sampling data from the data acquisition device is obtained, and the number of high-level and low-level data points in the sampling data is counted to obtain the corresponding statistical results; The actual sampling rate is determined based on the statistical results from the sampling rates supported by the data acquisition device. The sampling rate setting method further includes: Adjust the phase of the measured signal and the trigger signal input to the oscilloscope to output the measured signal and the trigger signal synchronously.

2. The sampling rate setting method according to claim 1, characterized in that, Also includes: The data acquisition device is controlled to set the corresponding number of sampling points, the triggering behavior of the trigger signal, and the number of times the trigger signal is responded to.

3. The sampling rate setting method according to claim 2, characterized in that, The control data acquisition unit samples the signal to be measured under the trigger signal to obtain corresponding sampled data, including: Based on the triggering behavior and the number of responses, the data acquisition unit is controlled to sample the signal to be measured according to the number of sampling points to obtain the corresponding sampling data under the triggering signal.

4. The sampling rate setting method according to claim 1, characterized in that, Determining the actual sampling rate based on the statistical results from the sampling rates supported by the data collector includes: If the statistical results show that the first number of high-level data points and the second number of low-level data points meet a preset condition, then the first sampling rate supported by the data acquisition device is determined as the actual sampling rate. If the statistical results indicate that the first number of high-level data points and the second number of low-level data points do not meet the preset condition, then the second sampling rate supported by the data acquisition device is determined as the actual sampling rate.

5. The sampling rate setting method according to any one of claims 1 to 4, characterized in that, After determining the actual sampling rate based on the statistical results among the sampling rates supported by the data collector, the process further includes: The actual sampling rate is written into the sampling rate configuration file to process the data acquired by the data collector using the actual sampling rate.

6. A sampling rate setting device, characterized in that, include: The sampling control module is used to control the data acquisition unit to sample the signal to be measured under the trigger of a trigger signal to obtain corresponding sampling data; the trigger signal and the signal to be measured are signals input from the signal generator to the data acquisition unit; 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; The data acquisition module is used to acquire the sampled data from the data collector; The quantity statistics module is used to count the number of high-level and low-level data points in the sampled data to obtain the corresponding statistical results; A sampling rate determination module is used to determine the actual sampling rate based on the statistical results among the sampling rates supported by the data collector; The sampling rate setting device is further configured to: adjust the phase of the signal to be measured and the trigger signal input to the oscilloscope to synchronously output the signal to be measured and the trigger signal.

7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the sampling rate setting method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, Used to store a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the sampling rate setting method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Triggering device and triggering method of SPDIF interface signals

    CN104914329A

  • Decoding method and device for FM0 coded data, and reader-writer

    CN111510151A