A method for drawing arbitrary waves based on oscilloscope

By providing editing mode and drawing mode in the oscilloscope, users can directly set and generate algorithm parameter values, solving the inefficiency problem caused by repeated reading of external data in the prior art, and achieving efficient arbitrary waveform generation and display.

CN118483465BActive Publication Date: 2024-11-15QINGDAO HANTEK INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410614163.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2024-11-15
Estimated Expiration
2044-05-17

AI Technical Summary

Technical Problem

When generating any waveforms required by users, existing oscilloscopes need to repeatedly read external file data, resulting in low test processing efficiency and cannot meet the current requirements.

Method used

Two graphical interface modes based on the oscilloscope are provided: edit mode and drawing mode. Through these modes, users set parameter adjustment configuration items and generate algorithm parameter values, and directly send display waveform diagrams on the FPGA, avoiding the repeated steps of reading external data.

Benefits of technology

It improves the rapid editing ability when the number of waveform points is small, improves the drawing efficiency when the number of waveform points is large, and realizes efficient arbitrary waveform generation without repeated reading of external data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118483465B_ABST
    Figure CN118483465B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for drawing arbitrary waves based on an oscilloscope, and the steps include: step S100: providing two graphical interface modes for arbitrary wave editing to a user: an editing mode and a drawing mode; step S200: the user sets the parameter configuration items of the editing mode and the drawing mode through the graphical interface; step S300: obtaining the parameter configuration items set by the user on the graphical interface; step S400: based on the algorithm parameter values ​​of waveform data generated by the obtained parameter configuration items in the editing mode; step S500: based on the coordinate values ​​of the waveform trajectory drawn by the user in the drawing mode, the algorithm parameter values ​​are generated; step S600: the algorithm parameter values ​​are sent to the oscilloscope through FPGA to display the waveform diagram. The present invention does not need to repeatedly read the data in the external file to generate the waveform required by the user, and can more efficiently realize the arbitrary waveform required by the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of waveform processing, in particular to a method for drawing arbitrary waves based on an oscilloscope. Background Art

[0002] The signal source is a must-have function in an oscilloscope, and there are many types of signal sources, such as sine wave signal sources, pulse generators, and arbitrary waveform generators, etc. However, the arbitrary waveform generator is a special type of signal source. It has the ability to generate waveforms from other signal sources and is more suitable for various simulation experiments. The arbitrary waveform generator is the best instrument for simulation experiments. It has all the characteristics of a signal source. Traditional technology generally uses the signal source to provide the required known signal (various waveforms) to the circuit under test, and then uses other instruments to measure the parameters of interest.

[0003] It can be seen that the signal source in electronic experiments and test processing does not measure any parameters but simulates various test signals according to the user's requirements and provides them to the circuit under test to meet the test needs; and in existing oscilloscopes, arbitrary wave generators usually generate the waveform required by users by reading data in external files, and if you want to continue editing the waveform, you need to read it again, which makes the test processing efficiency low;

[0004] Existing technologies can no longer meet people’s needs at this stage. Based on the current situation, it is urgent to reform existing technologies. Summary of the invention

[0005] The purpose of the present invention is to provide a method for drawing arbitrary waves based on an oscilloscope to solve the problems raised in the above background technology.

[0006] The present invention provides the following technical solution: a method for drawing arbitrary waves based on an oscilloscope, the steps comprising:

[0007] Step S100: providing the user with two graphical interface modes for arbitrary wave editing: editing mode and drawing mode;

[0008] Step S200: The user sets the parameter configuration items of the editing mode and the drawing mode through the graphical interface;

[0009] Step S300: Obtain the parameter configuration items set by the user on the graphical interface;

[0010] Step S400: generating algorithm parameter values ​​of waveform data based on the acquired parameter configuration items in the editing mode;

[0011] Step S500: Based on the coordinate values ​​of the waveform trajectory drawn by the user in the drawing mode, the algorithm parameter values ​​are generated;

[0012] Step S600: Send the algorithm parameter value to the oscilloscope through the FPGA to display the waveform.

[0013] Preferably, the graphical interface generated in the editing mode is presented in a list format, and the graphical interface generated in the drawing mode is presented in an oscilloscope waveform interface.

