How do I upload a custom waveform using APIs?
-
Moku:Go
Moku:Go Arbitrary Waveform Generator Moku:Go Data Logger Moku:Go Frequency Response Analyzer Moku:Go Logic Analyzer & Pattern Generator Moku:Go Oscilloscope & Voltmeter Moku:Go PID Controller Moku:Go Spectrum Analyzer Moku:Go Waveform Generator Moku:Go Power Supplies Moku:Go Digital Filter Box Moku:Go FIR Filter Builder Moku:Go Lock-in Amplifier Moku:Go General Moku:Go Logic Analyzer/Pattern Generator Moku:Go Time & Frequency Analyzer Moku:Go Laser Lock Box Moku:Go Phasemeter
-
Moku:Lab
Moku:Lab General Moku:Lab Arbitrary Waveform Generator Moku:Lab Data Logger Moku:Lab Digital Filter Box Moku:Lab FIR Filter Builder Moku:Lab Frequency Response Analyzer Moku:Lab Laser Lock Box Moku:Lab Lock-in Amplifier Moku:Lab Oscilloscope Moku:Lab Phasemeter Moku:Lab PID Controller Moku:Lab Spectrum Analyzer Moku:Lab Waveform Generator Moku:Lab Time & Frequency Analyzer Moku:Lab Logic Analyzer/Pattern Generator
-
Moku:Pro
Moku:Pro Arbitrary Waveform Generator Moku:Pro Data Logger Moku:Pro Frequency Response Analyzer Moku:Pro Oscilloscope Moku:Pro PID Controller Moku:Pro Spectrum Analyzer Moku:Pro Waveform Generator Moku:Pro Lock-in Amplifier Moku:Pro Digital Filter Box Moku:Pro FIR Filter Builder Moku:Pro Phasemeter Moku:Pro Multi-instrument Mode Moku:Pro General Moku:Pro Logic Analyzer/Pattern Generator Moku:Pro Time & Frequency Analyzer
- Python API
- MATLAB API
- Arbitrary Waveform Generator
- Data Logger
- Digital Filter Box
- FIR Filter Builder
- Frequency Response Analyzer
- Laser Lock Box
- Lock-in Amplifier
- Oscilloscope
- Phasemeter
- PID Controller
- Spectrum Analyzer
- Time & Frequency Analyzer
- Waveform Generator
- Logic Analyzer & Pattern Generator
- Multi Instrument Mode
- Moku Cloud Compile
- Moku general
- LabVIEW
The Arbitrary Waveform Generator can load custom waveforms from comma- or newline-delimited text. The maximum number of points depends on the sample rate. The relationship between the number of points and the sampling rate for each device can be found in the user manuals or in Tables 1 through 3 found below for each device.
Please note that the LUT data needs to be a 1D array of amplitude values. The AWG assumes that they are evenly spaced over the set waveform period. The values will be normalized to the range [-1.0, +1.0] and then scaled to the desired amplitude and offset.
Python:
You can use the lut_data parameter in the generate_waveform function to upload the lookup table amplitude values from an array that was previously defined. For additional documentation on the generate_waveform function, please refer to the Moku API reference documentation.
MATLAB:
The procedure for MATLAB is similar to that of Python where you will need to define a 1D array of amplitude value points and call it as a parameter in the generate_waveform function. You can find additional documentation on the generate_waveform function in the Moku API reference online. You can find a MATLAB example here.
LabVIEW:
The Moku AWG generate_waveform.vi's input control LUT Data is the 1d data array used to define a custom waveform. Figures 1 and 2 show how to modify the Arbitrary Waveform Generator Example.vi block diagram to read LUT Data from a file. The Arbitrary Waveform Generator Example.vi can be found in LabVIEW by going to Help -> Find Examples, from the Browse tab change the view to Directory Structure, then go to Liquid Instruments -> Liquid Instruments Moku.
Figure 1: Example vi with LUT data coming from the signal generator
Figure 2: Modified example to load custom waveform (LUT data) from a file.
Moku:Pro
Max Number of Points |
Sampling Rate |
16,384 |
1.25 GSa/s |
32,768 |
625 MSa/s |
65,536 |
312.5 MSa/s |
Table 1: Moku:Pro's maximum number of points for each sampling rate
Moku:Lab
Max Number of Points |
Sampling Rate |
8,192 |
1 GSa/s |
16,384 |
500 MSa/s |
32,768 |
250 MSa/s |
65,536 |
125 MSa/s |
Table 2: Moku:Lab's maximum number of points for each sampling rate
Moku:Go
Max Number of Points |
Sampling Rate |
8,192 |
125 MSa/s |
16,384 |
62.5 MSa/s |
32,768 |
31.25 MSa/s |
65,536 |
15.625 MSa/s |
Table 3: Moku:Go's maximum number of points for each sampling rate