Arbitrary waveform generation method, arbitrary waveform generator and storage medium

By using transit memory and multiple memories to alternately store and play arbitrary waveform data in any waveform generator, the problem of limited storage space is solved, and the complete output and smooth playback of arbitrary waveform data is achieved.

CN119065452APending Publication Date: 2024-12-03SHENZHEN SHUMA ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411098310.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

Due to limited memory space, existing arbitrary waveform generators are difficult to output a large amount of arbitrary waveform data intact, resulting in waste of resources and poor playback.

Method used

The transfer memory is used to store any waveform data and store it in multiple memory alternately. Through a memory with a larger capacity, it stores any waveform data with a larger amount of data, and then stores it in the first memory and the second memory alternately, and plays it alternately in turn. .

Benefits of technology

It supports a large amount of data for any waveform, ensures the integrity of any waveform and the smoothness of data playback, and avoids waste of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065452A_ABST
    Figure CN119065452A_ABST
Patent Text Reader

Abstract

The invention relates to an arbitrary waveform generation method, an arbitrary waveform generator and a storage medium. The method comprises the following steps: storing obtained arbitrary waveform data into a transfer memory; the storage space of the transfer memory is greater than or equal to the sum of the storage spaces of the first memory and the second memory; and sequentially reading the arbitrary waveform data in the transfer memory and alternately storing the arbitrary waveform data in the first memory and the second memory, and sequentially and alternately playing the arbitrary waveform data alternately stored in the first memory and the second memory to obtain an arbitrary waveform. By adopting the method, a relatively large arbitrary waveform data volume can be supported, and the integrity of the arbitrary waveform is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an arbitrary waveform generation method, an arbitrary waveform generator and a storage medium. Background Art

[0002] AWG (Arbitrary Waveform Generator) can generate standard waveforms as well as output arbitrary waveforms. The output of standard waveform signals is relatively simple, such as sine waves, triangle waves, sawtooth waves, and square waves. The characteristics of these signals are that the waveform data can remain fixed and unchanged, and the specified signal can be output by simply changing the frequency control word and amplitude control word.

[0003] If an arbitrary waveform is output, the waveform data is customized and does not conform to general rules. A specific waveform is composed of multiple data points. First, the specified waveform data file must be read, then stored in the memory, and then the data is played. However, the amount of arbitrary waveform data is random, and the storage space of the memory is limited. Therefore, it is difficult to completely output the specified arbitrary waveform. Summary of the invention

[0004] Based on this, it is necessary to provide an arbitrary waveform generation method, an arbitrary waveform generator and a storage medium to address the above technical problems, which can support a larger amount of arbitrary waveform data and ensure the integrity of the arbitrary waveform.

[0005] A method for generating an arbitrary waveform, the method comprising: The acquired arbitrary waveform data is stored in a transfer memory; the storage space of the transfer memory is greater than or equal to the sum of the storage spaces of the first memory and the second memory; The arbitrary waveform data in the transfer memory is sequentially read and alternately stored in the first memory and the second memory, and the arbitrary waveform data alternately stored in the first memory and the second memory are alternately played in sequence to obtain an arbitrary waveform.

[0006] An arbitrary waveform generator comprises: a processor, a transfer memory, a first memory, a second memory and a digital-to-analog converter; the transfer memory is connected to the first memory and the second memory respectively; the first memory and the second memory are connected to the digital-to-analog converter respectively; the processor is connected to the transfer memory, the first memory and the second memory respectively; The processor is used to: The acquired arbitrary waveform data is stored in the transfer memory; the storage space of the transfer memory is larger than the sum of the storage spaces of the first memory and the second memory; Triggering sequentially to read the arbitrary waveform data in the transfer memory and alternately storing them in the first memory and the second memory, and alternately transmitting the arbitrary waveform data alternately stored in the first memory and the second memory to the digital-to-analog converter in sequence; The digital-to-analog converter is used to generate a corresponding arbitrary waveform according to the received arbitrary waveform data.

[0007] A computer-readable storage medium stores a computer program, which implements the steps of each arbitrary waveform generation method embodiment when executed by a processor.

[0008] The arbitrary waveform generation method, arbitrary waveform generator and storage medium described above may be very large because the data volume of the arbitrary waveform is random, and the storage space of the memory in the arbitrary waveform generator is limited. In the traditional method, when there is only one memory, the memory can only be refreshed with data and then output, and it is difficult to completely output the specified arbitrary waveform; and in order to be able to play a large amount of arbitrary waveform data, multiple memories are required to complete a one-time data transmission, resulting in a large waste of resources; and by storing the acquired arbitrary waveform data in a transit memory with a larger storage space, sequentially reading the arbitrary waveform data in the transit memory and alternately storing them in the first memory and the second memory, that is, it is easy to use a memory with a larger capacity to store arbitrary waveform data with a large data volume, alternately store them in the first memory and the second memory, and alternately play them in sequence, which can support a larger amount of arbitrary waveform data and ensure the integrity of the arbitrary waveform and the smoothness of data playback. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Figure 1 A diagram showing an application environment of an arbitrary waveform generation method in an embodiment; Figure 2 is a schematic flow chart of a method for generating an arbitrary waveform in one embodiment; Figure 3 is a flow chart of any generation method in another embodiment; Figure 4 A schematic diagram of an arbitrary waveform generation process in one embodiment; Figure 5 A schematic diagram of an arbitrary waveform generation process in another embodiment; Figure 6 is a schematic structural diagram of an arbitrary waveform generator in one embodiment; Figure 7 FIG. 4 is a schematic diagram of the structure of an arbitrary waveform generator in another embodiment. DETAILED DESCRIPTION

[0010] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0011] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0012] It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly. The connection can be a direct connection or an indirect connection.

[0013] In addition, in this application, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0014] The terms "first", "second", etc. used in this application may be used herein to describe various elements or data, but these elements or data are not limited by these terms. These terms are only used to distinguish a first element or data from another element or data. For example, without departing from the scope of this application, a first memory may be referred to as a second memory, and similarly, a second memory may be referred to as a first memory. Both the first memory and the second memory are memories, but they are not the same memory.

[0015] The arbitrary waveform generation method provided in this application can be applied to Figure 1 application environment. Figure 11 is an application environment diagram of an arbitrary waveform generation method in an embodiment. It includes a host computer 110 and an arbitrary waveform generator 120. The host computer 110 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The host computer 110 reads and parses the arbitrary waveform data file, obtains the arbitrary waveform data, and sends the arbitrary waveform data to the arbitrary waveform generator 120. Alternatively, the host computer 110 reads and parses the arbitrary waveform data file, and after processing, sends the arbitrary waveform data to the arbitrary waveform generator 120. The arbitrary waveform generator 120 obtains the arbitrary waveform data sent by the host computer 110, and processes it to obtain an arbitrary waveform output.