[0014] Preferably, the parameter adjustment configuration item is used to limit the number of waveform points drawn by the oscilloscope, wherein each waveform point corresponds to the sequence number, time and voltage value of a waveform point.

[0015] Preferably, the user sets different parameter configuration items in editing mode and drawing mode on the graphical interface, wherein the graphical interface provided to the user includes a data control corresponding to each parameter configuration item for selecting the editing content of different parameter configuration items.

[0016] Preferably, in the editing mode, the algorithm parameter values ​​include: the number of waveform points and the voltage value corresponding to the waveform points. In the editing mode, the number of waveform points is generated by the point parameter value configuration item set by the user; the voltage value corresponding to the waveform point is generated by the voltage value parameter value configuration item set by the user.

[0017] Preferably, in the drawing mode, the algorithm parameter values ​​include: the coordinate value of the waveform point and the voltage value corresponding to the coordinate value of the waveform point, wherein the coordinate value of the waveform point is generated by the position of the waveform point when the user draws the waveform trajectory; the voltage value corresponding to the coordinate value of the waveform point is obtained by converting the coordinate value of the waveform point.

[0018] The present invention has the following beneficial effects:

[0019] (1) The present invention includes an editing mode and a drawing mode for selection. When the number of waveform points is small, the editing mode can quickly edit the data desired by the user; when the number of waveform points is large, the drawing mode is executed to draw the trajectory of an arbitrary waveform to improve execution efficiency.

[0020] (2) The present invention does not need to repeatedly read data in an external file to generate the waveform required by the user, and can more efficiently realize any waveform required by the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a schematic diagram of the process of the present invention;

[0022] Figure 2 This is a schematic diagram of the editing interface of the editing mode of the present invention;

[0023] Figure 3 This is a schematic diagram of the drawing interface of the drawing mode of the present invention. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field of the present invention without creative work are within the scope of protection of the present invention.

[0025] refer to Figure 1-Figure 3 The present invention provides the following technical solution: a method for drawing arbitrary waves based on an oscilloscope, the steps comprising:

[0026] Step S100: providing the user with two graphical interface modes for arbitrary wave editing: an editing mode and a drawing mode.

[0027] In this embodiment, the user can set the editing mode or the drawing mode on the graphical interface used to select and set the drawing of arbitrary waves; wherein the graphical interface generated in the editing mode is presented in a list format, and the graphical interface generated in the drawing mode is presented as an oscilloscope waveform interface; the serial numbers in the graphical interface generated in the editing mode are arranged from small to large based on the parameter configuration items set by the user in step S200, and the user can change the order of the graphical interfaces in the editing mode by changing the parameter configuration items in step S200.

[0028] In this embodiment, when drawing an arbitrary wave, for the case of a small number of waveform points, the editing mode can quickly edit the data the user wants; while for the case of a large number of waveform points, the editing mode can only edit sequentially, which will result in a low execution efficiency of the waveform generator. Therefore, for the case of a large number of waveform points, it is necessary to execute the drawing mode to draw the trajectory of the arbitrary waveform to improve the execution efficiency.

[0029] Step S200: The user sets the parameter configuration items of the editing mode and the drawing mode through the graphical interface;

[0030] The parameter configuration items are used to limit the number of waveform points drawn by the oscilloscope, wherein each waveform point corresponds to the serial number, time and voltage value of a waveform point respectively; for the editing mode, two groups of parameter configuration items are provided to the user: point parameter value configuration items and voltage parameter value configuration items; for the drawing mode, a graphical drawing interface is provided to the user, and the corresponding waveform data can be manually drawn through the oscilloscope touch screen.

[0031] In this embodiment, for different waveform data of the oscilloscope, the different parameter value configuration items corresponding to each point are different. The number of points displayed can be set in the editing mode by adjusting the point parameter value configuration item; the voltage value parameter value configuration item can be generated based on the parameter configuration item set by the user, wherein the voltage value parameter value configuration item is used to set the voltage value corresponding to each waveform point of the parameter configuration item.

