Device and method for improving sampling rate of acquisition card
Patent Information
- Application Number
- CN202411114186.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-11-12
Smart Images

Figure CN118939429A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of high-precision time measurement, and in particular to a device and method for improving the sampling rate of an acquisition card and a method for statistically analyzing the occurrence time of similar effective event signals. Background Art
[0002] The progress of modern science and technology is inseparable from high-precision time measurement, such as medical imaging, high-energy physics, quantum communication, fluorescence lifetime imaging, time-correlated photon counters, laser radar, etc. In practical applications, time measurement usually adopts two main implementation methods: based on field programmable gate array (FPGA) and using application specific integrated circuit (ASIC). FPGA-based methods include vernier caliper method, delay chain, coarse + fine measurement method, etc. These methods can realize a wide range of time measurement using FPGA, and have the advantages of relatively simple development and easy transplantation. However, they have relatively low measurement accuracy, uneven bin width, poor stability, and are easily affected by factors such as power, voltage, and temperature. On the other hand, the method using ASIC usually needs to work with FPGA or control unit (Microcontroller Unit, MCU), which has the advantages of high precision, uniform bin width and good temperature stability. Dead time is one of the important indicators of high-precision time measurement instruments, which indicates the shortest time that the instrument needs to wait to re-record the next event after recording an event. The existence of dead time will cause the time measurement instrument to lose the record of some events, affecting the accuracy of the measurement results.
[0003] Traditional multi-channel acquisition cards based on FPGA delay chains use a higher-speed clock to sample the delay chain, and the processing process adopts a pipeline operation form, which can significantly reduce the dead time. For example, using a 200M clock, the dead time is 5ns. However, ASIC-based TDC chips have significant advantages in resolution, but the dead time is relatively long, such as the dead time of TDC-GPX2 is 20ns, which limits its performance. Summary of the invention
[0004] The purpose of the present invention is to overcome the above-mentioned defects or problems existing in the background technology and to provide a device and method for improving the sampling rate of an acquisition card and a method for statistically analyzing the occurrence time of similar effective event signals.
[0005] To achieve the above objectives, the present invention and its preferred embodiments adopt the following technical solutions, but the embodiments are not limited to the following solutions:
[0006] Solution 1: A device for increasing the sampling rate of an acquisition card, comprising:
[0007] A timing unit, comprising at least one TDC, each TDC being provided with at least one thread, each thread being used to form a time tag after receiving a valid event signal;
[0008] A distribution unit, which distributes the valid event signal to each thread based on a round-robin rule or a distribution principle; wherein the round-robin rule is to distribute the same type of valid event signals to multiple threads of the timing unit in a round-robin manner, and the distribution principle is to distribute the same valid event signal to multiple threads of the timing unit;
[0009] A statistical unit, comprising statistical modules corresponding to the number of threads, the statistical modules receiving the time tags output by the corresponding threads, and counting the distribution frequency of events in different time tag intervals within a set period to form a statistical value;
[0010] A processing unit receives the statistical values of each statistical module, and aggregates the statistical values of the same period to form a summary value when the allocation unit allocates based on the sequential round-robin rule, and averages the statistical values of the same period to form an average value when the allocation unit allocates based on the distribution principle.
[0011] Solution 2 is based on Solution 1 and further includes a comparison module, which is suitable for performing threshold comparison on the event signal to output a valid event signal.
[0012] Solution three, based on solution one, further includes a FIFO module, the number of the FIFO modules is the same as and corresponds to the number of threads, and the FIFO module is suitable for storing time tags and sending the time tags to the statistical module.
[0013] Solution 4, based on Solution 3, further includes a sending FIFO, wherein the sending FIFO is suitable for storing the summary value or the average value, and sending the summary value or the average value to the host computer.
[0014] Solution 5: Based on Solution 4, the FIFO module, the statistical module, the processing unit and the sending FIFO are implemented by FPGA.
[0015] Solution six, based on solution five, the FPGA and the TDC form an acquisition board.
[0016] Solution seven, based on solution one, the TDC is a TDC-GPX2 chip.
[0017] Solution 8: Based on Solution 1, the allocation frequency of the allocation unit is greater than or equal to 20M per second.
[0018] Solution nine, a method for counting the occurrence time of similar valid event signals, which sequentially distributes similar valid event signals to multiple threads of a timing unit. After each thread determines the event time, it sends the time tag to the corresponding statistical module in the statistical unit. The statistical module counts the distribution frequency of events in different time tag intervals within each period and sends the statistical values to the processing unit respectively. The processing unit aggregates the statistical values output by all statistical units within the same period to form a summary value.
[0019] Solution 10, a method for counting the occurrence time of similar valid event signals, distributes the same valid event signal to multiple threads of a timing unit, and after each thread determines the event time, sends the time tag to the corresponding statistical module in the statistical unit. The statistical module counts the distribution frequency of events in different time tag intervals in each period and sends the statistical values to the processing unit respectively. The processing unit forms an average value based on the statistical values output by all statistical modules in the same period.
[0020] From the above description of the present invention and its preferred embodiments, it can be seen that, compared with the prior art, the technical solution of the present invention and its preferred embodiments have the following beneficial effects due to the adoption of the following technical means:
[0021] 1. In solution 1 and its preferred embodiment, a device for improving the sampling rate of an acquisition card includes a timing unit, a distribution unit, a statistical unit, and a processing unit.
[0022] The timing unit includes at least one TDC, each TDC is provided with at least one thread, and each thread is used to form a time tag after receiving a valid event signal;
[0023] The allocation unit allocates the valid event signal to each thread based on a round-robin rule or a distribution principle; wherein the round-robin rule is to allocate the same type of valid event signals to multiple threads of the timing unit in a round-robin manner, and the distribution principle is to distribute the same valid event signal to multiple threads of the timing unit;
[0024] The statistical unit includes statistical modules corresponding to the number of threads, the statistical modules receiving the time tags output by the corresponding threads, and counting the distribution frequency of events in different time tag intervals within a set period to form statistical values;
[0025] The processing unit receives the statistical values of each statistical module, and when the allocation unit allocates based on the sequential round-robin rule, the statistical values of the same period are summarized to form a summary value, and when the allocation unit allocates based on the distribution principle, the statistical values of the same period are averaged to form an average value. When based on the sequential round-robin rule, the dead time of the measurement can be reduced, and when based on the distribution principle, the stability of the measurement can be improved. The allocation unit can change the above allocation strategy according to the actual measurement requirements.
[0026] 2. In the second solution and its preferred embodiment, the comparison module is suitable for performing threshold comparison on the event signal to output a valid event signal, so as to judge the event signal and eliminate interference.
[0027] 3. In scheme three and its preferred embodiment, the number of FIFO modules is the same as and corresponds to the number of threads, and the FIFO module is suitable for storing time tags and sending the time tags to the statistical module to achieve caching when the statistical module and the thread processing data rate do not match.
[0028] 4. In scheme 4 and its preferred embodiment, the sending FIFO is suitable for storing summary values or average values, and sending the summary values or average values to the host computer to achieve caching when the processing data rate of the processing unit does not match that of the host computer.
[0029] 5. In scheme five and its preferred embodiment, the FIFO module, statistical module, processing unit and sending FIFO are implemented by FPGA.
[0030] 6. In the sixth scheme and its preferred embodiment, FPGA and TDC form an acquisition board. By sinking the histogram statistics function (implemented by the statistics module) to the FPGA on each acquisition board, the data throughput can be increased. The data after statistics by the statistics module is significantly reduced compared to the amount of original data.
[0031] 7. In scheme seven and its preferred embodiments, the TDC is a TDC-GPX2 chip or other chips with similar functions, which have the advantages of high resolution, high precision, low dead time, high stability, etc.
[0032] 8. In scheme eight and its preferred embodiment, the allocation frequency of the allocation unit is greater than or equal to 20M per second to ensure the switching speed.
[0033] 9. Scheme 9 and its preferred embodiment, a method for statistically analyzing the occurrence time of similar valid event signals, which sequentially distributes similar valid event signals to multiple threads of a timing unit, and each thread sends a time tag to a corresponding statistical module in a statistical unit after determining the event time, and the statistical module counts the distribution frequency of events in different time tag intervals in each period and sends the statistical values to a processing unit respectively, and the processing unit aggregates the statistical values output by all statistical units in the same period to form a summary value. This method can reduce the dead time of measurement.
[0034] 10. In scheme 10 and its preferred embodiments, a method for counting the occurrence time of similar valid event signals distributes the same valid event signal to multiple threads of a timing unit. After each thread determines the event time, it sends the time tag to the corresponding statistical module in the statistical unit. The statistical module counts the distribution frequency of events in different time tag intervals in each period and sends the statistical values to the processing unit respectively. The processing unit forms an average value based on the statistical values output by all statistical modules in the same period. This method can improve the stability of measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 This is a schematic diagram of a device for improving the sampling rate of an acquisition card provided in the first embodiment.
[0037] Figure 2 This is a schematic diagram of a distribution unit provided in the first embodiment.
[0038] Figure 3 This is a schematic diagram of a distribution unit provided in the first embodiment. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are preferred embodiments of the present invention and should not be regarded as excluding other embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] In the claims, description and the above-mentioned drawings of the present invention, unless otherwise clearly defined, the use of terms such as "first", "second" or "third" etc. are for distinguishing different objects rather than for describing a specific order.
[0041] In the claims, specification and the above-mentioned drawings of the present invention, unless otherwise explicitly defined, directional words, such as the terms "center", "lateral", "longitudinal", "horizontal", "vertical", "top", "bottom", "inside", "outside", "up", "down", "front", "back", "left", "right", "clockwise", "counterclockwise", etc., indicating directions or positional relationships are based on the directions and positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction or be constructed and operated in a specific direction, and therefore cannot be understood as limiting the specific protection scope of the present invention.
[0042] In the claims, specification and the above drawings of the present invention, unless otherwise clearly defined, if the term "fixed connection" or "fixed connection" is used, it should be understood in a broad sense, that is, any connection method without a displacement relationship and relative rotation relationship between the two, that is to say, including non-detachable fixed connection, detachable fixed connection, integrated connection and fixed connection through other devices or elements.
[0043] In the claims, description and drawings of the present invention, if the terms "include", "have" and their variations are used, they are intended to mean "including but not limited to".
[0044] refer to Figure 1 A device for improving the sampling rate of an acquisition card (which can be an acquisition card) includes a comparison module, a FIFO module, a timing unit, a distribution unit, a statistical unit and a processing unit.
[0045] The timing unit includes at least one TDC (Time to Digital Converter, TDC), each TDC is provided with at least one thread (channel), and each thread is used to form a time tag after receiving a valid event signal;
[0046] The comparison module is adapted to perform a threshold comparison on the event signal to output a valid event signal, which is used as an input of the allocation unit.
[0047] The allocation unit allocates the valid event signal to the input channels of the n TDCs in a certain form. Specifically, the allocation unit allocates the valid event signal to each thread based on a sequential round-robin rule or a distribution principle; wherein, reference Figure 2 The round-robin rule is to distribute the same type of valid event signals to multiple threads of the timing unit in order, refer to Figure 3 ,The distribution principle is to distribute the same valid event signal to multiple threads of the ,timing unit.,The distribution unit can transform the above distribution strategy ,according to the actual measurement requirements.
[0048] Preferably, the distribution unit can distribute the input event signal at a high speed, requiring the distribution frequency to be greater than or equal to 20M per second, and the jitter between input and output, and between outputs to be small. The distribution unit can be implemented by FPGA, or by other circuits or chips with similar functions, and the event signal cannot be lost during the distribution process.
[0049] The number of FIFO modules is the same as and corresponds to the number of threads. The FIFO modules are suitable for storing time tags sent by the TDC and sending the time tags to the statistical module of the statistical unit.
[0050] The statistical unit includes statistical modules that are equal to and corresponding to the number of threads. The statistical module receives the time tags output by the corresponding threads (obtained from the FIFO module) and counts the distribution frequency of events in different time tag intervals within a set period to form a statistical value; the statistical module is a histogram statistical module.
[0051] The processing unit receives the statistical values of each statistical module, and summarizes the statistical values of the same period to form a summary value when the allocation unit allocates based on the sequential round-robin rule. The specific steps are: the same type of valid event signals are allocated to multiple threads of the timing unit in sequence, and each thread sends the time tag to the corresponding statistical module in the statistical unit after determining the event time. The statistical module counts the distribution frequency of events in different time tag intervals in each period and sends the statistical values to the processing unit respectively. The processing unit summarizes the statistical values output by all statistical units in the same period to form a summary value.
[0052] The processing unit averages the statistical values of the same period to form an average value when the distribution unit distributes based on the distribution principle. The specific steps are: the same valid event signal is distributed to multiple threads of the timing unit, each thread determines the event time and sends the time tag to the corresponding statistical module in the statistical unit, the statistical module counts the distribution frequency of events in different time tag intervals in each period and sends the statistical values to the processing unit respectively, and the processing unit forms an average value based on the statistical values output by all statistical modules in the same period.
[0053] The sending FIFO is suitable for storing the summary value or the average value, and sending the summary value or the average value to the host computer.
[0054] In this embodiment, there is one TDC, which has three channels. The TDC is a time-to-digital conversion chip, which may be a TDC-GPX2, or other chips with similar functions. The FIFO module, the statistics module, the processing unit, and the transmission FIFO are implemented based on FPGA. The acquisition board includes FPGA and TDC.
[0055] The overall acquisition process is as follows: the event signal is compared with the threshold by the comparison module and then the valid event signal is output as the input of the distribution unit. The distribution unit distributes the valid event signal to the input channels of the three TDCs in a certain form. The TDC sends the time tags obtained in the three channels to the FPGA. The FPGA stores the event tags in their respective FIFO modules, and then performs histogram statistics on the data in each FIFO module. The histogram statistical results are output to the processing unit for corresponding processing to form a new frame of histogram statistical results, which are then stored in the sending FIFO and finally sent to the host computer for storage and display.
[0056] refer to Figure 3 When there is only one input signal, in order to increase the stability of input measurement, the input signal can be measured multiple times and averaged. At this time, the function of the distribution unit is to connect one input signal to three output signals at the same time, and the three output signals enter the TDC of three channels for independent measurement. The processing unit averages the results of the statistical module. The distribution unit is used to distribute the input signal to the three independent input signals of TDC-GPX2 at the same time, and then average them in the processing stage, which significantly improves the stability of the measurement.
[0057] refer to Figure 2 In order to reduce the dead time of input 1 measurement, the function of the distribution unit is to distribute the input 1 signal (valid event signal) to the three output signals in turn, and the three output signals enter the three channels of TDC for independent measurement. At this time, the processing unit accumulates the results of the statistical module. If the dead time of a single channel conversion of TDC-GPX2 is 20ns, the corresponding maximum count rate is 50Mcps. If a distribution unit is used to distribute the input signal to the three independent input signals of TDC-GPX2 in turn, the dead time can be reduced to one third of the original, and the maximum count rate can reach 150Mcps, which can meet most needs.
[0058] Compared with the prior art, this embodiment has the following beneficial effects:
[0059] In an exemplary embodiment, a device for improving the sampling rate of an acquisition card includes a timing unit, a distribution unit, a statistical unit, and a processing unit.
[0060] The timing unit includes at least one TDC, each TDC is provided with at least one thread, and each thread is used to form a time tag after receiving a valid event signal;
[0061] The allocation unit allocates the valid event signal to each thread based on a round-robin rule or a distribution principle; wherein the round-robin rule is to allocate the same type of valid event signals to multiple threads of the timing unit in a round-robin manner, and the distribution principle is to distribute the same valid event signal to multiple threads of the timing unit;
[0062] The statistical unit includes statistical modules corresponding to the number of threads, the statistical modules receiving the time tags output by the corresponding threads, and counting the distribution frequency of events in different time tag intervals within a set period to form statistical values;
[0063] The processing unit receives the statistical values of each statistical module, and when the allocation unit allocates based on the sequential round-robin rule, the statistical values of the same period are summarized to form a summary value, and when the allocation unit allocates based on the distribution principle, the statistical values of the same period are averaged to form an average value. When based on the sequential round-robin rule, the dead time of the measurement can be reduced, and when based on the distribution principle, the stability of the measurement can be improved. The allocation unit can change the above allocation strategy according to the actual measurement requirements.
[0064] In an exemplary embodiment, the comparison module is adapted to perform a threshold comparison on the event signal to output a valid event signal, so as to judge the event signal and eliminate interference.
[0065] In an exemplary embodiment, the number of FIFO modules is the same as and corresponds to the number of threads, and the FIFO module is suitable for storing time tags and sending the time tags to the statistical module to achieve cache when the statistical module and the thread processing data rate do not match.
[0066] In an exemplary embodiment, the transmit FIFO is adapted to store summary values or average values, and transmit the summary values or average values to the host computer, so as to achieve caching when the processing data rates of the processing unit and the host computer do not match.
[0067] In an exemplary embodiment, the FIFO module, the statistical module, the processing unit and the sending FIFO are implemented based on FPGA.
[0068] In an exemplary embodiment, FPGA and TDC form an acquisition board, and the data throughput rate can be increased by sinking the histogram statistics function (implemented by the statistics module) to the FPGA on each acquisition board. The data after statistics by the statistics module is significantly reduced compared to the amount of original data.
[0069] In an exemplary embodiment, the TDC is a TDC-GPX2 chip or other chips with similar functions, which have the advantages of high resolution, high precision, low dead time, high stability, etc.
[0070] In an exemplary embodiment, the allocation frequency of the allocation unit is greater than or equal to 20M per second to ensure the switching speed.
[0071] In an exemplary embodiment, a method for counting the occurrence time of similar valid event signals is provided, where similar valid event signals are sequentially assigned to multiple threads of a timing unit, each thread determines the event time and sends the time tag to a corresponding statistical module in a statistical unit, the statistical module counts the distribution frequency of events in different time tag intervals in each period and sends the statistical values to a processing unit respectively, and the processing unit aggregates the statistical values output by all statistical units in the same period to form a summary value. This method can reduce the dead time of measurement.
[0072] In an exemplary embodiment, a method for counting the occurrence time of similar valid event signals distributes the same valid event signal to multiple threads of a timing unit. After each thread determines the event time, it sends the time tag to the corresponding statistical module in the statistical unit. The statistical module counts the distribution frequency of events in different time tag intervals in each period and sends the statistical values to the processing unit respectively. The processing unit forms an average value based on the statistical values output by all statistical modules in the same period. This method can improve the stability of measurement.
[0073] The description of the above specification and embodiments is used to explain the protection scope of the present invention, but does not constitute a limitation on the protection scope of the present invention. Through the enlightenment of the present invention or the above embodiments, ordinary technicians in this field can obtain modifications, equivalent substitutions or other improvements to the embodiments of the present invention or part of the technical features thereof through logical analysis, reasoning or limited experiments, which should be included in the protection scope of the present invention.
Claims
1. A device for improving the sampling rate of an acquisition card, characterized in that: include: A timing unit, comprising at least one TDC, each TDC being provided with at least one thread, each thread being used to form a time tag after receiving a valid event signal; A distribution unit, which distributes the valid event signal to each thread based on a round-robin rule or a distribution principle; wherein the round-robin rule is to distribute the same type of valid event signals to multiple threads of the timing unit in a round-robin manner, and the distribution principle is to distribute the same valid event signal to multiple threads of the timing unit; A statistical unit, comprising statistical modules corresponding to the number of threads, the statistical modules receiving the time tags output by the corresponding threads, and counting the distribution frequency of events in different time tag intervals within a set period to form a statistical value; A processing unit receives the statistical values of each statistical module, and aggregates the statistical values of the same period to form a summary value when the allocation unit allocates based on the sequential round-robin rule, and averages the statistical values of the same period to form an average value when the allocation unit allocates based on the distribution principle.
2. The device for improving the sampling rate of an acquisition card as claimed in claim 1, characterized in that: A comparison module is also included, and the comparison module is adapted to perform a threshold comparison on the event signal to output a valid event signal.
3. The device for improving the sampling rate of an acquisition card as claimed in claim 1, characterized in that: It also includes a FIFO module, the number of the FIFO modules is the same as and corresponds to the number of threads, and the FIFO module is suitable for storing time tags and sending the time tags to the statistical module.
4. The device for improving the sampling rate of an acquisition card as claimed in claim 3, characterized in that: It also includes a sending FIFO, which is suitable for storing the summary value or the average value and sending the summary value or the average value to the host computer.
5. The device for improving the sampling rate of an acquisition card as claimed in claim 4, characterized in that: The FIFO module, the statistical module, the processing unit and the sending FIFO are implemented by FPGA.
6. The device for improving the sampling rate of an acquisition card as claimed in claim 5, characterized in that: The FPGA and the TDC form an acquisition board.
7. The device for improving the sampling rate of an acquisition card as claimed in claim 1, characterized in that: The TDC is a TDC-GPX2 chip.
8. The device for improving the sampling rate of an acquisition card as claimed in claim 1, characterized in that: The allocation frequency of the allocation unit is greater than or equal to 20M per second.
9. A method for improving the sampling rate of an acquisition card, characterized in that: The same type of valid event signals are distributed to multiple threads of the timing unit in turn. After each thread determines the event time, it sends the time label to the corresponding statistical module in the statistical unit. The statistical module counts the distribution frequency of events in different time label intervals in each period and sends the statistical values to the processing unit respectively. The processing unit summarizes the statistical values output by all statistical units in the same period to form a summary value.
10. A method for counting the occurrence time of similar effective event signals, characterized in that: The same valid event signal is distributed to multiple threads of the timing unit. After each thread determines the event time, it sends the time label to the corresponding statistical module in the statistical unit. The statistical module counts the distribution frequency of events in different time label intervals in each period and sends the statistical values to the processing unit respectively. The processing unit forms an average value based on the statistical values output by all statistical modules in the same period.