[0016] In one embodiment, Figure 2 FIG. 1 is a flow chart of a method for generating an arbitrary waveform in an embodiment, which is described by taking an arbitrary waveform generator as an example, and includes the following steps: Step 202, storing the acquired arbitrary waveform data into a transfer memory; the storage space of the transfer memory is greater than or equal to the sum of the storage spaces of the first memory and the second memory.

[0017] The arbitrary waveform data is a set of data points. The data length of the arbitrary waveform data is random and is determined based on the arbitrary waveform data set by the user. And it can be divided into binary data, decimal data, hexadecimal data, etc. according to the description method of the data point. The acquired arbitrary waveform data can be the target waveform data. The target waveform data refers to the waveform data specified by the user. Optionally, the acquired arbitrary waveform data can also be the data obtained by copying and splicing the target waveform data for periodic playback.

[0018] The transfer memory is any memory that has a storage space that is at least greater than the sum of the spaces of the first memory and the second memory and has read and write functions. For example, the transfer memory may be, but is not limited to, DDR (Double Data Rate SDRAM), FLASH memory, EEPROM (Electrically Erasable Programmable read only memory). The storage space of the first memory is 5, the storage space of the second memory is also 5, and the storage space of the transfer memory is greater than or equal to 10. Preferably, the capacity of the transfer memory is large enough.

[0019] The first memory and the second memory are not the same memory. The first memory and the second memory can be memories with read and write functions. For example, they can be RAM (Random Access Memory, Random Access Memory) commonly used in arbitrary waveform generators, static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. Preferably, the storage space of the first memory and the second memory is consistent.

[0020] Specifically, the host computer reads and analyzes the arbitrary waveform data file, obtains the target arbitrary waveform data, and sends the target arbitrary waveform data to the waveform generator. The arbitrary waveform generator obtains the target arbitrary waveform receiver sent by the host computer and stores it in the transfer memory.

[0021] Optionally, the host computer reads and parses the arbitrary waveform data file to obtain target arbitrary waveform data, and sends the target arbitrary waveform data to the waveform generator. The arbitrary waveform generator copies and splices the target waveform data as the acquired arbitrary waveform data, and stores the acquired arbitrary waveform data in the transfer memory.

[0022] Optionally, the host computer reads and parses the arbitrary waveform data file to obtain target arbitrary waveform data, copies and splices the target waveform data to obtain reference arbitrary waveform data, and sends the reference arbitrary waveform data to the waveform generator. The arbitrary waveform receiver obtains the arbitrary waveform data sent by the host computer and stores the obtained arbitrary waveform data in a transfer memory.

[0023] Step 204, sequentially read the arbitrary waveform data in the transfer memory and alternately store them in the first memory and the second memory, and alternately play the arbitrary waveform data alternately stored in the first memory and the second memory in sequence to obtain an arbitrary waveform.

[0024] Sequential reading means reading in a certain order and storing in the first memory and the second memory alternately, such as storing in the first memory for the first time, storing in the second memory for the second time, storing in the first memory for the third time, storing in the second memory for the fourth time, and so on.

[0025] Specifically, the arbitrary waveform generator sequentially reads the arbitrary waveform data in the transfer memory, and stores the read arbitrary waveform data alternately in the first memory and the second memory. The arbitrary waveform data stored in the first memory and the second memory are alternately played in the order of reading or in the order of storing, so as to obtain an arbitrary waveform corresponding to the acquired arbitrary waveform data.

[0026] Optionally, the arbitrary waveform generator may sequentially read the arbitrary waveform data in the transfer memory through DMA (Direct Memory Access) and store the data in the first memory and the second memory alternately.

[0027] For example, if there are 2000 data points of arbitrary waveform data in the transit memory, which are 1 to 2000 respectively, and the storage space of the first memory and the second memory are both 101, and the first memory and the second memory are not fully stored. Then 1 to 100 are read for the first time and stored in the first memory, 101 to 200 are read for the second time and stored in the second memory, 201 to 300 are read for the third time and stored in the first memory, and 301 to 400 are read for the fourth time and stored in the second memory...at least read to 2000, which will not be repeated here. That is, 1 to 100 is the arbitrary waveform data stored in the first memory for the first time, 101 to 200 is the arbitrary waveform data stored in the second memory for the second time, 201 to 300 is the arbitrary waveform data stored in the first memory for the third time, and 301 to 400 is the arbitrary waveform data stored in the second memory for the fourth time. Then, the arbitrary waveforms alternately stored in the first memory and the second memory are played alternately in sequence, and 1-100, 101-200, ... 1901-2000 can be played in the order of reading or storing.

[0028] Optionally, the arbitrary waveform generator can read the arbitrary waveform data in the transit memory in the order of the storage space of the first memory and the second memory. For example, if the arbitrary waveform data in the transit memory has 2000 data points, which are 1 to 2000 respectively, and the storage space of the first memory and the second memory is 100, then 1 to 100 are read for the first time and stored in the first memory, 101 to 200 are read for the second time and stored in the second memory, 201 to 300 are read for the third time and stored in the first memory, 301 to 400 are read for the fourth time and stored in the second memory... at least read to 2000, which will not be repeated here. That is, 1 to 100 is the arbitrary waveform data stored in the first memory for the first time, 101 to 200 is the arbitrary waveform data stored in the second memory for the second time, 201 to 300 is the arbitrary waveform data stored in the first memory for the third time, and 301 to 400 is the arbitrary waveform data stored in the second memory for the fourth time. Then, the arbitrary waveforms alternately stored in the first memory and the second memory are played alternately in sequence, and 1-100, 101-200, ... 1901-2000 can be played in the order of reading or storing.

[0029] For example, if the arbitrary waveform data in the transfer memory has 12 data points, 1 to 12 respectively, and the storage space of the first memory and the second memory is 4 and 6 respectively, then 1 to 4 are read for the first time and stored in the first memory, 5 to 10 are read for the second time and stored in the second memory, 11, 12, 1 and 2 are read for the third time, 3 to 8 are read for the fourth time, etc. Similarly, the arbitrary waveforms in the first memory and the second memory can be played alternately in sequence, and 1 to 4, 5 to 10, 11, 12, 1 and 2, 3 to 8, etc. can be played periodically in the order of reading or storing.