[0032] In this embodiment, the user can click on the voltage value parameter configuration item in the graphical interface generated by the step S200, and perform input operations through the generated graphical interface to set the voltage value parameter configuration item, wherein the voltage value parameter configuration item is related to the amplitude currently set by the oscilloscope, wherein the voltage value parameter configuration item cannot exceed the amplitude value of the oscilloscope.

[0033] Step S300: Obtain the parameter configuration items set by the user on the graphical interface;

[0034] The user sets different parameter configuration items in editing mode and drawing mode on the graphical interface, wherein the graphical interface provided to the user includes a data control corresponding to each parameter configuration item, and the user can select the editing content of different parameter configuration items;

[0035] In this embodiment, when setting the parameter configuration item of the edit mode, the parameter list of the edit mode can be set to increase or decrease according to the waveform point parameter value set by the user;

[0036] In this embodiment, when setting the parameter configuration items of the drawing mode, the parameter value of each corresponding waveform point can be obtained by providing a graphic drawing interface to the user.

[0037] Step S400: generating algorithm parameter values ​​of waveform data based on the acquired parameter configuration items in the editing mode;

[0038] In the edit mode, the algorithm parameter values ​​include the number of waveform points and the voltage value corresponding to the waveform points. In the edit mode, the number of waveform points is generated by the point parameter value configuration item set by the user; the voltage value corresponding to the waveform points is generated by the voltage value parameter value configuration item set by the user;

[0039] In this embodiment, in the editing mode, the voltage value corresponding to the waveform point number is obtained according to the input operation of the voltage value parameter value configuration item performed by the user on the graphical interface, and the voltage value corresponding to the waveform point number is used to directly specify the specific voltage value of the corresponding waveform point.

[0040] In this embodiment, the waveform points further include two additional parameter values: an edit list and drawing points. The edit list is the parameter value of each waveform point set by the user based on the graphical interface in the edit mode; the drawing points are the waveform points displayed by the user based on the graphical interface in the drawing mode.

[0041] Step S500: Based on the coordinate values ​​of the waveform trajectory drawn by the user in the drawing mode, the algorithm parameter values ​​are generated;

[0042] In the drawing mode, the algorithm parameter values ​​include: the coordinate value of the waveform point and the voltage value corresponding to the coordinate value of the waveform point, wherein the coordinate value of the waveform point is generated by the position of the waveform point when the user draws the waveform trajectory; the voltage value corresponding to the coordinate value of the waveform point is obtained by converting the coordinate value of the waveform point.

[0043] Step S501: determining whether the drawn waveform points are complete;

[0044] The coordinate value of the waveform point is one of the parameters of the algorithm parameter value, and all the waveform points of the waveform trajectory need to be obtained; first, the user obtains the pos (position) of each waveform point by drawing the waveform trajectory, wherein, in order to determine the change of the corresponding position of the waveform in the graphical interface, the position where the user is located each time when pressing is saved, so as to draw and generate the waveform segment. After obtaining the pos, in order to prevent the incomplete phenomenon of the drawn waveform points during the drawing process of the graphical interface, it is necessary to judge the saved pos: first compare the value of the horizontal coordinate pos.x of each waveform point, wherein, each time pos is obtained when drawing the waveform trajectory, the pos.x of the current waveform point will be compared with the pos.x of the previous waveform point, until all the waveform points in the waveform trajectory are compared, and the maximum value posMax and the minimum value posMin of the horizontal coordinate of the waveform point are found. If the difference between posMax and posMin is greater than 1, it means that there are other waveform points between the two waveform points that have not been obtained, then the vertical coordinate pos.y of the nearest waveform point is taken and assigned to it, and the pos finally obtained by the above algorithm can correspond to the trajectory drawn by the user.

[0045] Step S502: converting the coordinate value into a pixel value;

[0046] The graphical interface uses pixel values, and the waveform points in the drawing mode correspond to coordinate values, so it is necessary to calculate the coordinate values ​​corresponding to each pixel point; when the voltage value of the voltage value parameter configuration item set by the user in step S200 is less than the total horizontal pixel value of the graphical interface, it means that one coordinate value corresponds to multiple pixel values, so the pixel value needs to be evenly distributed to each coordinate value; when the voltage value of the voltage value parameter configuration item set by the user in step S200 is greater than the total horizontal pixel value of the graphical interface, it means that one pixel value corresponds to multiple coordinate values, so it is necessary to evenly distribute the voltage value of the set voltage value parameter configuration item to each pixel value, and ensure that the multiple coordinate values ​​corresponding to each pixel value are equal.

