A comprehensive collection of examples demonstrating how to use Liquid Instruments Moku devices across multiple programming languages and environments.
This repository contains example code for working with Moku devices, including:
- Python API examples - Scripts and Jupyter notebooks for Python-based instrument control
- MATLAB API examples - MATLAB scripts for instrument automation
- Neural Network examples - Deep learning applications using the Moku Neural Network instrument
- Multi-language examples - Demonstrations in other programming languages
- A Moku device
- Network connection to your Moku device
- For Python examples: Python 3.9 or higher
- For MATLAB examples: MATLAB R2016b or later
Before running any example, you must edit the file to configure your device connection:
- Update the IP address (e.g.,
'192.168.1.100') or device name to match your Moku device - Some examples may require additional configuration (sample rates, channels, etc.)
Look for lines like:
MOKU_IP = '192.168.1.100' # Update with your device IP
# or
i = Oscilloscope('192.168.###.###', force_connect=True)No example will work "out of the box" without this configuration step.
-
Install the Moku Python API:
pip install moku
-
Run a basic example:
python python-api/oscilloscope_plotting.py
-
Try a Jupyter notebook:
jupyter notebook python-api/hello_moku.ipynb
-
Install the Moku MATLAB API from the Liquid Instruments website
-
Run an example:
run('matlab-api/oscilloscope_basic.m')
-
Install neural network dependencies:
pip install 'moku[neuralnetwork]' -
Run a neural network example:
jupyter notebook neural-network/Simple_sine.ipynb
moku-examples/
├── python-api/ # Python scripts and Jupyter notebooks
│ ├── oscilloscope_*.py
│ ├── datalogger_*.py
│ ├── waveformgenerator_*.py
│ └── ...
├── matlab-api/ # MATLAB scripts (.m files)
│ ├── oscilloscope_*.m
│ ├── laser_lock_box_*.m
│ └── ...
├── neural-network/ # Neural network instrument examples
│ ├── Classification.ipynb
│ ├── Autoencoder.ipynb
│ └── ...
├── other-language-api/ # Examples in other languages
└── mc/ # Multi-instrument Moku Compile examples
The python-api/ directory contains examples for:
- Oscilloscope: Data acquisition, plotting, streaming, deep memory mode
- Waveform Generator: Signal generation, modulation, triggering
- Data Logger: High-speed data logging and streaming
- Spectrum Analyzer: Frequency domain analysis
- Lock-in Amplifier: Phase-sensitive detection
- Phasemeter: Phase and frequency measurements
- PID Controller: Feedback control systems
- Logic Analyzer: Digital signal analysis and protocol decoding
- FIR Filter: Digital signal filtering
- Laser Lock Box: Laser stabilization
- Multi-Instrument Mode (MIM): Using multiple instruments simultaneously
The neural-network/ directory contains examples for:
- Signal Classification: Detecting anomalies in time-series data
- Autoencoders: Signal compression and reconstruction
- Regression: Predicting signal characteristics
- Control Systems: Neural network-based PID control
- Signal Processing: FFT, filtering, and signal identification
The matlab-api/ directory mirrors the Python examples with MATLAB implementations.
- Oscilloscope:
*oscilloscope*files - Waveform Generator:
*waveformgenerator*or*wavegen*files - Data Logger:
*datalogger*files - Spectrum Analyzer:
*spectrumanalyzer*files - And more...
- Plotting:
*plotting*files - Show how to visualize data - Streaming:
*streaming*files - Real-time data streaming - Basic:
*basic*files - Simple getting-started examples - MIM:
mim_*files - Multi-instrument mode examples
- Moku Python API Documentation
- Moku MATLAB API Documentation
- Moku User Manuals
- Neural Network Instrument Guide
Contributions are welcome! Please see CONTRIBUTING.md for guidelines on:
- Setting up your development environment
- Running tests and code quality checks
- Submitting pull requests
- Issues: Report bugs or request examples via GitHub Issues
- Email: support@liquidinstruments.com
- Forum: Liquid Instruments Community Forum
This project is licensed under the MIT License - see the LICENSE file for details.
Examples and code maintained by Liquid Instruments.