[0030] In this embodiment, since the data volume of the arbitrary waveform is random and may be very large, and the storage space of the memory in the arbitrary waveform generator is limited, the traditional method can only output the data after refreshing the memory again when there is only one memory, and it is difficult to completely output the specified arbitrary waveform; and in order to be able to play a large amount of arbitrary waveform data, it is necessary to use multiple memories to complete a one-time data transmission, resulting in a large waste of resources; and by storing the acquired arbitrary waveform data in a transit memory with a larger storage space, sequentially reading the arbitrary waveform data in the transit memory and alternately storing them in the first memory and the second memory, that is, it is easy to use a memory with a larger capacity to store arbitrary waveform data with a large data volume, alternately store them in the first memory and the second memory, and alternately play them in sequence, which can support a larger amount of arbitrary waveform data, ensure the integrity of the arbitrary waveform and the smoothness of data playback.

[0031] In one embodiment, the arbitrary waveform data alternately stored in the first memory and the second memory are alternately played in sequence, including: After storing the arbitrary waveform data sequentially read into the first memory, playing the arbitrary waveform data stored in the first memory; Before the arbitrary waveform data stored in the first memory is played, the arbitrary waveform data sequentially read next time is stored in the second memory; After the arbitrary waveform data stored in the first memory is played, the next arbitrary waveform data stored in the second memory is played; Before the next playback of the arbitrary waveform data stored in the second memory is completed, the process returns to the step of storing the sequentially read arbitrary waveform data in the first memory.

[0032] Specifically, if the arbitrary waveform data in the transfer memory is A, B, C, D, and E, in a general case, the arbitrary waveform generator stores the currently sequentially read arbitrary waveform data A in the first memory and then plays the arbitrary waveform data A stored in the first memory. Before the arbitrary waveform data A currently stored in the first memory is played, the next sequentially read arbitrary waveform data B is stored in the second memory, and the next arbitrary waveform data stored in the second memory is also B. After the arbitrary waveform data A currently stored in the first memory is played, the next arbitrary waveform data B stored in the second memory is played. Before the next arbitrary waveform data B stored in the second memory is played, the process returns to the step of storing the sequentially read arbitrary waveform data in the first memory, that is, sequentially reading the arbitrary waveform data C.

[0033] In this embodiment, after the arbitrary waveform data read sequentially are stored in the first memory, the arbitrary waveform data stored in the first memory is played, and before the arbitrary waveform data stored in the first memory is played, the arbitrary waveform data read sequentially for the next time is stored in the second memory, that is, the data for the next play is preloaded; after the arbitrary waveform data stored in the first memory is played, the arbitrary waveform data stored in the second memory for the next time is played, so that alternating storage and alternating play when the amount of data is large are realized without overlapping in time, thereby ensuring the integrity and smoothness of the arbitrary waveform data playback.

[0034] In one embodiment, the arbitrary waveform data in the transfer memory is sequentially read and alternately stored in the first memory and the second memory, and the arbitrary waveform data alternately stored in the first memory and the second memory are alternately played in sequence to obtain the arbitrary waveform, including: Sequentially reading the arbitrary waveform data in the transfer memory and alternately storing them in the first memory and the second memory according to the storage space of the first memory and the second memory respectively; The arbitrary waveform data in the first memory and the second memory are played alternately in sequence to obtain the arbitrary waveform.

[0035] Specifically, the arbitrary waveform generator uses the storage space of the first memory and the storage space of the second memory alternately as the number of bytes to be read sequentially. The arbitrary waveform generator reads the arbitrary waveform data in the transit memory according to the storage space of the first memory and stores it in the first memory. The arbitrary waveform generator reads the arbitrary waveform data in the transit memory according to the storage space of the second memory and stores it in the second memory. The two are stored alternately and played alternately in sequence. When the data is stored in the first memory next time, the data stored previously is overwritten.

[0036] It can be understood that since data is read according to the storage space, the memory is already filled with arbitrary waveform data at this time. Therefore, when playing, the arbitrary waveform data stored alternately in the first memory and the second memory will be played alternately in sequence, which is equivalent to alternating the arbitrary waveform data in the first memory and the second memory.

[0037] Optionally, the arbitrary waveform data in the transit memory are sequentially read according to the storage space of the first memory and the second memory respectively. The arbitrary waveform data in the transit memory are sequentially read and alternately stored in the first memory and the second memory, and the arbitrary waveform data in the first memory and the second memory are alternately played in sequence, including: after the arbitrary waveform data read sequentially is stored in the first memory, the arbitrary waveform data in the first memory is played. Before the arbitrary waveform data in the first memory is played, the next arbitrary waveform data read sequentially is stored in the second memory; after the arbitrary waveform data in the first memory is played, the arbitrary waveform data in the second memory is played. Before the next arbitrary waveform data in the second memory is played, the step of storing the arbitrary waveform data read sequentially in the first memory is returned.

[0038] In this embodiment, the arbitrary waveform data in the transit memory are read sequentially according to the storage space of the first memory and the second memory respectively and stored alternately in the first memory and the second memory, that is, the first memory and the second memory are filled up to ensure that there is no blank space in between; the arbitrary waveform data in the first memory and the second memory are played alternately in sequence to obtain an arbitrary waveform, and there is no need to calculate the specified address for data playback. The first bit in the memory can be directly taken as the first address for all reading and playback, which makes data playback simpler and ensures the accuracy and fluency of data playback.

[0039] In one embodiment, the acquired arbitrary waveform data is data obtained by copying and splicing the reference arbitrary waveform data; Sequentially read arbitrary waveform data in the transfer memory, including: When the first address during sequential reading is greater than the last address of the reference arbitrary waveform data, the data length of the reference arbitrary waveform data is subtracted from the first address to obtain the target first address; The corresponding arbitrary waveform data is sequentially read from the transfer memory based on the target first address.

[0040] Among them, the host computer or waveform generator copies and splices the reference arbitrary waveform data to obtain the arbitrary waveform data stored in the transfer memory. For example, if the reference arbitrary waveform data is 1, 2, 3, 4, 5, 6, 7, then the target waveform data after copying and splicing is 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7. The reference arbitrary waveform data is specifically determined based on the target arbitrary waveform data. The target arbitrary waveform data can be arbitrary waveform data specified by the user. The reference arbitrary waveform data can be directly the target arbitrary waveform data, or it can be obtained by copying and splicing the target arbitrary waveform data.

[0041] The acquired arbitrary waveform data is copied data. Therefore, when the previous reading is of the latter data segment of the first reference arbitrary waveform data, since there is a second reference arbitrary waveform data later, the data can be directly read sequentially without the need to read from the first address of the transfer memory for a second time, thereby avoiding reading twice, improving reading efficiency and reducing the probability of error.