[0047] In this embodiment, the specific implementation of step S501 and step S502 is as follows:

[0048] int x=event->pos().x(); / / Get the horizontal coordinate of the waveform point;

[0049] int y = event->pos().y(); / / Obtain the vertical coordinate of the waveform point;

[0050] / / Prevent incomplete waveform points

[0051] int maxX = (m_prePos.x() > x)? m_prePos.x() : x; / / Find the maximum abscissa value posMax of the waveform point;

[0052] int minX = (m_prePos.x() < x)? m_prePos.x() : x; / / Find the minimum abscissa value posmin of the waveform point;

[0053] / / Determine the difference between posMax and posmin;

[0054] if ((maxX - minX) > 1)

[0055] {

[0056] for (int i = 0; i < (maxX - minX); i++)

[0057] {

[0058] m_buff[minX + 1 + i - 105] = y; / / Convert the coordinate value to a pixel value and store it in m_buff;

[0059] m_poslist.insert(i, m_buff[i * step]);

[0060] int pointy = m_poslist.at(i); / / Retrieve the pixel value from m_buff as pointy;

[0061] }

[0062] }

[0063] Step S503: Convert the pixel value to the voltage value corresponding to the coordinate value of the waveform point;

[0064] Calculate the voltage value volt corresponding to the coordinate value of the waveform point according to the formula:

[0065] volt = (PIX_M - pointy) / (PIX_M - PIX_C) * tmpvolt;

[0066] Where PIX_M is the pixel value of the highest point in the graphical interface; PIX_C is the pixel value of the middle point in the graphical interface; tmpvolt is the oscilloscope amplitude value; pointy is the total horizontal pixel value of the graphical interface.

[0067] Step S600: Send the algorithm parameter value to the oscilloscope through the FPGA to display the waveform.

[0068] The algorithm parameter values ​​in the editing mode or the drawing mode are uploaded to the FPGA, and then the FPGA sends the voltage value in the algorithm parameter value to the oscilloscope, and the algorithm parameter value generated in the editing mode or the drawing mode will be displayed on the display screen of the oscilloscope to form an arbitrary wave graph.

