RustNeuro
RustNeuro is a high-performance Rust library for neural signal analysis and feature extraction. Designed for scientists and researchers working with EEG and other neural signals, RustNeuro provides a suite of tools that cover artifact detection, digital filtering, spectral analysis, and data I/O—all optimized for fast computation.
Overview
RustNeuro leverages Rust’s safety and concurrency features to deliver efficient signal processing routines. Whether you are cleaning your EEG data of artifacts, filtering out noise, or performing detailed spectral analysis, RustNeuro offers flexible, easy-to-use APIs that integrate seamlessly into your research workflows.
Features
-
Data I/O
Load EEG data from CSV files with support for both header and headerless formats. Automatically handle timestamps and event markers. -
Artifact Detection and Removal
Detect artifacts based on amplitude and gradient thresholds. Merge overlapping artifacts and remove them via various interpolation methods (linear, constant, previous value, or mean). -
Digital Filtering
Apply a range of filters to your signals by using the biquad wrapper:- Low-Pass, High-Pass, and Band-Pass filters
- Notch (or Band-Stop) filters for attenuating power-line noise
- Peak (Peaking EQ) filters for boosting or cutting narrow frequency bands
-
Spectral Analysis
Compute the power spectral density (PSD) of a signal using Welch’s method with adjustable window functions (Rectangular, Hann, Hamming, Blackman, Tukey). Also, measure coherence and derive common EEG frequency bands. -
Performance
Built with speed in mind by using optimized DSP libraries (e.g., rustfft) and parallel processing where applicable.
Installation
Add RustNeuro to your project by including it in your Cargo.toml:
[]
= "0.2.2"
Then, build your project with:
Usage
Loading EEG Data
RustNeuro includes a CSV loader for EEG datasets. For example:
use load_csv;
Artifact Detection and Removal
Detect and remove artifacts from your EEG data:
use ;
use EEGData;
Filtering Signals
Apply filters to a single-channel signal:
use ;
To filter all channels in an EEG dataset:
use apply_filter_to_all_channels;
use load_csv;
use ;
Spectral Analysis
Compute the PSD of a signal using Welch’s method:
use ;
API Documentation
For full API documentation, please see our docs.rs page or check the source code in our GitHub repository.
Running Tests
To run the complete test suite:
Contributing
Contributions are welcome! If you have ideas for improvements, new features, or bug fixes, please open an issue or submit a pull request on GitHub repository.
License
RustNeuro is licensed under the MIT License.
Contact
For any questions, issues, or suggestions, please reach out to:
- Yusuf Berdan Guzel – yguzel@unimelb.edu.au