[0042] Specifically, the arbitrary waveform generator sequentially reads the arbitrary waveform data in the transfer memory according to the read address. When the first address during sequential reading is greater than the last address of the reference arbitrary waveform data, it indicates that the data pointer overflows from the first segment. The first address is in the second segment of the reference arbitrary waveform data. When the first address is later, the arbitrary waveform data read from the transfer memory may exceed the last address of the stored arbitrary waveform data. The traditional method needs to read the remaining data and then continue to read from the first address of the transfer memory to ensure a complete segment of data, that is, read twice. In this embodiment, since at least two segments of spliced ​​reference arbitrary waveform data are stored in the transfer memory, and each data in the first segment can find a unique corresponding one in the second segment, and the difference between the two is exactly the length of a single reference arbitrary waveform data, the first address during sequential reading is subtracted from the data length of the reference arbitrary waveform data, and the corresponding arbitrary waveform data is sequentially read from the transfer memory based on the target first address, and then the position corresponding to the first address in the first segment of the reference arbitrary waveform data is returned to for sequential reading, so as not to affect the continuity of the waveform.

[0043] Optionally, the first address during sequential reading is greater than the last address x of the reference arbitrary waveform data, which may include the first address during sequential reading being greater than 2x-a, where 2x is the data length of the acquired arbitrary waveform data, and a is the larger storage space of the first memory and the second memory. It is understandable that the first address during sequential reading is also greater than a number between x and 2x-a.

[0044] Preferably, the reference arbitrary waveform data may be copied only once, which is sufficient for reading by the first memory and the second memory, and does not waste storage resources.

[0045] In this embodiment, the acquired arbitrary waveform data is data obtained by copying and splicing the reference arbitrary waveform data. When the starting address during sequential reading is greater than the ending address of the reference arbitrary waveform data, the data length of the reference arbitrary waveform data is subtracted from the starting address to obtain the target starting address. Based on the target starting address, the corresponding arbitrary waveform data is sequentially read from the transfer memory. When the sequentially read first address overflows from the first segment, the data length of the reference arbitrary waveform data is subtracted to return to the corresponding position in the first segment. By finding a common address calculation method, the more complex address processing operation is placed before the data flow control, making the data flow control simpler, which not only improves the data reading efficiency but also reduces the error probability.

[0046] In one embodiment, the first address during sequential reading is the last digit of the last address of the previous sequential reading.

[0047] Specifically, no matter whether the last address in the previous sequential reading is the last address corresponding to the data length of the target arbitrary waveform data without subtracting it, or the last address corresponding to the data length of the target arbitrary waveform data after subtracting it, the first address in the sequential reading is the last digit of the last address in the previous sequential reading. Then, it is determined whether the first address in the sequential reading is greater than the last address of the target arbitrary waveform data.

[0048] In this embodiment, the first address during sequential reading is the last digit of the last address of the previous sequential reading, and the data is still processed according to the principle of sequential reading. The situation where the first address during sequential reading is greater than the last address of the target arbitrary waveform data is reduced, thereby reducing the error probability.

[0049] In one embodiment, the storage space of the first memory and the second memory is the same; the reference arbitrary waveform data is obtained by copying an integer multiple of the target arbitrary waveform data to a storage space at least equal to the first memory or the second memory when the data length of the target arbitrary waveform data is smaller than the storage space of the first memory or the second memory.

[0050] Specifically, when the storage space of the first memory and the second memory is the same, the two memories with limited capacity are transformed into a memory with unlimited capacity by using them alternately, so that data reading, storing and playing stages can be addressed in a universal manner without making any changes.

[0051] Similarly, when the data length of the target arbitrary waveform data is less than the first memory or the second memory, the host computer or the arbitrary waveform generator copies the target arbitrary waveform in integer multiples to a storage space at least equal to the first memory or the second memory to obtain the reference arbitrary waveform data. Integer multiple copying means copying an integer number of times, such as copying 1 time, 2 times, 3 times, etc. Copying to a storage space at least equal to the first memory, for example, if the data length of the target arbitrary waveform data is 3 and the data length of the first memory is 7, then the integer multiple copying is at least equal to 7, that is, the length of the reference arbitrary waveform data is 3×3=9. Alternatively, if the data length of the target arbitrary waveform data is 4 and the data length of the first memory is 8, then the integer multiple copying is at least equal to 8, that is, the length of the reference arbitrary waveform data is 4×2=8.

[0052] In this embodiment, since the data is played from the beginning to the end, if there is a blank, the output signal is likely to be incorrect. When the data length of the target arbitrary waveform data is smaller than the storage space of the first memory or the second memory, the integer multiples of the target arbitrary waveform data are copied to a storage space at least equal to the first memory or the second memory, so that each time the data is read, the storage space of the memory is filled, and the data playback is simple and less prone to errors.

[0053] In one embodiment, the arbitrary waveform data alternately stored in the first memory and the second memory are alternately played in sequence, including: Get the preset sampling rate; the preset sampling rate allows the data in the current memory to be stored before the previous memory finishes playing; Based on a preset sampling rate, the arbitrary waveform data alternately stored in the first memory and the second memory are alternately played in sequence.

[0054] The preset sampling rate can be set in the host computer. It is understandable that the preset sampling rate can also be set in the arbitrary waveform generator. The preset sampling rate allows the data in the current memory to be stored before the previous memory is played.

[0055] Specifically, by presetting the sampling rate, that is, the playback data of the waveform data, for example, a sampling rate of 100 MHz represents a data point played every 10 nanoseconds. Based on the preset sampling rate, the playback rate of the data in the memory is controlled, and the arbitrary waveform data alternately stored in the first memory and the second memory are alternately played in sequence.

[0056] In this embodiment, by setting the sampling rate, the data storage in the current memory is completed before the playback of the previous memory is finished, which can make the data playback smooth.

[0057] In one embodiment, in one embodiment, Figure 3 , which is a flow chart of an arbitrary generation method in another embodiment. Figure 3 In the example, the transfer memory is DDR, the first memory is RAM1, and the second memory is RAM2. The storage space of RAM1 and RAM2 can be the same size. By continuously switching between the two, the two RAMs with limited capacity can be turned into an infinite RAM with the same capacity. In this way, no change is made to the addressing of the final data playback part.

[0058] The host computer includes arbitrary waveform data file reading and parsing, as well as arbitrary waveform data playback rate control through sampling rate. Using the data flow control method of ping-pong operation, the host computer first reads the arbitrary waveform data file and then stores it in DDR, which has sufficient storage space. Then two RAMs are used to store the waveform data to be played, and the data in DDR is stored in two RAMs respectively through DMA (Direct Memory Access), and played crosswise on DAC (Digital to Analog Converter), so as to obtain the arbitrary waveform corresponding to the arbitrary waveform data file.

