Skip to content

EEG Signal Processing & Enhancement tool using Tkinter GUI. It performs bandpass filtering, EMG noise reduction via Wavelet Transform, and Savitzky-Golay smoothing. Supports EDF file input/output, visualization, and SNR calculation. Processed signals can be saved in EDF format. See README.md for details.

License

Notifications You must be signed in to change notification settings

habibkhan099/EEG-Signal-Enhancement-and-EMG-Noise-Reduction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 EEG Signal Enhancement and EMG Noise Reduction

GitHub

🌟 Introduction

Electroencephalography (EEG) is a widely used method for studying brain activity. However, EMG noise often contaminates EEG signals, making accurate analysis challenging.
This project focuses on:
✔️ Enhancing EEG signal quality
✔️ Reducing EMG noise through advanced signal processing techniques

🎯 The results of this work can be applied in brain-computer interfaces (BCI), neurofeedback, and medical diagnosis systems.


✨ Features

  • 🛠️ Bandpass Filtering: Focuses on the critical EEG frequency range (0.5–50 Hz).
  • 🌊 Wavelet Transform: Reduces EMG artifacts in both time and frequency domains.
  • 🧹 Savitzky-Golay Smoothing: Smooths the waveform for enhanced clarity.
  • 📊 Quantitative Evaluation: Improves Signal-to-Noise Ratio (SNR).

📂 Dataset

The dataset used is the EEG Motor Movement/Imagery Dataset from PhysioNet, including:

  • 🧑‍🤝‍🧑 109 participants
  • 📁 Over 1500 EEG recordings

📌 Dataset Source


🛠️ Methodology

The signal enhancement pipeline consists of the following steps:

1️⃣ Bandpass Filtering

A Butterworth filter isolates the EEG frequency range, removing unwanted noise while preserving essential signal components.


2️⃣ Wavelet Transform

Wavelet analysis decomposes the EEG signal, applying thresholding to suppress EMG artifacts and reconstruct the denoised signal.


3️⃣ Savitzky-Golay Smoothing

This technique applies polynomial fitting to smooth minor fluctuations while maintaining the signal's core features.


🚀 Results

The pipeline significantly improves signal quality:

📈 Before vs After Noise Reduction

  • Raw Signal: Heavily contaminated by EMG noise.
  • Filtered Signal: Unwanted noise removed.
  • Enhanced Signal: Cleaned and smoothed for analysis.

    Signals Comparison

🔢 Key Metrics

  • Initial SNR: 4.19 dB
  • Enhanced SNR: 2.38 dB

🔮 Challenges and Limitations

Challenges

  • Signal Variability: EEG signals differ significantly between participants.
  • Threshold Tuning: Noise reduction thresholds required iterative optimization.

Limitations

  • Offline processing only; no real-time capabilities.
  • Limited dataset scope.

📅 Future Work

  • 🕒 Real-Time Processing: Implement the pipeline for real-time EEG analysis.
  • 📈 Expand Dataset: Test with more diverse populations for broader applicability.
  • 🤖 AI-Based Noise Reduction: Use machine learning for adaptive thresholding.

🛠️ Getting Started

Prerequisites

📌 Install Python (3.8 or above).
📌 Required libraries: NumPy, SciPy, PyWavelets, Pyedflib.


Installation

1️⃣ Clone the repository:

git clone https://github.com/habibkhan099/EEG-Signal-Enhancement-and-EMG-Noise-Reduction.git
cd EEG-Signal-Enhancement-and-EMG-Noise-Reduction

2️⃣ Install dependencies:

pip install -r requirements.txt

Usage

1️⃣ Prepare EEG data in .csv or .mat format.
2️⃣ Run the main script for signal processing:

python main.py --input your_data.csv --output enhanced_signal.csv

3️⃣ Visualize results:

main.py

📷 Visuals

Here are some visual aids for the project:

1️⃣ Block Diagram


2️⃣ GUI



📚 References

1️⃣ Goldberger AL, et al. PhysioNet: EEG Motor Imagery Dataset. PhysioNet.
2️⃣ Mallat, S. A Wavelet Tour of Signal Processing. Academic Press, 1999.
3️⃣ Tawhid, M.N.A. et al., Time-Frequency EEG Analysis Using Wavelet Transform.


🤝 Contributing

We welcome contributions! To contribute:
1️⃣ Fork the repository.
2️⃣ Create a new branch (feature-name).
3️⃣ Submit a pull request.


📄 License

This project is licensed under the MIT License. See the LICENSE file for more details.


About

Developed as a Semester Project of Digital Signal Processing during the B.Sc. Computer Engineering program at UET Taxila, supervised by Dr. Muhammad Majid.


📌 Repository

🔗 Visit Repository


About

EEG Signal Processing & Enhancement tool using Tkinter GUI. It performs bandpass filtering, EMG noise reduction via Wavelet Transform, and Savitzky-Golay smoothing. Supports EDF file input/output, visualization, and SNR calculation. Processed signals can be saved in EDF format. See README.md for details.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages