Oscilloscope peak signal extraction method and field programmable gate array
By designing parallel data input, peak signal decimation and output modules in the field programmable gate array, using multiple peak signal decimation submodules and LUTs to achieve peak signal decimation, solving the problem of unreliable resource allocation and improving the decimation efficiency and reliability sex.
Patent Information
- Application Number
- CN202411369161.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, the resource allocation of field programmable gate arrays is unreliable during peak signal extraction, resulting in excessive DSP resource consumption and affecting the normal operation of other services.
By designing parallel data input modules, peak signal decimation modules and output modules in the field programmable gate array, multiple peak signal decimation submodules are used to perform signal peak decimation processing, and decimation is achieved using logical internal LUTs to avoid relying on DSP resources.
It effectively saves DSP resources, improves the problem of unreliable resource allocation, and improves the efficiency and reliability of peak signal decimation.
Smart Images

Figure CN119246924A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of peak signal extraction, and in particular to an oscilloscope peak signal extraction method and a field programmable gate array. Background Art
[0002] Oscilloscope peak sampling refers to an acquisition mode that collects and displays the maximum and minimum values of a signal within the time represented by adjacent pixels on the screen waveform display area. It is an important function of a digital oscilloscope. It is mainly used to capture burr information in the signal to avoid aliasing caused by low sampling rate under slow time base gear. Among them, the hardware sampling rate corresponding to different time base gears of the oscilloscope may be different, and the change of sampling rate can be achieved by extracting the signal. For signal extraction, CIC filter plus HBF half-band filter can generally be used to achieve integer multiple extraction filtering. However, the HBF half-band filter needs to consume the internal DSP resources of FPGA (field programmable gate array). The more HBF cascades and orders, the more DSP resources are consumed. In this way, it is difficult for other services in FPGA to be completed through DSP resources. Therefore, in the existing field programmable gate array, there is a problem of unreliable allocation of internal resources. Summary of the invention
[0003] In view of this, the purpose of the present application is to provide an oscilloscope peak signal extraction method and a field programmable gate array, so as to improve the problem of unreliable resource allocation in the field programmable gate array in the prior art.
[0004] To achieve the above objectives, this application adopts the following technical solutions:
[0005] An oscilloscope peak signal extraction method is applied to a field programmable gate array, and the oscilloscope peak signal extraction method comprises:
[0006] Through the parallel data input module in the field programmable gate array, the data to be processed is subjected to a slapping and registering process to obtain the data to be processed, wherein the data to be processed includes parallel multiple channels of sub-data to be processed;
[0007] The peak signal extraction module in the field programmable gate array is used to perform signal peak extraction processing on the data to be processed to obtain at least one corresponding signal peak serial data, wherein the peak signal extraction module includes at least one peak signal extraction submodule, each of the peak signal extraction submodules is used to perform a corresponding signal peak extraction processing on the data to be processed to obtain a corresponding signal peak serial data, and the number of the at least one peak signal extraction submodule is greater than or equal to the number of the at least one signal peak serial data, and each of the signal peak serial data includes signal maximum value data and signal minimum value data;
[0008] The at least one signal peak serial data is output processed through the output module in the field programmable gate array to output at least one signal peak parallel data corresponding to the data to be processed, wherein the number of the at least one signal peak serial data is greater than or equal to the number of the at least one signal peak parallel data.
[0009] In a preferred embodiment of the present application, in the above-mentioned oscilloscope peak signal extraction method, the step of performing signal peak extraction processing on the data to be processed by the peak signal extraction module in the field programmable gate array to obtain at least one corresponding signal peak serial data includes:
[0010] Respectively acquiring the data to be processed from the parallel data input module through each peak signal extraction submodule included in the peak signal extraction module in the field programmable gate array, wherein the peak signal extraction module includes a plurality of peak signal extraction submodules;
[0011] For each of the peak signal extraction submodules, signal peak extraction is performed on the data to be processed according to the peak signal extraction mechanism pre-configured for the peak signal extraction submodule to obtain a signal peak serial data corresponding to the peak signal extraction submodule, wherein the two peak signal extraction mechanisms corresponding to every two peak signal extraction submodules in the multiple peak signal extraction submodules are different.
[0012] In a preferred embodiment of the present application, in the above-mentioned oscilloscope peak signal extraction method, for each of the peak signal extraction submodules, according to the peak signal extraction mechanism pre-configured for the peak signal extraction submodule, the step of performing signal peak extraction processing on the data to be processed to obtain a signal peak serial data corresponding to the peak signal extraction submodule includes:
[0013] For each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a 2-fold extraction submodule, the peak signal extraction submodule performs size comparison processing on the 4 parallel sub-data to be processed included in the data to be processed, and outputs the maximum value and the minimum value of the 4 sub-data to be processed;
[0014] According to the data number information corresponding to each path of the sub-data to be processed, the maximum values and the minimum values in the four paths of sub-data to be processed are sorted to form corresponding signal peak value serial data.
[0015] In a preferred embodiment of the present application, in the above-mentioned oscilloscope peak signal extraction method, for each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a 2x extraction submodule, the peak signal extraction submodule performs size comparison processing on the 4 parallel sub-data to be processed included in the data to be processed, and outputs the maximum value and the minimum value of the 4 sub-data to be processed, including:
[0016] For each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to the 2-fold extraction submodule, the first data comparator in the peak signal extraction submodule performs size comparison processing on the first two paths of subdata to be processed among the four parallel paths of subdata to be processed included in the data to be processed, so as to obtain a larger first path of subdata to be processed and a smaller first path of subdata to be processed, and the second data comparator in the peak signal extraction submodule performs size comparison processing on the second two paths of subdata to be processed among the four parallel paths of subdata to be processed included in the data to be processed, so as to obtain a larger second path of subdata to be processed and a smaller second path of subdata to be processed;
[0017] The third data comparator in the peak signal extraction submodule compares the larger first-path sub-data to be processed and the larger second-path sub-data to be processed to obtain the maximum value among the four paths of sub-data to be processed, and the fourth data comparator in the peak signal extraction submodule compares the smaller first-path sub-data to be processed and the smaller second-path sub-data to be processed to obtain the minimum value among the four paths of sub-data to be processed.
[0018] In a preferred embodiment of the present application, in the above-mentioned oscilloscope peak signal extraction method, for each of the peak signal extraction submodules, according to the peak signal extraction mechanism pre-configured for the peak signal extraction submodule, the step of performing signal peak extraction processing on the data to be processed to obtain a signal peak serial data corresponding to the peak signal extraction submodule includes:
[0019] For each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to the 10-fold extraction submodule, the peak signal extraction submodule performs size comparison processing on the 20 parallel sub-data to be processed included in the data to be processed, and outputs the maximum value and the minimum value of the 20 sub-data to be processed;
[0020] According to the data number information corresponding to each path of the sub-data to be processed, the maximum values and the minimum values in the 20 paths of sub-data to be processed are sorted to form corresponding signal peak value serial data.
[0021] In a preferred embodiment of the present application, in the above-mentioned oscilloscope peak signal extraction method, for each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a 10-fold extraction submodule, the peak signal extraction submodule performs size comparison processing on the 20 parallel sub-data to be processed included in the data to be processed, and outputs the maximum value and the minimum value of the 20 sub-data to be processed, including:
[0022] For each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to the 10-fold extraction submodule, the 8-fold extraction unit in the peak signal extraction submodule is used to perform size comparison processing on the first 16 paths of the sub-data to be processed among the 20 parallel paths of the sub-data to be processed included in the data to be processed, and the maximum value and the minimum value of the 16 paths of the sub-data to be processed are output, and the 2-fold extraction unit in the peak signal extraction submodule is used to perform size comparison processing on the last 4 paths of the sub-data to be processed among the 20 parallel paths of the sub-data to be processed included in the data to be processed, and the maximum value and the minimum value of the 4 paths of the sub-data to be processed are output;
[0023] The 2x extraction unit in the peak signal extraction submodule compares the maximum and minimum values in the 16 channels of sub-data to be processed and the maximum and minimum values in the 4 channels of sub-data to be processed, and outputs the maximum and minimum values in the 20 channels of sub-data to be processed.
[0024] In a preferred embodiment of the present application, in the above-mentioned oscilloscope peak signal extraction method, for each of the peak signal extraction submodules, according to the peak signal extraction mechanism pre-configured for the peak signal extraction submodule, the step of performing signal peak extraction processing on the data to be processed to obtain a signal peak serial data corresponding to the peak signal extraction submodule includes:
[0025] For each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a decimal multiple extraction submodule, a first signal peak extraction process is performed on the data to be processed by a first extraction unit in the peak signal extraction submodule to obtain a candidate maximum value and a candidate minimum value corresponding to the data to be processed, wherein the first decimal multiple extraction submodule is used to perform K-fold extraction on the data to be processed, the data to be processed includes P parallel paths of sub-data to be processed, K is greater than P, and the first extraction unit is used to perform P / 2-fold extraction on the P paths of sub-data to be processed;
[0026] By using the second extraction unit in the peak signal extraction submodule, a size comparison process is performed between the current data and the historical data on the candidate maximum value and the candidate minimum value corresponding to the data to be processed, and a target maximum value and a target minimum value are output;
[0027] According to the data number information corresponding to each channel of the sub-data to be processed, the target maximum value and the target minimum value are sorted to form corresponding signal peak value serial data.
[0028] In a preferred embodiment of the present application, in the above-mentioned oscilloscope peak signal extraction method, the step of performing a size comparison process of current data and historical data on the candidate maximum value and candidate minimum value corresponding to the data to be processed by the second extraction unit in the peak signal extraction submodule, and outputting a target maximum value and a target minimum value, includes:
[0029] Based on K and P, a first threshold and a second threshold are determined respectively;
[0030] By using the shift comparator in the second extraction unit in the peak signal extraction submodule, the candidate maximum value and candidate minimum value corresponding to the data to be processed are compared with the larger value and smaller value of the current data and the previous moment, and the current larger value and smaller value are output;
[0031] After each comparison process between the current data and the larger value and the smaller value at the previous moment, a counting process is performed by the first counter in the second extraction unit in the peak signal extraction submodule, so that the corresponding first count value increases, and when the current first count value reaches the first threshold value, the current larger value and the smaller value are output as the target maximum value and the target minimum value, and the current first count value is updated to the initial value;
[0032] After each time the current larger value and smaller value are output as the target maximum value and target minimum value, a counting process is performed through the second counter in the second extraction unit in the peak signal extraction submodule, so that the corresponding second count value increases, and, after the current second count value reaches the second threshold, the current second count value is updated to the initial value, and after the current data is compared with the larger value and smaller value of the previous moment, a counting process is performed through the first counter in the second extraction unit in the peak signal extraction submodule, so that the corresponding first count value is directly increased to the first threshold, and the current larger value and smaller value are output as the target maximum value and target minimum value, and the current first count value is updated to the initial value.
[0033] In a preferred embodiment of the present application, in the above-mentioned oscilloscope peak signal extraction method, the step of determining the first threshold and the second threshold based on K and P, respectively, comprises:
[0034] Based on K and P, a first threshold is obtained by calculating according to a first formula, wherein the first formula is: N=K / (P / 2), where N is the first threshold;
[0035] Based on K and P, a second threshold is obtained by calculation according to the second formula, wherein the second formula is: M=P / (K*2%P), M is the second threshold, and % is a modulo operation.
[0036] Based on the above, the present application also provides a field programmable gate array, which is used to execute the above oscilloscope peak signal extraction method.
[0037] The oscilloscope peak signal extraction method and field programmable gate array provided by the present application, first, through the parallel data input module in the field programmable gate array, the data to be processed is processed by slapping and registering processing to obtain the data to be processed; secondly, through the peak signal extraction module in the field programmable gate array, the data to be processed is processed by signal peak extraction processing to obtain at least one signal peak serial data; then, through the output module in the field programmable gate array, at least one signal peak serial data is output processed to output at least one signal peak parallel data corresponding to the data to be processed. Based on the above content, since the signal peak extraction processing is performed on the data to be processed by the peak signal extraction module, it is not necessary to rely on the DSP resources inside the field programmable gate array. For example, it can be realized by the logical internal LUT (Look-Up Table) in the field programmable gate array, so that compared with the solution of using CIC filter plus HBF half-band filter in the prior art, it can fully save the internal DSP resources, thereby improving the problem of unreliable resource allocation in the field programmable gate array in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings.
[0039] Figure 1 A flowchart of an oscilloscope peak signal extraction method provided in an embodiment of the present application.
[0040] Figure 2 A schematic diagram of the internal processing of a field programmable gate array provided in an embodiment of the present application.
[0041] Figure 3 A schematic diagram of the internal processing of the 2x extraction submodule provided in an embodiment of the present application.
[0042] Figure 4 A schematic diagram of the internal processing of the 10x extraction submodule provided in an embodiment of the present application.
[0043] Figure 5 A schematic diagram of the internal processing of the second extraction unit provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0045] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0046] An embodiment of the present application provides a field programmable gate array, wherein the field programmable gate array may include at least part of the following components:
[0047] Logic Elements / Logic Blocks: Look-Up Table (LUT): used to implement combinational logic functions. LUT quickly implements logic operations by pre-storing all possible input combinations and their corresponding output results. Typical LUTs can have 4 inputs, 6 inputs, etc., and are used to process logic functions of different complexities; Flip-Flops: used to store data and implement sequential logic functions. Flip-Flops are usually used to implement registers, counters, and state machines.
[0048] Interconnect Network: Routing Resources: Includes programmable switches and wiring used to connect different logic units inside the FPGA. These routing resources allow signals to be transmitted between logic units and form complex circuits. Switch Matrix: Controls the routing path of signals. The FPGA routing matrix determines the connection method between logic units and supports complex connection requirements.
[0049] Input / output units (I / O Blocks): I / O pins (I / O Pins): provide an interface between FPGA and the outside world. I / O pins support a variety of signal standards and voltage levels to adapt to different external devices and signal requirements; I / O units (I / OCells): responsible for processing input and output signal level conversion, buffering and signal shaping. These units ensure that FPGA can correctly receive and output signals;
[0050] Storage resources: Block RAM (BRAM): An embedded storage unit integrated in the FPGA. BRAM provides high-speed storage capabilities and is usually used for cache, FIFO (first-in-first-out) buffers, and data storage; Distributed RAM: A small storage unit implemented using a combination of LUTs or flip-flops, used to implement small storage requirements;
[0051] DSP Blocks (Digital Signal Processing Blocks): DSP units (DSP Blocks): Hardware units dedicated to performing multiplication, addition and other mathematical calculations. They provide efficient computing power in digital signal processing and high-performance computing applications;
[0052] Clock Management: Clock Management Units: including Phase-Locked Loop (PLL) and Clock Distribution Network, used to generate, distribute and manage clock signals to ensure accurate timing of FPGA internal circuits; Global Clock Network: provides high-performance clock distribution to ensure that all areas of the FPGA can receive stable clock signals;
[0053] Configuration and control: Configuration Memory: stores the configuration data of the FPGA, defines the logic units, routing resources, and I / O configurations. The configuration memory can be flash memory, EEPROM, or other forms of non-volatile memory; Configuration Interface: used to load the configuration data of the FPGA into the FPGA, and supports programming through interfaces such as JTAG and SPI;
[0054] Other functional blocks: Serial interface: includes high-speed serial transceivers (such as SerDes) for high-speed data transmission and supports various communication protocols; peripheral interface: may include USB, Ethernet and other peripheral interfaces for connection with external devices.
[0055] like Figure 1 and Figure 2 As shown, the embodiment of the present application also provides an oscilloscope peak signal extraction method applicable to the above-mentioned field programmable gate array. Among them, the method steps defined in the process related to the oscilloscope peak signal extraction method can be implemented by the field programmable gate array. Figure 1 The specific process shown is explained in detail.
[0056] Step S110, performing a slap register process on the data to be processed through the parallel data input module in the field programmable gate array to obtain the data to be processed, wherein the data to be processed includes parallel multiple channels of sub-data to be processed.
[0057] In an embodiment of the present application, the data to be processed may first be processed by a parallel data input module in the field programmable gate array to obtain the data to be processed, wherein the data to be processed includes parallel multiple channels of sub-data to be processed.
[0058] Step S120, performing signal peak extraction processing on the data to be processed by the peak signal extraction module in the field programmable gate array to obtain at least one corresponding signal peak serial data.
[0059] In an embodiment of the present application, after obtaining the data to be processed, the peak signal extraction module in the field programmable gate array can be used to perform signal peak extraction processing on the data to be processed to obtain at least one corresponding signal peak serial data. Wherein, the peak signal extraction module includes at least one peak signal extraction submodule, each of which is used to perform a corresponding signal peak extraction processing on the data to be processed to obtain a corresponding signal peak serial data, and the number of the at least one peak signal extraction submodule is greater than or equal to the number of the at least one signal peak serial data, and each of the signal peak serial data includes signal maximum value data and signal minimum value data.
[0060] Step S130: performing output processing on the at least one signal peak serial data through an output module in the field programmable gate array to output at least one signal peak parallel data corresponding to the data to be processed.
[0061] In an embodiment of the present application, after obtaining the at least one signal peak serial data, the at least one signal peak serial data can be output processed by the output module in the field programmable gate array to output at least one signal peak parallel data corresponding to the data to be processed. Wherein, the number of the at least one signal peak serial data is greater than or equal to the number of the at least one signal peak parallel data. Exemplarily, the output module can be a serial-to-parallel converter for converting the signal peak serial data into signal peak parallel data, so that the problem of data bit width becoming smaller can be avoided. In addition, in the field programmable gate array, the specific component for converting serial data into parallel data can be a serial register (Serial-to-Parallel Converter) or a shift register array (ShiftRegister Array), which can receive serial data bit by bit and output it in parallel after a certain clock cycle. In addition, in some other embodiments, considering that the number of peak signal extraction modules in the field programmable gate array may be multiple, but under different requirements, the signal peak parallel data (different signal extraction methods) that may need to be output are different, therefore, the field programmable gate array can also include a multi-way data selector, so that one or more required signal peak parallel data can be output based on the requirements. In addition, in some other implementations, based on considerations such as power consumption, corresponding enable switches can also be configured in multiple peak signal extraction modules. In this way, the corresponding switches can be turned on according to actual needs, thereby ensuring that the corresponding peak signal extraction module can obtain the data to be processed, so that the signal peak parallel data corresponding to the peak signal extraction module can be output finally.
[0062] Based on the above content, since the signal peak extraction processing is performed on the data to be processed through the peak signal extraction module, it is not necessary to rely on the DSP resources inside the field programmable gate array. For example, it can be implemented through the logical internal LUT (Look-Up Table) in the field programmable gate array. Compared with the solution of using a CIC filter plus a HBF half-band filter in the prior art, the internal DSP resources can be fully saved, thereby improving the problem of unreliable resource allocation in the field programmable gate array in the prior art.
[0063] It should be noted that for step S120, the specific processing method for performing signal peak extraction processing on the data to be processed is not limited and can be selected according to actual needs.
[0064] For example, in an alternative implementation, in order to ensure the richness of the signal peak extraction processing of the data to be processed to meet different extraction requirements, the above-mentioned step S120 may further include step S121 and step S122, and the specific content of each step is described as follows.
[0065] Step S121 : obtaining the data to be processed from the parallel data input module respectively through each peak signal extraction submodule included in the peak signal extraction module in the field programmable gate array.
[0066] In the embodiment of the present application, the data to be processed can be obtained from the parallel data input module respectively through each peak signal extraction submodule included in the peak signal extraction module in the field programmable gate array. The peak signal extraction module includes multiple peak signal extraction submodules, and the specific number can be selected according to actual needs.
[0067] Step S122, for each of the peak signal extraction submodules, according to the peak signal extraction mechanism pre-configured for the peak signal extraction submodule, perform signal peak extraction processing on the data to be processed to obtain a signal peak serial data corresponding to the peak signal extraction submodule.
[0068] In the embodiment of the present application, for each of the peak signal extraction submodules, the signal peak extraction process can be performed on the data to be processed according to the peak signal extraction mechanism pre-configured for the peak signal extraction submodule to obtain a signal peak serial data corresponding to the peak signal extraction submodule. Wherein, the two peak signal extraction mechanisms corresponding to each two peak signal extraction submodules in the multiple peak signal extraction submodules are different, so that it can be ensured that each two signal peak serial data obtained have different characteristics, thereby meeting different needs.
[0069] It can be understood that, in the above-mentioned step S122, the specific method of performing signal peak extraction processing on the data to be processed is not limited and can be selected according to actual needs.
[0070] For example, in a first alternative implementation, the above step S122 may further include step S122a and step S122b, the specific contents of which are as follows.
[0071] Step S122a, for each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a 2x extraction submodule, the peak signal extraction submodule performs size comparison processing on the 4 parallel sub-data to be processed included in the data to be processed, and outputs the maximum value and minimum value of the 4 sub-data to be processed.
[0072] In the embodiment of the present application, for each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a 2x extraction submodule, the peak signal extraction submodule performs size comparison processing on the 4 parallel sub-data to be processed included in the data to be processed, and outputs the maximum value and minimum value of the 4 sub-data to be processed. It should be noted that one or more 2x extraction submodules may be included in the peak signal extraction module.
[0073] Step S122b, sorting the maximum values and minimum values in the four paths of sub-data to be processed according to the data serial number information corresponding to each path of sub-data to be processed, to form corresponding signal peak value serial data.
[0074] In an embodiment of the present application, after obtaining the maximum value and the minimum value in the 4 channels of sub-data to be processed, the maximum value and the minimum value in the 4 channels of sub-data to be processed can be sorted according to the data number information corresponding to each channel of the sub-data to be processed to form corresponding signal peak serial data. For example, the data number information corresponding to the minimum value is smaller than the data number information corresponding to the maximum value. In this way, in the signal peak serial data, the minimum value can be in front and the maximum value can be in the back. Based on this, the waveform distortion problem that occurs after the order of the maximum value and the minimum value after extraction is exchanged can be avoided.
[0075] It can be understood that, in the above step S122a, the specific manner of performing size comparison processing on the 4 parallel sub-data to be processed included in the data to be processed by the peak signal extraction submodule is not limited. For example, in an alternative implementation, in order to ensure that the maximum value and the minimum value can be determined reliably and effectively, the above step S122a may further include:
[0076] First, for each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to the 2-fold extraction submodule, the first data comparator in the peak signal extraction submodule can be used to compare the size of the first two subdata to be processed among the four parallel subdata to be processed included in the data to be processed, so as to obtain a larger first subdata to be processed and a smaller first subdata to be processed, and the second data comparator in the peak signal extraction submodule can be used to compare the size of the last two subdata to be processed among the four parallel subdata to be processed included in the data to be processed, so as to obtain a larger second subdata to be processed and a smaller second subdata to be processed;
[0077] Secondly, the third data comparator in the peak signal extraction submodule can be used to compare the larger first-channel sub-data to be processed and the larger second-channel sub-data to be processed to obtain the maximum value among the four channels of sub-data to be processed, and the fourth data comparator in the peak signal extraction submodule can be used to compare the smaller first-channel sub-data to be processed and the smaller second-channel sub-data to be processed to obtain the minimum value among the four channels of sub-data to be processed.
[0078] Combination Figure 3 In a specific application example, the input can be 4 parallel data, namely A1, A2, A3, A4, and the ids (i.e., data number information) of the 4 data are 0, 1, 2, and 3 respectively. The function of the data id is to record the order of the data. The 2x extraction submodule outputs the maximum and minimum values of the 4 data through a 3-beat clock. In the first beat, the sizes of A1 and A2, A3 and A4 are compared respectively, and the id values of the data are recorded. In the second beat, the two large values max_0 and max_1 of the previous beat are compared, and the two small values min_0 and min_1 of the previous beat are compared, and the large value max and the id of the large value, and the small value min and the id of the small value of the final 4 data are recorded. In the third beat, the ids of the large and small values are compared, and the data with the smaller id are arranged in front, and finally two parallel data Q0 and Q1 are output.
[0079] In addition, by instantiating X / 4 modules (2x extraction submodules) for X-way parallel data, 2x extraction of parallel data can be completed. Moreover, for 2^n-fold extraction submodules, the design of 2^n extraction modules can be completed by multiplexing 2x extraction submodules. For example, if 4x extraction is required, the 2x extracted data can be extracted again by 2x extraction.
[0080] For another example, in a second alternative implementation, the above step S122 may further include step S122c and step S122d, the specific contents of which are described as follows.
[0081] Step S122c, for each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a 10x extraction submodule, the peak signal extraction submodule performs size comparison processing on the 20 parallel sub-data to be processed included in the data to be processed, and outputs the maximum value and minimum value of the 20 sub-data to be processed.
[0082] In the embodiment of the present application, for each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a 10-fold extraction submodule, the peak signal extraction submodule can perform size comparison processing on the 20 parallel sub-data to be processed included in the data to be processed, and output the maximum value and minimum value of the 20 sub-data to be processed. It should be noted that one or more 10-fold extraction submodules can be included in the peak signal extraction module.
[0083] Step S122d: sort the maximum and minimum values of the 20 paths of sub-data to be processed according to the data serial number information corresponding to each path of the sub-data to be processed, to form corresponding signal peak serial data.
[0084] In an embodiment of the present application, after obtaining the maximum and minimum values in the 20 sub-data to be processed, the maximum and minimum values in the 20 sub-data to be processed can be sorted according to the data number information corresponding to each sub-data to be processed to form corresponding signal peak serial data, as described above.
[0085] It is understandable that in the above step S122c, the specific manner of performing size comparison processing on the 20 parallel sub-data to be processed included in the data to be processed by the peak signal extraction submodule is not limited and can be selected according to actual needs. For example, in an alternative implementation, combined with Figure 4 , the above step S122c may further include the following contents:
[0086] First, for each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a 10-fold extraction submodule, the 8-fold extraction unit in the peak signal extraction submodule can be used to perform size comparison processing on the first 16 paths of the sub-data to be processed among the 20 parallel paths of the sub-data to be processed included in the data to be processed, and the maximum value and the minimum value of the 16 paths of the sub-data to be processed can be output, and the 2-fold extraction unit in the peak signal extraction submodule can be used to perform size comparison processing on the last 4 paths of the sub-data to be processed among the 20 parallel paths of the sub-data to be processed included in the data to be processed, and the maximum value and the minimum value of the 4 paths of the sub-data to be processed can be output;
[0087] Finally, the maximum value and the minimum value in the 16-channel sub-data to be processed and the maximum value and the minimum value in the 4-channel sub-data to be processed are compared through the 2-fold extraction unit in the peak signal extraction submodule, and the maximum value and the minimum value in the 20-channel sub-data to be processed are output.
[0088] It should be noted that, for the 10n-fold decimation performed by the 10n-fold decimation submodule, the 10n-fold decimation can be obtained by performing n times of 2 decimation on the output data of the 10n-fold decimation submodule. For example, when decimating by 20 times, it is only necessary to perform another 2-fold decimation on the data after 10 times decimation.
[0089] For another example, in a third alternative implementation, the above-mentioned step S122 may further include step S122e, step S122f and step S122g, the specific contents of which are described as follows.
[0090] Step S122e, for each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a decimal multiple extraction submodule, the first signal peak extraction process is performed on the data to be processed through the first extraction unit in the peak signal extraction submodule to obtain the candidate maximum value and candidate minimum value corresponding to the data to be processed.
[0091] In the embodiment of the present application, for each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a decimal multiple extraction submodule, the first signal peak extraction processing is performed on the data to be processed by the first extraction unit in the peak signal extraction submodule to obtain the candidate maximum value and candidate minimum value corresponding to the data to be processed. Wherein, the first decimal multiple extraction submodule is used to extract the data to be processed by K times, the data to be processed includes P parallel sub-data to be processed, K is greater than P, and the first extraction unit is used to extract the P sub-data to be processed by P / 2 times, such as 10n times extraction, n is greater than or equal to 1.
[0092] Step S122f, through the second extraction unit in the peak signal extraction submodule, compare the candidate maximum value and candidate minimum value corresponding to the data to be processed with the current data and the historical data, and output the target maximum value and the target minimum value.
[0093] In an embodiment of the present application, after obtaining the candidate maximum value and candidate minimum value corresponding to the data to be processed, the second extraction unit in the peak signal extraction submodule can be used to compare the size of the current data with the historical data for the candidate maximum value and candidate minimum value corresponding to the data to be processed, and output the target maximum value and target minimum value. Exemplarily, the second extraction unit can be a serial shift size comparison. For example, at a first moment, the first extraction unit outputs the first candidate maximum value and the first candidate minimum value, and at a second moment, the first extraction unit outputs the second candidate maximum value and the second candidate minimum value, and then, the second candidate maximum value and the second candidate minimum value can be compared with the first candidate maximum value and the first candidate minimum value, so that the second extraction unit outputs the larger value and the smaller value therein, and thus, the target maximum value and the target minimum value can be output based on the larger value and the smaller value therein.
[0094] Step S122g: sort the target maximum value and the target minimum value according to the data serial number information corresponding to each channel of the sub-data to be processed, to form corresponding signal peak value serial data.
[0095] In an embodiment of the present application, after obtaining the target maximum value and the target minimum value, the target maximum value and the target minimum value can be sorted according to the data number information corresponding to each channel of the sub-data to be processed to form corresponding signal peak serial data, as described above.
[0096] It can be understood that, in the above step S122f, the candidate maximum value and the candidate minimum value corresponding to the data to be processed are compared with the current data and the historical data, and the specific method of outputting the target maximum value and the target minimum value is not limited and can be selected according to actual needs. For example, in an alternative implementation, the above step S122f may include:
[0097] First, based on K and P, a first threshold and a second threshold can be determined respectively;
[0098] Secondly, the shift comparator in the second extraction unit in the peak signal extraction submodule can be used to compare the candidate maximum value and candidate minimum value corresponding to the data to be processed with the larger value and smaller value of the current data and the previous moment, and output the current larger value and smaller value;
[0099] Then, after each comparison process between the current data and the larger value and the smaller value at the previous moment, a counting process may be performed by the first counter in the second extraction unit in the peak signal extraction submodule, so that the corresponding first count value increases, and when the current first count value reaches the first threshold value, the current larger value and the smaller value are output as the target maximum value and the target minimum value, and the current first count value is updated to the initial value;
[0100] Finally, after each time the current larger value and smaller value are output as the target maximum value and target minimum value, a counting process is performed by the second counter in the second extraction unit in the peak signal extraction submodule, so that the corresponding second count value increases, and, after the current second count value reaches the second threshold, the current second count value is updated to the initial value, and after the current data is compared with the larger value and smaller value of the previous moment again, a counting process is performed by the first counter in the second extraction unit in the peak signal extraction submodule, so that the corresponding first count value is directly increased to the first threshold, and the current larger value and smaller value are output as the target maximum value and target minimum value, and the current first count value is updated to the initial value.
[0101] For example, the first extraction unit may output multiple groups of candidate maximum values and candidate minimum values in sequence at multiple moments, as shown in the following table:
[0102] First extraction unit Candidate maximum Candidate minimum value First Moment A11 A12 Second Moment A21 A22 The Third Moment A31 A32 The fourth moment A41 A42 The fifth moment A51 A52 The Sixth Moment A61 A62 The Seventh Moment A71 A72 Eighth Moment A81 A82
[0103] Based on this, in the second extraction unit, at the first moment, A11 and A21 can be compared to obtain the larger value, such as A11, and A12 and A22 can be compared to obtain the smaller value, such as A22. In this way, A11 and A22 can be retained. At this time, the first counter (such as Figure 5 The first count value of the counter cnt1 in the example is increased, such as from 0 to 1. At the second moment, A31 and A11 can be compared to obtain the larger value, such as A31, and A32 and A22 can be compared to obtain the smaller value, such as A32. In this way, A31 and A32 can be retained. At this time, the first count value of the first counter can be increased, such as from 1 to 2. Assuming that the first threshold is equal to 2, since the first count value has reached the first threshold, it means that a small cycle has been completed. At this time, A31 and A32 can be output, and the first count value can be updated to the initial value, such as 0. In addition, the second counter (such as Figure 5The second count value of the counter cnt2 in the circuit increases, such as changing from 0 to 1. After that, at the third moment, A41 and A51 can be compared to obtain the larger value, such as A51, and A42 and A52 can be compared to obtain the larger value, such as A42. In this way, A51 and A42 can be retained. At this time, the first count value of the first counter can be increased, such as changing from 0 to 1 again. At the fourth moment, A61 and A51 can be compared to obtain the larger value, such as A51, and A62 and A42 can be compared to obtain the smaller value, such as A42. In this way, A51 and A42 can be retained. At this time, the first count value of the first counter can continue to increase, such as changing from 1 to 2. Since the first threshold has been reached and a small cycle has been completed, A51 and A42 can be output at this time, and the first count value can be updated to the initial value again. In addition, the second count value of the second counter can also be increased, such as changing from 1 to 2. Assuming that the second threshold is also equal to 2, since the second count value has reached the second threshold, it indicates that a large cycle has been completed, and the second count value is updated to the initial value, such as 0. At the fifth moment, A71 and A81 can be compared to obtain the larger value, such as A71, and A72 and A82 can be compared to obtain the larger value, such as A82. At this time, the first count value can be directly filled up, that is, updated to 2, that is, a small cycle is completed, and A71 and A82 are output. After that, the first count value is updated to the initial value again, and the second calculation value is updated from 0 to 1. The cycle is processed in this way, as shown in the following table:
[0104]
[0105]
[0106] It is understandable that the specific method for determining the first threshold and the second threshold in the above steps is not limited and can be selected according to actual needs. For example, in an alternative implementation, in order to ensure that the parallel P-channel to-be-processed sub-data can be reliably extracted by K times based on the first threshold and the second threshold, the first threshold and the second threshold can be determined based on the following steps:
[0107] In a first aspect, a first threshold value may be obtained by calculating according to a first formula based on K and P, wherein the first formula is: N=K / (P / 2), where N is the first threshold value;
[0108] Secondly, the second threshold can be obtained by calculating according to the second formula based on K and P, where the second formula is: M=P / (K*2%P), M is the second threshold, and % is a modulo operation.
[0109] It should be noted that, in the first formula and the second formula, K / (P / 2) needs to be rounded down to obtain N. Also, P / (K*2%P) needs to be rounded down to obtain M.
[0110] In summary, the oscilloscope peak signal extraction method and field programmable gate array provided by the present application, first, through the parallel data input module in the field programmable gate array, the data to be processed is processed by beating and registering to obtain the data to be processed; secondly, through the peak signal extraction module in the field programmable gate array, the data to be processed is processed by signal peak extraction processing to obtain at least one signal peak serial data; then, through the output module in the field programmable gate array, at least one signal peak serial data is output processed to output at least one signal peak parallel data corresponding to the data to be processed. Based on the above content, since the signal peak extraction processing is performed on the data to be processed by the peak signal extraction module, it is not necessary to rely on the DSP resources inside the field programmable gate array. For example, it can be realized by the logical internal LUT (Look-Up Table) in the field programmable gate array, so that compared with the solution of using CIC filter plus HBF half-band filter in the prior art, it can fully save the internal DSP resources, thereby improving the problem of unreliable resource allocation in the field programmable gate array in the prior art.
[0111] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for extracting peak signal from an oscilloscope, characterized in that: Applied to a field programmable gate array, the oscilloscope peak signal extraction method comprises: Through the parallel data input module in the field programmable gate array, the data to be processed is subjected to a slapping and registering process to obtain the data to be processed, wherein the data to be processed includes parallel multiple channels of sub-data to be processed; The peak signal extraction module in the field programmable gate array is used to perform signal peak extraction processing on the data to be processed to obtain at least one corresponding signal peak serial data, wherein the peak signal extraction module includes at least one peak signal extraction submodule, each of the peak signal extraction submodules is used to perform a corresponding signal peak extraction processing on the data to be processed to obtain a corresponding signal peak serial data, and the number of the at least one peak signal extraction submodule is greater than or equal to the number of the at least one signal peak serial data, and each of the signal peak serial data includes signal maximum value data and signal minimum value data; The at least one signal peak serial data is output processed through the output module in the field programmable gate array to output at least one signal peak parallel data corresponding to the data to be processed, wherein the number of the at least one signal peak serial data is greater than or equal to the number of the at least one signal peak parallel data.
2. The oscilloscope peak signal extraction method according to claim 1, characterized in that: The step of performing signal peak extraction processing on the data to be processed by the peak signal extraction module in the field programmable gate array to obtain corresponding at least one signal peak serial data includes: Respectively acquiring the data to be processed from the parallel data input module through each peak signal extraction submodule included in the peak signal extraction module in the field programmable gate array, wherein the peak signal extraction module includes a plurality of peak signal extraction submodules; For each of the peak signal extraction submodules, signal peak extraction is performed on the data to be processed according to the peak signal extraction mechanism pre-configured for the peak signal extraction submodule to obtain a signal peak serial data corresponding to the peak signal extraction submodule, wherein the two peak signal extraction mechanisms corresponding to every two peak signal extraction submodules in the multiple peak signal extraction submodules are different.
3. The oscilloscope peak signal extraction method according to claim 2, characterized in that: The step of performing signal peak extraction processing on the data to be processed according to the peak signal extraction mechanism pre-configured for the peak signal extraction submodule for each of the peak signal extraction submodules to obtain a signal peak serial data corresponding to the peak signal extraction submodule includes: For each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a 2-fold extraction submodule, the peak signal extraction submodule performs size comparison processing on the 4 parallel sub-data to be processed included in the data to be processed, and outputs the maximum value and the minimum value of the 4 sub-data to be processed; According to the data number information corresponding to each path of the sub-data to be processed, the maximum values and the minimum values in the four paths of sub-data to be processed are sorted to form corresponding signal peak value serial data.
4. The oscilloscope peak signal extraction method according to claim 3, characterized in that: For each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a 2-fold extraction submodule, the step of performing size comparison processing on the 4 parallel sub-data to be processed included in the data to be processed by the peak signal extraction submodule, and outputting the maximum value and the minimum value of the 4 sub-data to be processed includes: For each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to the 2-fold extraction submodule, the first data comparator in the peak signal extraction submodule performs size comparison processing on the first two paths of subdata to be processed among the four parallel paths of subdata to be processed included in the data to be processed, so as to obtain a larger first path of subdata to be processed and a smaller first path of subdata to be processed, and the second data comparator in the peak signal extraction submodule performs size comparison processing on the second two paths of subdata to be processed among the four parallel paths of subdata to be processed included in the data to be processed, so as to obtain a larger second path of subdata to be processed and a smaller second path of subdata to be processed; The third data comparator in the peak signal extraction submodule compares the larger first-path sub-data to be processed and the larger second-path sub-data to be processed to obtain the maximum value among the four paths of sub-data to be processed, and the fourth data comparator in the peak signal extraction submodule compares the smaller first-path sub-data to be processed and the smaller second-path sub-data to be processed to obtain the minimum value among the four paths of sub-data to be processed.
5. The oscilloscope peak signal extraction method according to claim 2, characterized in that: The step of performing signal peak extraction processing on the data to be processed according to the peak signal extraction mechanism pre-configured for the peak signal extraction submodule for each of the peak signal extraction submodules to obtain a signal peak serial data corresponding to the peak signal extraction submodule includes: For each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to the 10-fold extraction submodule, the peak signal extraction submodule performs size comparison processing on the 20 parallel sub-data to be processed included in the data to be processed, and outputs the maximum value and the minimum value of the 20 sub-data to be processed; According to the data number information corresponding to each path of the sub-data to be processed, the maximum values and the minimum values in the 20 paths of sub-data to be processed are sorted to form corresponding signal peak value serial data.
6. The oscilloscope peak signal extraction method according to claim 5, characterized in that: For each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a 10-fold extraction submodule, the peak signal extraction submodule performs size comparison processing on 20 parallel sub-data to be processed included in the data to be processed, and outputs the maximum value and the minimum value of the 20 sub-data to be processed, including: For each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to the 10-fold extraction submodule, the 8-fold extraction unit in the peak signal extraction submodule is used to perform size comparison processing on the first 16 paths of the sub-data to be processed among the 20 parallel paths of the sub-data to be processed included in the data to be processed, and the maximum value and the minimum value of the 16 paths of the sub-data to be processed are output, and the 2-fold extraction unit in the peak signal extraction submodule is used to perform size comparison processing on the last 4 paths of the sub-data to be processed among the 20 parallel paths of the sub-data to be processed included in the data to be processed, and the maximum value and the minimum value of the 4 paths of the sub-data to be processed are output; The 2x extraction unit in the peak signal extraction submodule compares the maximum and minimum values in the 16 channels of sub-data to be processed and the maximum and minimum values in the 4 channels of sub-data to be processed, and outputs the maximum and minimum values in the 20 channels of sub-data to be processed.
7. The oscilloscope peak signal extraction method according to claim 2, characterized in that: The step of performing signal peak extraction processing on the data to be processed according to the peak signal extraction mechanism pre-configured for the peak signal extraction submodule for each of the peak signal extraction submodules to obtain a signal peak serial data corresponding to the peak signal extraction submodule includes: For each of the peak signal extraction submodules, when the peak signal extraction submodule belongs to a decimal multiple extraction submodule, a first signal peak extraction process is performed on the data to be processed by a first extraction unit in the peak signal extraction submodule to obtain a candidate maximum value and a candidate minimum value corresponding to the data to be processed, wherein the first decimal multiple extraction submodule is used to perform K-fold extraction on the data to be processed, the data to be processed includes P parallel paths of sub-data to be processed, K is greater than P, and the first extraction unit is used to perform P / 2-fold extraction on the P paths of sub-data to be processed; By using the second extraction unit in the peak signal extraction submodule, a size comparison process is performed between the current data and the historical data on the candidate maximum value and the candidate minimum value corresponding to the data to be processed, and a target maximum value and a target minimum value are output; According to the data number information corresponding to each channel of the sub-data to be processed, the target maximum value and the target minimum value are sorted to form corresponding signal peak value serial data.
8. The oscilloscope peak signal extraction method according to claim 7, characterized in that: The step of performing a size comparison process between current data and historical data on the candidate maximum value and candidate minimum value corresponding to the data to be processed by the second extraction unit in the peak signal extraction submodule, and outputting a target maximum value and a target minimum value, comprises: Based on K and P, a first threshold and a second threshold are determined respectively; By using the shift comparator in the second extraction unit in the peak signal extraction submodule, the candidate maximum value and candidate minimum value corresponding to the data to be processed are compared with the larger value and smaller value of the current data and the previous moment, and the current larger value and smaller value are output; After each comparison process between the current data and the larger value and the smaller value at the previous moment, a counting process is performed by the first counter in the second extraction unit in the peak signal extraction submodule, so that the corresponding first count value increases, and when the current first count value reaches the first threshold value, the current larger value and the smaller value are output as the target maximum value and the target minimum value, and the current first count value is updated to the initial value; After each time the current larger value and smaller value are output as the target maximum value and target minimum value, a counting process is performed through the second counter in the second extraction unit in the peak signal extraction submodule, so that the corresponding second count value increases, and, after the current second count value reaches the second threshold, the current second count value is updated to the initial value, and after the current data is compared with the larger value and smaller value of the previous moment, a counting process is performed through the first counter in the second extraction unit in the peak signal extraction submodule, so that the corresponding first count value is directly increased to the first threshold, and the current larger value and smaller value are output as the target maximum value and target minimum value, and the current first count value is updated to the initial value.
9. The oscilloscope peak signal extraction method according to claim 8, characterized in that: The step of determining the first threshold and the second threshold respectively based on K and P comprises: Based on K and P, a first threshold is obtained by calculating according to a first formula, wherein the first formula is: N=K / (P / 2), where N is the first threshold; Based on K and P, a second threshold is obtained by calculation according to the second formula, wherein the second formula is: M=P / (K*2%P), M is the second threshold, and % is a modulo operation.
10. A field programmable gate array, characterized in that: The field programmable gate array is used to execute the oscilloscope peak signal extraction method described in any one of claims 1-9.