[0059] The specific steps are as follows: In the first step, the host computer reads and parses the arbitrary waveform data file. After reading the file, the host computer first calculates the number of data points. If the amount of data is greater than or equal to the storage space of a RAM, the arbitrary waveform data is directly copied and two identical arbitrary waveform data are stored in a fixed address in the DDR. If the amount of data is less than the storage space of a RAM, it is copied multiple times to reach the capacity of a single RAM, and then copied again, and two identical arbitrary waveform data are stored in a fixed address in the DDR.

[0060] The host computer can also set the sampling rate, that is, the playback speed of the waveform data. For example, a sampling rate of 100MHz means that one data point is played every 10ns. Note that the stable transmission of the data stream should be controlled, and the sampling rate should not be set too fast. It must be ensured that the data update of the current RAM is completed before the playback of the previous RAM is completed.

[0061] The second step is DMA data transfer. The data in DDR needs to be moved to RAM for output, and the data transfer is completed through DMA. The DDR transfer address is specified, and the number of bytes transferred each time is the capacity of a single RAM, and then the DMA transfer is triggered.

[0062] The first time the data is transferred to RAM1, the waveform data in RAM1 is played immediately after the transfer is completed. During this period, the following data in DDR is transferred to RAM2, and the data transfer to RAM2 must be completed before the data in RAM1 is played.

[0063] When the data in RAM1 is played, the data in RAM2 that has been stored is played immediately. At this time, data is transmitted to RAM1 to update the data, and it must be completed before the playback of RAM2 is finished. And so on, the data is transmitted crosswise and played alternately.

[0064] If the total amount of data transmitted exceeds the size of the arbitrary waveform, since two identical pieces of data are stored, data overflow will not introduce errors. And if the first address during sequential reading exceeds the size of the reference waveform data, the first address is subtracted from the data length of the reference waveform data to obtain the target first address.

[0065] The third step is data playback, which is performed alternately. When the data transfer of RAM1 is completed for the first time, it is immediately converted into an analog signal in the DAC for playback. After the playback is completed, it is switched to RAM2 to continue playback, and the process is performed alternately. It can be understood that when the data reading in the RAM is completed, that is, the address pointer of the RAM reaches the last one and the last data is played, a feedback signal is generated to control the data flow.

[0066] In this embodiment, since the data volume of the arbitrary waveform is random and may be very large, and the storage space of the memory is limited, the traditional method can only output the memory after refreshing the data when there is only one memory, and it is difficult to completely output the specified arbitrary waveform; in order to be able to play a large amount of arbitrary waveform data, multiple memories are needed to complete a one-time data transmission, resulting in a large waste of resources; and by storing the acquired arbitrary waveform data in a transit memory with a larger storage space, sequentially reading the arbitrary waveform data in the transit memory and alternately storing them in the first memory and the second memory, that is, it is easy to use a memory with a larger capacity to store arbitrary waveform data with a large data volume, and the maximum amount of data that can be stored is the data volume of the transit memory; alternatingly storing in the first memory and the second memory, and playing alternately in sequence, can support a larger amount of arbitrary waveform data, ensure the integrity of the arbitrary waveform and the smoothness of data playback.

[0067] In one embodiment, the conventional method of reading data from the memory is as follows: The memory stores 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 in the address from 1 to 12 in sequence; the RAM capacity is 5, and 5 data are moved each time. The process is as follows: First time: 1, 2, 3, 4, 5 Second time: 6, 7, 8, 9, 10 3rd time: 11, 12, 1, 2, 3 4th time: 4, 5, 6, 7, 8 5th time: 9, 10, 11, 12, 1 6th time: 2, 3, 4, 5, 6 ...... The principle of transport is to transport 5 data at a time. When the remaining data is less than 5, it is necessary to transport from the beginning as a supplement. Then there are two problems here. First, the number of supplements required each time is different, and it is necessary to make a judgment before deciding. When it is detected that the data is about to overflow, it is necessary to transport the remaining data first, and then calculate the amount of supplemented data, and finally transport these data. For example, if the first address is detected to be 11 (determine whether it is greater than 8), then the number of supplements is calculated as: 5-2=3. Second, it needs to be transported twice, because the transport of multiple data must be continuous addresses. First, "11, 12" is transported, and then "1, 2, 3" is transported. It must be done twice, which is more troublesome, and the address calculation is irregular. And in the traditional way, when there is only one memory, the memory can only be refreshed again and then output, and the transmission is slow; in order to be able to play a large amount of arbitrary waveform data, multiple memories are needed to complete one-time data transmission, resulting in a large waste of resources.

[0068] Therefore, the arbitrary waveform generation method in this embodiment is proposed, which can put more complex processing operations before data flow control, making data flow control simpler, faster and less prone to errors. Figure 4 FIG. 1 is a schematic diagram of an arbitrary waveform generation process in an embodiment. Figure 4 The target arbitrary waveform data is included, the arbitrary waveform data stored in the transfer storage area, the first memory and the second memory, and the arbitrary waveform played. The storage space of the transfer memory is as large as possible. Figure 4 The target arbitrary waveform data in is the reference arbitrary waveform data. Figure 4 In the description, the target arbitrary waveform data is used as the reference arbitrary waveform data.

[0069] Assume that the data length of the target arbitrary waveform data is 12, and the storage space of the first memory and the second memory are both 5. Figure 4The process of sequentially reading, storing and playing according to the storage space of the first memory and the second memory is shown in the figure. The target arbitrary waveform data is the set waveform data. 1~12 in the figure indicates the number of data, not the data content. Then, the arbitrary waveform data in the transit memory is the target arbitrary waveform data 1~12 after being copied and spliced, that is, 1, 2, 3...12, 1, 2...12, and the addresses are 1 to 24 in sequence. 1, 2, 3, 4, 5 are read in sequence according to the storage space of the first memory and stored in the first memory, 6, 7, 8, 9 and 10 are read in sequence according to the storage space of the second memory, and 11, 12, 1, 2 and 3 are read in sequence according to the storage space of the first memory, and stored alternately, that is, the first time is stored in the first memory, the second time is stored in the second memory, and the third time is stored in the first memory... Then in the first, second and third reading processes, the first address during the sequential reading does not exceed the last address of the reference arbitrary waveform data, and no processing is performed. When reading for the fourth time, the position of 4 as the first address data is greater than the last address 12 of the reference arbitrary waveform data, so the address of 4 of the second segment is subtracted by the data length 12, and the target first address obtained is the position of the mark ④. When reading for the fifth time, the reading starts from the last bit of the fourth last address, that is, the position of the mark ⑤. When reading for the sixth time, the first address refers to the last bit of the fifth reading, that is, the address of the data 2 in the second segment, which is greater than the last address 12 of the reference arbitrary waveform data at this time, so the address of the data 2 in the second segment is subtracted by the data length 12, and the target first address obtained is the position of the mark ⑥.

