python-intan
Tools and demos for working with EMG data from intan using python
https://github.com/neuro-mechatronics-interfaces/python-intan
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.5%) to scientific vocabulary
Keywords
Repository
Tools and demos for working with EMG data from intan using python
Basic Info
Statistics
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
- Releases: 1
Topics
Metadata Files
README.md

Python Intan
python-intan is a Python package for working with RHX Controller devices and EMG data acquired from Intan Technologies systems. It provides utilities for:
- Reading
.rhdand.datdata files - Preprocessing and feature extraction
- Integration with external hardware for closed-loop applications
Whether you're analyzing offline data or streaming real-time EMG from the RHX system, python-intan aims to make the workflow seamless and modular.
Contents
Contributions
We welcome contributions to the python-intan package! If you have ideas for new features, bug fixes, or improvements, please feel free to submit a pull request or open an issue. Have a look at our contribution guide for further guidance. Writing code isn't the only way you can contribute:
* review pull requests
* develop tutorials, presentations, and other educational materials
* help with outreach or onboarding new contributors
If you’re unsure where to start or how your skills fit in, reach out! You can ask on the forum or here, on GitHub, by leaving a comment on a relevant issue that is already open.
If you are new to contributing to open source, this guide helps explain why, what, and how to get involved.
Installation
Create a virtual environment using conda or venv:
bash
conda create -n intan python=3.10
conda activate intan
or
bash
python -m venv intan
source intan/bin/activate # On Windows use: intan\Scripts\activate
(Optional) Enable CUDA support for GPU acceleration (if available):
bash
conda install cudatoolkit cudnn=11
or
bash
sudo apt-get install cuda
pip install tensorflow[and-cuda] nvidia-cudnn-cu12 # CUDA 12.5 latest pip option as of 5/13/25
This repo can be installed from PyPi using pip:
bash
pip install python-intan
or clone & install the repository from GitHub for the latest features:
bash
git clone https://github.com/Neuro-Mechatronics-Interfaces/python-intan.git
cd python-intan
pip install -e .
Getting Started
We can quickly load EMG signals from an Intan .rhd file.
python
import intan
result = intan.io.load_rhd_file() # Opens Popup window to select file, or pass filepath
.dat files are also supported
python
dat_folderpath = "path/to/your/dat/files"
result = intan.io.load_dat_file(dat_folderpath)
The result dictionary contains:
- amplifier_data: Raw EMG data (shape: channels x samples)
- amplifier_channels: Channel metadata (names, gain, etc.)
- frequency_parameters: Sampling rate information for the amplifier, aux, and digital inputs
- t_amplifier: Time vector for the amplifier data
- board_adc_data: ADC data from the board
Loading multiple .rhd files with the option to concatenate can be done with:
python
result_list = intan.io.load_rhd_files(concatenate=True)
Some quick filtering to remove DC offset and noise:
```python
fs = result['frequencyparameters']['amplifiersamplerate']
emg = result['amplifierdata'] # Shape: (channels, samples)
notchemg = intan.processing.notchfilter(emg, fs, f0=60) # 60Hz notch filter filtemg = intan.processing.filteremg(notch_emg, 'bandpass', fs, lowcut=10, highcut=500) # 10-500Hz bandpass filter ```
We can visualize the raw EMG data using the plotting module. Let's use a waterfall plot to look at the raw activity across a subset of channels:
python
t_s = result['t_amplifier']
chans = range(0, 64) # Selecting channels to plot
intan.plotting.waterfall(filt_emg, chans, t_s, plot_title='Intan EMG data')
If there is a single channel of interest, we can plot it directly by name or index:
python
intan.plotting.plot_channel_by_name('A-005', result) # By name (Be sure the channel name exists)
intan.plotting.plot_channel_by_index(8, result) # By index
Some other processing features: ```python
Normalize the EMG data
normemg = intan.processing.normalize(filtemg, method='zscore') # Z-score normalization
Downsample the EMG data
downsampledemg = intan.processing.downsample(filtemg, factor=2) # Downsample by a factor of 2
Rectify
rectifiedemg = intan.processing.rectify(filtemg) # Rectify the EMG data
Rolling RMS window
samples = int(0.1 * fs) # 100ms window rmsemg = intan.processing.windowrms(filtemg, windowsize=samples) # 100ms RMS window ```
Project Structure
```text intan/ ├── io/ # Load and parse Intan .rhd or .rhs files ├── processing/ # Filtering, normalization, and segmentation ├── control/ # Real-time control scripts for robot arm or other peripherals ├── plotting/ # Plotting and GUI scripts
loadrhddemo.py # Quick-start script for plotting waveform data requirements.txt README.md ```
Future Improvements
- [x] Real-time gesture decoding via TCP from RHX
- [x] Serial control for wearable robotics (e.g. grippers, arms)
- [x] CNN feature pipeline support
- [ ] GUI for real-time signal monitoring
- [ ] Public datasets with training/testing support
- [ ] Cross-platform support for macOS/Linux (currently optimized for Windows)
Citation
This package can be cited as follows:
bibtex
@software{Shulgach_Python_Intan_2025,
author = {Shulgach, Jonathan, Murphy, Max and Foy, Adrian},
title = {{Python Intan Package}},
year = {2025},
month = {05},
version = {0.1.0},
url = {https://github.com/Neuro-Mechatronics-Interfaces/python-intan},
note = "{\tt jshulgac@andrew.cmu.edu}"
}
License
This project is licensed under the MIT License — see the License File for details.
Owner
- Name: Neuromechatronics Lab
- Login: Neuro-Mechatronics-Interfaces
- Kind: organization
- Location: Pittsburgh, PA
- Website: https://nml-wiki.org
- Repositories: 9
- Profile: https://github.com/Neuro-Mechatronics-Interfaces
Code repos towards developing and deploying neuro-mechatronics interfaces and related experiments/simulations.
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it using the following metadata."
title: "Python Intan Package"
authors:
- family-names: Shulgach
given-names: Jonathan
affiliation: Carnegie Mellon University
orcid: https://orcid.org/0009-0004-0449-9918
- family-names: Foy
given-names: Adrian
affiliation: Intan Technologies
date-released: 2025-05-02
version: 0.1.0
license: MIT
repository-code: https://github.com/Neuro-Mechatronics-Interfaces/python-intan
GitHub Events
Total
- Release event: 1
- Watch event: 1
- Push event: 14
- Create event: 2
Last Year
- Release event: 1
- Watch event: 1
- Push event: 14
- Create event: 2
Packages
- Total packages: 1
-
Total downloads:
- pypi 10 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
pypi.org: python-intan
Python utilities for working with Intan electrophysiology data
- Homepage: https://github.com/Neuro-Mechatronics-Interfaces/python-intan
- Documentation: https://python-intan.readthedocs.io/
- License: mit
-
Latest release: 0.0.2
published 10 months ago
Rankings
Maintainers (1)
Dependencies
- PyWavelets *
- matplotlib >=3.8.0
- numpy >=1.26.0
- pandas ==2.2.2
- pillow ==11.0.0
- scikit-learn ==1.5.2
- scipy ==1.14.1
- seaborn ==0.13.2
- tensorflow ==2.17.0