SigClean is a comprehensive Python library for cleaning and preprocessing biomedical signals including ECG, EMG, EEG, and other physiological signals. It provides a complete toolkit for signal filtering, artifact removal, noise reduction, and signal quality assessment.
- Butterworth filters: Lowpass, highpass, bandpass, and bandstop filtering
- Notch filters: Remove power line interference (50/60 Hz)
- Adaptive filtering: LMS adaptive noise cancellation
- Savitzky–Golay filtering: Smooth signals while preserving features
- Moving average: Simple signal smoothing
- Baseline removal: Linear detrending, polynomial fitting, median filtering
- Artifact removal: Statistical outlier detection and interpolation
- Normalization: Z-score, min–max, robust, and unit vector normalization
- Resampling: Change sampling frequency with interpolation or
scipy
methods
- Signal segmentation: Windowed analysis with overlap
- Peak detection: Find R-peaks, spikes, and other signal features
- SNR calculation: Signal-to-noise ratio estimation
- Quality metrics: Comprehensive signal quality assessment
- Signal plotting: Time-domain visualization with customization
- Frequency analysis: Power spectral density and spectrograms
- Before/after comparisons: Side-by-side filtering results
- Multi-signal plots: Compare multiple signals simultaneously
- Quality assessment plots: Comprehensive signal quality visualization
butterworth_filter()
– Apply Butterworth filters (lowpass, highpass, bandpass, bandstop)notch_filter()
– Remove specific frequency components (e.g., power line interference)baseline_removal()
– Remove baseline drift and trendsartifact_removal()
– Detect and remove signal artifactsadaptive_filter()
– LMS adaptive filtering for noise reductionmoving_average_filter()
– Simple moving average smoothingsavitzky_golay_filter()
– Savitzky–Golay smoothing filter
normalize_signal()
– Signal normalization (z-score, min–max, robust)resample_signal()
– Change sampling frequencysegment_signal()
– Split signal into overlapping windowscalculate_snr()
– Signal-to-noise ratio calculationdetect_peaks()
– Peak detection in signalsremove_outliers()
– Outlier detection and removalcalculate_signal_quality()
– Comprehensive quality assessment
plot_signal()
– Basic signal visualizationplot_frequency_spectrum()
– Power spectral density plotsplot_before_after()
– Before/after filtering comparisonplot_multiple_signals()
– Multi-signal visualizationplot_spectrogram()
– Time–frequency analysisplot_signal_quality_assessment()
– Comprehensive quality plotsplot_filter_response()
– Filter frequency response
I welcome contributions!
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m "Add amazing feature"
- Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
This project is licensed under the MIT License – see the LICENSE file for details.
If you use SigClean in your research or projects, please cite it as:
@software{sigclean2024,
author = {Diptiman Mohanta},
title = {SigClean: A Python Library for Biomedical Signal Cleaning},
year = {2025},
publisher = {GitHub},
url = {https://github.com/diptiman-mohanta/sigclean}
}