[0070] The playing stage is to alternately play the arbitrary waveform data stored in the first memory and the second memory. That is, 1, 2, 3, 4, 5 in the first memory are played first, then 6, 7, 8, 9 and 10 in the second memory are played, and then 11, 12, 1, 2 and 3 in the first memory are played... Among them, after the first sequentially read 1, 2, 3, 4, 5 are stored in the first memory, 1, 2, 3, 4, 5 are played; and before the 1, 2, 3, 4, 5 stored in the first memory is played, the 6, 7, 8, 9 and 10 read in sequence for the second time are stored in the second memory, that is, 6, 7, 8, 9 and 10 are stored in the second memory during the playing of 1, 2, 3, 4, 5. After the 1, 2, 3, 4, 5 stored in the first memory are played, 6, 7, 8, 9 and 10 stored in the second memory for the second time are played. Before the playback of 6, 7, 8, 9 and 10 stored in the second memory for the second time is completed, 11, 12, 1, 2 and 3 read for the third time are stored in the first memory, so that the arbitrary waveform data alternately stored in the first memory and the second memory are played alternately in sequence to obtain an arbitrary waveform corresponding to the target arbitrary waveform data.

[0071] In this embodiment, when the amount of arbitrary waveform data is large, the data is stored in a transfer memory to preserve the integrity of the data; since the capacity of the memory is fixed and the amount of data is random, the traditional solution continuously calculates the address when moving data or playing RAM data; while in this embodiment, by sequentially reading data from the transfer memory and alternately storing it in the first memory and the second memory, random data amounts are supported, and the copying operation of the arbitrary waveform data and a simple address algorithm can ensure that all arbitrary waveform data are played in sequence, greatly reducing the probability of data errors.

[0072] In one embodiment, Figure 5 FIG. 1 is a schematic diagram of an arbitrary waveform generation process in another embodiment. Figure 5 The target arbitrary waveform data is included, the arbitrary waveform data stored in the transfer storage area, the first memory and the second memory, and the arbitrary waveform played. Assume that the data length of the target arbitrary waveform data is 4, and the storage space of the first memory and the second memory is 5. Figure 5The process of sequentially reading, storing and playing according to the storage space of the first memory and the second memory is shown in the figure. The target arbitrary waveform data is the set waveform data. 1~4 in the figure indicates the number of data, not the data content. Then, the data length 4 of the target arbitrary waveform is less than the storage space 5 of the first memory or the second memory. Therefore, the target arbitrary waveform data is copied once to obtain the reference arbitrary waveform data 1, 2, 3, 4, 1, 2, 3, 4. At this time, the data length of the reference waveform data is 8, which is greater than the storage space 5 of the first memory or the second memory. The reference waveform data is copied and spliced ​​again to obtain the acquired arbitrary waveform data 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, and stored in the transit memory. Similarly, 1, 2, 3, 4, 1 is read in the order of the storage space of the first memory and stored in the first memory, and 2, 3, 4, 1, 2 are read in the order of the storage space of the second memory and stored alternately in the second memory, that is, the first time is stored in the first memory, the second time is stored in the second memory, and the third time is stored in the first memory... Then, during the first and second reading processes, the first address during sequential reading does not exceed the last address of the target arbitrary waveform data, and no processing is performed. During the third reading, the position of 3 as the first address data is greater than the last address 8 of the reference arbitrary waveform data, so the address of 3 in the second segment is subtracted from the data length 8, and the target first address obtained is the position where mark ③ is located. During the fourth reading, the position of the first address is the last bit of the last address read for the third time, that is, the position of the first address data 4 is not greater than the last address 8 of the reference arbitrary waveform data, so the target first address obtained is the position where mark ④ is located. During the fifth reading, the reading starts from the last bit of the fourth last address, that is, the address of 1 in the second segment is greater than the last address 8 of the reference arbitrary waveform data, so the address of 1 in the second segment is subtracted from the data length 8, and the target first address obtained is the position where mark ⑤ is located.

[0073] The playing stage is to alternately play the arbitrary waveform data stored in the first memory and the second memory. That is, first play 1, 2, 3, 4, 1 in the first memory, then play 2, 3, 4, 1, 2 in the second memory, and continue to play 3, 4, 1, 2, 3 in the first memory... Among them, after the first sequentially read 1, 2, 3, 4, 1 is stored in the first memory, 1, 2, 3, 4, 1 is played; and before the 1, 2, 3, 4, 1 stored in the first memory is played, the second sequentially read 2, 3, 4, 1, 2 is stored in the second memory, that is, 2, 3, 4, 1, 2 is stored in the second memory during the playing of 1, 2, 3, 4, 1. After the 1, 2, 3, 4, 1 stored in the first memory is played, 2, 3, 4, 1, 2 stored in the second memory for the second time is played. Before the second playback of 2, 3, 4, 1, 2 stored in the second memory is completed, the third reading of 3, 4, 1, 2, 3 is stored in the first memory, so that the arbitrary waveform data alternately stored in the first memory and the second memory are played alternately in sequence to obtain an arbitrary waveform corresponding to the target arbitrary waveform data.

[0074] In this embodiment, when the amount of arbitrary waveform data is small, the arbitrary waveform data is copied multiple times to fill up the blanks in the memory, thereby ensuring the periodic playback of the arbitrary waveform data; and the reading process is regular, and a general algorithm can be used to ensure that all data is played in sequence, reducing the probability of error.

[0075] In one embodiment, the output of an arbitrary waveform can be controlled by a host computer or by an arbitrary waveform generator. There are three main situations for waveform output. The first is continuous output, which means playing from the first data point to the last one, and then from the first to the last one, over and over again. To turn off the output, you only need to control the output master switch. The second is single output, which means automatically stopping after playing from the first data point to the last one. The method is to count the data on the processor side, accumulate the data points that have been played, and stop immediately when it is detected that all the data has been played. The above is to stop after playing one cycle, and it can also be set to stop after playing any number of cycles, just by counting the number of cycles played. The third is step output, that is, each time the host computer is triggered, an arbitrary waveform with a specific number of cycles is output. In the above way, the output of an arbitrary waveform can be controlled.

[0076] In one embodiment, a method for generating an arbitrary waveform includes the following steps: Step (a1), storing the acquired arbitrary waveform data into a transfer memory; the storage space of the transfer memory is greater than or equal to the sum of the storage spaces of the first memory and the second memory; the storage spaces of the first memory and the second memory are the same.