[0069] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for drawing arbitrary waves based on an oscilloscope, It is characterized in that the steps include: Step S100: providing the user with two graphical interface modes for arbitrary wave editing: editing mode and drawing mode; wherein, The graphical interface generated in the editing mode is presented in a list format, and the graphical interface generated in the drawing mode is presented as an oscilloscope waveform interface; Step S200: The user sets the parameter configuration items of the editing mode and the drawing mode through the graphical interface; wherein, The parameter configuration item is used to limit the number of waveform points drawn by the oscilloscope, wherein each waveform point number corresponds to the sequence number, time and voltage value of a waveform point respectively; Step S300: Obtain the parameter configuration items set by the user on the graphical interface; wherein, The user sets different parameter configuration items in editing mode and drawing mode on the graphical interface, wherein the graphical interface provided to the user includes a data control corresponding to each parameter configuration item, which is used to select the editing content of different parameter configuration items; Step S400: Based on the acquired parameter configuration items in the editing mode, the algorithm parameter values ​​of the waveform data are generated; wherein, In the edit mode, the algorithm parameter values ​​include: waveform points and voltage values ​​corresponding to the waveform points. In the edit mode, the waveform points are generated by the point parameter value configuration item set by the user; the voltage values ​​corresponding to the waveform points are generated by the voltage value parameter value configuration item set by the user; Step S500: Based on the coordinate values ​​of the waveform trajectory drawn by the user in the drawing mode, the algorithm parameter values ​​are generated; wherein, In the drawing mode, the algorithm parameter values ​​include: the coordinate value of the waveform point and the voltage value corresponding to the coordinate value of the waveform point, wherein the coordinate value of the waveform point is generated by the position of the waveform point when the user draws the waveform trajectory; the voltage value corresponding to the coordinate value of the waveform point is obtained by converting the coordinate value of the waveform point; The step S500 further includes: Step S501: determining whether the drawn waveform points are complete; Specific judgment methods include: First, compare the value of the horizontal coordinate pos.x of each waveform point. When drawing the waveform track, each time pos is obtained, the pos.x of the current waveform point is compared with the pos.x of the previous waveform point until all the waveform points in the waveform track are compared. Then, find the maximum value posMax and the minimum value posMin of the horizontal coordinate of the waveform point. If the difference between posMax and posMin is greater than 1, it means that there are other waveform points between the two waveform points that have not been obtained. Step S502: converting the coordinate values ​​in step S501 into pixel values; Specific judgment methods include: When the voltage value of the voltage value parameter value configuration item set by the user in step S200 is less than the total horizontal pixel value of the graphical interface, it means that one coordinate value corresponds to multiple pixel values, so the pixel value needs to be evenly distributed to each coordinate value; When the voltage value of the voltage value parameter configuration item set by the user in step S200 is greater than the total horizontal pixel value of the graphical interface, it means that one pixel value corresponds to multiple coordinate values, so it is necessary to evenly distribute the voltage value of the set voltage value parameter configuration item to each pixel value, and ensure that the multiple coordinate values ​​corresponding to each pixel value are equal; Step S503: converting the pixel value in step S502 into a voltage value corresponding to the coordinate value of the waveform point; Calculate the voltage value volt corresponding to the coordinate value of the waveform point according to the formula: volt = (PIX_M - pointy) / (PIX_M- PIX_C )*tmpvolt; Among them, PIX_M is the pixel value of the highest point in the graphical interface; PIX_C is the pixel value of the middle point of the graphical interface; tmpvolt is the oscilloscope amplitude value; pointy is the horizontal total pixel value of the graphical interface; Step S600: Send the algorithm parameter value to the oscilloscope through the FPGA to display the waveform.

2. A method for drawing arbitrary waves based on an oscilloscope according to claim 1, Features: The list numbers in the graphical interface generated by the editing mode are arranged from small to large based on the parameter configuration items set by the user in step S200, and the user changes the order of the graphical interface in the editing mode by setting the parameter configuration items in step S200.

3. A method for drawing arbitrary waves based on an oscilloscope according to claim 1, Features: When drawing an arbitrary wave, When the number of waveform points is small, the editing mode can quickly edit the data the user wants; For the case of a large number of waveform points, the trace of an arbitrary waveform can be drawn by executing the drawing mode.

4. The method for drawing arbitrary waves based on an oscilloscope according to claim 1, Features: The editing mode includes two groups of parameter configuration items: point parameter value configuration items and voltage parameter value configuration items; The point number parameter value configuration item is used to set the number of waveform points displayed in the edit mode; The voltage value parameter value configuration item is used to set the voltage value corresponding to each waveform point; The drawing mode only needs to provide the user with a graphic drawing interface, and manually draw any waveform data through the oscilloscope touch screen.

5. The method for drawing arbitrary waves based on an oscilloscope according to claim 1, Features: In the editing mode, the user performs an input operation of the voltage value parameter value configuration item on the graphical interface to obtain the voltage value corresponding to the waveform point number, and the voltage value corresponding to the waveform point number is used to directly specify the specific voltage value of the corresponding waveform point.

6. The method for drawing arbitrary waves based on an oscilloscope according to claim 1, Features: The waveform points further include two parameter values: edit list and drawing points; and, The edit list is a parameter value for each waveform point that the user sets based on a graphical interface in the edit mode; The number of drawing points is the number of waveform points displayed to the user based on the graphical interface in the drawing mode.

7. The method for drawing arbitrary waves based on an oscilloscope according to claim 1, Features: The algorithm parameter values ​​in the editing mode or the drawing mode are uploaded to the FPGA, and then the FPGA sends the voltage value in the algorithm parameter value to the oscilloscope, and the algorithm parameter value generated in the editing mode or the drawing mode will be displayed on the display screen of the oscilloscope to form an arbitrary wave graph.