[0077] Step (a2), when the first address during sequential reading is not greater than the last address of the reference arbitrary waveform data, sequentially reading the arbitrary waveform data in the transfer memory.

[0078] Step (a3), when the first address during sequential reading is greater than the last address of the reference arbitrary waveform data, the data length of the reference arbitrary waveform data is subtracted from the first address to obtain the target first address; the first address during sequential reading is the last digit of the last address of the previous sequential reading.

[0079] Step (a4), sequentially reading the corresponding arbitrary waveform data from the transfer memory based on the target first address according to the storage space of the first memory and the second memory respectively.

[0080] Step (a5), after storing the arbitrary waveform data read sequentially into the first memory, playing the arbitrary waveform data stored in the first memory.

[0081] Step (a6), before the arbitrary waveform data stored in the first memory is played, the arbitrary waveform data sequentially read next time is stored in the second memory; Step (a7), after the arbitrary waveform data stored in the first memory is played, the next arbitrary waveform data stored in the second memory is played.

[0082] Step (a8), before the next playback of the arbitrary waveform data stored in the second memory is completed, return to the step of storing the sequentially read arbitrary waveform data in the first memory.

[0083] In this embodiment, the acquired arbitrary waveform data is stored in a transfer memory with a larger storage space, the arbitrary waveform data in the transfer memory is sequentially read and alternately stored in the first memory and the second memory, that is, it is easy to store arbitrary waveform data with a large data volume through a memory with a larger capacity, alternately store it in the first memory and the second memory, and alternately play it in sequence, which can support a larger amount of arbitrary waveform data and ensure the integrity of the arbitrary waveform and the smoothness of data playback; in addition, the acquired arbitrary waveform data is the data spliced ​​after copying the reference arbitrary waveform data. When the first address during sequential reading is greater than the last address of the reference arbitrary waveform data, the first address is subtracted from the data length of the reference arbitrary waveform data to obtain the target first address, and the corresponding arbitrary waveform data is sequentially read from the transfer memory based on the target first address. When the first address read sequentially overflows from the first segment, the data length of the reference arbitrary waveform data is subtracted to return to the corresponding position in the first segment. By finding a general address calculation method, a more complex address processing operation is placed before the data flow control, and the random size of the data volume is supported, making the data flow control simpler, while improving the data reading efficiency, it also reduces the error probability.

[0084] It should be understood that although the above Figure 2 and 3 The steps in the flowchart are shown in sequence as indicated by arrows, and the steps in steps (a1) to (a8) are shown in sequence as indicated by numbers, but these steps are not necessarily performed in the order indicated by arrows or numbers. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be performed in other orders. Moreover, Figure 2 and 3 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0085] In one embodiment, Figure 6 , which is a schematic diagram of the structure of an arbitrary waveform generator in an embodiment, including a processor 602, a transfer memory 604, a first memory 606, a second memory 608 and a digital-to-analog converter 610; the transfer memory 604 is connected to the first memory 606 and the second memory 608 respectively; the first memory 606 and the second memory 608 are connected to the digital-to-analog converter 610 respectively; the processor 602 is connected to the transfer memory 604, the first memory 606 and the second memory 608 respectively; Specifically, the processor 602 may be used to trigger other modules to sequentially read the arbitrary waveform data in the transit memory 604, or may trigger the arbitrary waveform data in the transit memory 604 to be read by itself. The processor 602 is used to transmit the arbitrary waveform data alternately stored in the first memory 606 and the second memory 608 to the digital-to-analog converter 610 in the order of storage or the order of reading. The digital-to-analog converter 610 is used to generate a corresponding arbitrary waveform according to the received arbitrary waveform data.

[0086] In this embodiment, since the data volume of the arbitrary waveform is random and may be very large, and the storage space of the memory in the arbitrary waveform generator is limited, the traditional method can only output the data after refreshing the memory again when there is only one memory, and it is difficult to completely output the specified arbitrary waveform; and in order to be able to play a large amount of arbitrary waveform data, it is necessary to use multiple memories to complete a one-time data transmission, resulting in a large waste of resources; and by setting a transit memory with a larger storage space, the acquired arbitrary waveform data is stored in the transit memory with a larger storage space, the arbitrary waveform data in the transit memory is sequentially read and alternately stored in the first memory and the second memory, that is, it is easy to use a memory with a larger capacity to store arbitrary waveform data with a large data volume, alternately store it in the first memory and the second memory, and alternately transmit it to the digital-to-analog converter in sequence, so that the digital-to-analog converter generates the corresponding arbitrary waveform, which can support a larger amount of waveform data, and ensure the integrity of the arbitrary waveform and the smoothness of data playback.

[0087] In one embodiment, the arbitrary waveform generator further includes a direct memory access 612, one end of the direct memory access 612 is connected to the transit memory 604, and the other end is connected to the first memory 606 and the second memory 608; The processor 602 is used to send a read trigger signal; The direct memory access 612 is used to sequentially read the arbitrary waveform data in the transfer memory 604 and store them alternately in the first memory 606 and the second memory 608 when a trigger signal is received.

[0088] Specifically, Figure 7 As shown, it is a schematic diagram of the structure of an arbitrary waveform generator in another embodiment. The data transmission process of direct memory access (DMA) 612 can run independently. The read trigger signal sent by the host computer includes a read trigger field, a read first address and a read byte number. The processor 602 is used to send a read trigger signal, and the direct memory access 612 is used to sequentially read the arbitrary waveform data in the transfer memory 604 and alternately store it in the first memory 606 and the second memory 608 when receiving the read trigger signal. It can be understood that the processor 602 can also be connected to a digital-to-analog converter for data playback control.

[0089] In this embodiment, the data transmission speed is increased by triggering direct memory access to perform alternate data transmission, thereby speeding up the generation of arbitrary waveforms.

[0090] In one embodiment, the processor 602 is configured to generate a read trigger signal based on the storage space of the first memory 606 and the second memory 608; Specifically, the processor 602 is used to determine the read trigger field, the first address to be read, and the number of bytes to be read based on the storage space of the first memory 606 and the second memory 608. The processor 602 can alternately use the storage space of the first memory 606 and the storage space of the second memory 608 as the number of bytes to be sequentially read, and calculate the first address to be read.

[0091] In this embodiment, the processor is used to generate a read trigger signal based on the storage space of the first memory and the second memory, and can fully store arbitrary waveform data in the first memory and the second memory to ensure that there is no blank space during the period; and when the subsequent data is transmitted and the arbitrary waveform is generated, there is no need to calculate the specified address for data playback, and the first bit in the memory can be directly taken as the first address for all reading and playback, which makes data playback simpler and ensures the accuracy and fluency of data playback.

[0092] In one embodiment, the processor 602 is used to: after the arbitrary waveform data sequentially read is stored in the first memory 606, send the arbitrary waveform data stored in the first memory 606 to the digital-to-analog converter 610; Before the arbitrary waveform data stored in the first memory 606 is played, the direct memory access 612 is triggered to store the next sequentially read arbitrary waveform data into the second memory 608; After the arbitrary waveform data stored in the first memory 606 is played, the next arbitrary waveform data stored in the second memory 608 is sent to the digital-to-analog converter 610; Before the next arbitrary waveform data stored in the second memory 608 is played, the execution returns to store the arbitrary waveform data read sequentially into the first memory 606; The digital-to-analog converter 610 is used to generate a corresponding arbitrary waveform when receiving arbitrary waveform data.

[0093] In this embodiment, the data for the next playback is preloaded to achieve alternating storage and playback when the amount of data is large, and the time does not overlap, thereby ensuring the integrity and smoothness of the playback of arbitrary waveform data.

[0094] In one embodiment, the acquired arbitrary waveform data is data obtained by copying and splicing the reference arbitrary waveform data; the processor 602 is used to subtract the data length of the reference arbitrary waveform data from the first address to obtain the target first address when the first address during sequential reading is greater than the last address of the reference arbitrary waveform data; and send a read trigger signal containing the target first address to the direct memory access 612; the direct memory access 612 is used to read the corresponding arbitrary waveform data from the transfer memory 604 based on the target first address in the read trigger signal.

[0095] In one embodiment, the first address during sequential reading is the last digit of the last address of the previous sequential reading.

[0096] In one embodiment, the storage space of the first memory 606 and the second memory 608 is the same; the reference arbitrary waveform data is obtained by copying an integer multiple of the target arbitrary waveform data to a storage space at least equal to the first memory 606 or the second memory 608 when the data length of the target arbitrary waveform data is smaller than the storage space of the first memory 606 or the second memory 608.

[0097] In one embodiment, the digital-to-analog converter 610 is used to: obtain a preset sampling rate; the preset sampling rate allows the data in the current memory to be stored before the previous memory is played; and based on the sampling rate, the arbitrary waveform data in the first memory 606 and the second memory 608 are played alternately in sequence.

[0098] For the specific definition of the arbitrary waveform generator, please refer to the definition of the arbitrary waveform generation method above, which will not be repeated here. Each module in the above arbitrary waveform generator can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0099] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments are implemented.

[0100] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0101] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes in the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0102] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for generating an arbitrary waveform, characterized in that: The method comprises: The acquired arbitrary waveform data is stored in a transfer memory; the storage space of the transfer memory is greater than or equal to the sum of the storage spaces of the first memory and the second memory; The arbitrary waveform data in the transfer memory is sequentially read and alternately stored in the first memory and the second memory, and the arbitrary waveform data alternately stored in the first memory and the second memory are alternately played in sequence to obtain an arbitrary waveform.

2. The method according to claim 1, characterized in that The step of alternately storing the data in the first memory and the second memory, and alternately playing the data in the first memory and the second memory in sequence, comprises: After storing the arbitrary waveform data sequentially read into the first memory, playing the arbitrary waveform data stored in the first memory; Before the arbitrary waveform data stored in the first memory is played, storing the arbitrary waveform data sequentially read next time in the second memory; After the arbitrary waveform data stored in the first memory is played, the arbitrary waveform data stored in the second memory is played next time; Before the next playback of the arbitrary waveform data stored in the second memory is completed, the process returns to the step of storing the sequentially read arbitrary waveform data in the first memory.

3. The method according to claim 1, characterized in that The method of sequentially reading the arbitrary waveform data in the transfer memory and alternately storing the arbitrary waveform data in the first memory and the second memory, and alternately playing the arbitrary waveform data alternately stored in the first memory and the second memory in sequence to obtain an arbitrary waveform includes: Sequentially reading the arbitrary waveform data in the transfer memory and alternately storing them in the first memory and the second memory according to the storage space of the first memory and the second memory respectively; The arbitrary waveform data in the first memory and the second memory are played alternately in sequence to obtain an arbitrary waveform.

4. The method according to claim 1, characterized in that: The acquired arbitrary waveform data is data obtained by copying and splicing the reference arbitrary waveform data; The sequentially reading the arbitrary waveform data in the transfer memory includes: When the first address during sequential reading is greater than the last address of the reference arbitrary waveform data, the data length of the reference arbitrary waveform data is subtracted from the first address to obtain a target first address; The corresponding arbitrary waveform data is sequentially read from the transfer memory based on the target first address.

5. The method according to claim 4, characterized in that The first address during the sequential reading is the last digit of the last address of the previous sequential reading.

6. The method according to claim 4, characterized in that The storage space of the first memory and the second memory is the same; the reference arbitrary waveform data is obtained by copying an integer multiple of the target arbitrary waveform data to a storage space at least equal to the first memory or the second memory when the data length of the target arbitrary waveform data is smaller than the storage space of the first memory or the second memory.

7. The method according to claim 1, characterized in that The step of alternately playing the arbitrary waveform data alternately stored in the first memory and the second memory in sequence comprises: Obtaining a preset sampling rate; the preset sampling rate allows data to be stored in the current memory before the previous memory finishes playing; Based on the preset sampling rate, the arbitrary waveform data alternately stored in the first memory and the second memory are alternately played in sequence.

8. An arbitrary waveform generator, characterized in that: include: A processor, a transfer memory, a first memory, a second memory and a digital-to-analog converter; The transfer memory is connected to the first memory and the second memory respectively; The first memory and the second memory are respectively connected to the digital-to-analog converter; The processor is connected to the transfer memory, the first memory and the second memory respectively; The processor is used to: The acquired arbitrary waveform data is stored in the transfer memory; the storage space of the transfer memory is larger than the sum of the storage spaces of the first memory and the second memory; Triggering sequentially to read the arbitrary waveform data in the transfer memory and alternately storing them in the first memory and the second memory, and alternately transmitting the arbitrary waveform data alternately stored in the first memory and the second memory to the digital-to-analog converter in sequence; The digital-to-analog converter is used to generate a corresponding arbitrary waveform according to the received arbitrary waveform data.

9. The arbitrary waveform generator according to claim 8, characterized in that: It also includes direct memory access, one end of which is connected to the transfer memory, and the other end of which is connected to the first memory and the second memory respectively; The processor is used to send a read trigger signal; The direct memory access is used to sequentially read the arbitrary waveform data in the transfer memory and store them alternately in the first memory and the second memory when the read trigger signal is received.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.