Skip to content

Oferneum/Signal-Processing-Spike-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Signal Processing & Spike Detection

Overview

This project analyzes neurophysiological voltage data to detect action potentials (spikes) and calculate firing rates. It processes raw signal data, identifies threshold crossings, locates local maxima to pinpoint exact spike times, and computes both average firing rates and Inter-Spike Intervals (ISI) across specific stimulus segments.

Key Features

  • Spike Detection: Identifies precise action potentials using threshold-crossing logic and local maxima isolation.
  • Firing Rate Analysis: Calculates spikes per second across defined stimulus cycles.
  • ISI Calculation: Computes Inter-Spike Intervals to provide localized frequency metrics ($R_{av} \pm R_{std}$).
  • Data Visualization: Generates multi-layered plots overlaying raw voltage, threshold crossings (Low-to-High / High-to-Low), and peak events.

Visual Results

1. Signal Detection & Event Tracking

This graph demonstrates the algorithm accurately identifying the threshold crossings and isolating the local maxima (spikes) within the voltage data.

Signal 1 (S1) S1 Spike Detection

Signal 2 (S2) S2 Spike Detection

2. Segmented Firing Rates

A breakdown of the firing rates across different stimulus segments, comparing the standard rate (R) with the ISI-based average rate.

Signal 1 (S1) S1 Firing Rates

Signal 2 (S2) S2 Firing Rates

Tech Stack

  • Language: Python
  • Libraries: NumPy (for array manipulation and mathematical operations), Matplotlib (for data visualization)

How It Works

  1. Data Loading: Imports raw continuous voltage arrays.
  2. Thresholding: Creates a boolean mask to find segments where the signal exceeds -20mV.
  3. Transition Mapping: Uses np.diff to locate the exact indices where the signal crosses the threshold upwards (L2H) and downwards (H2L).
  4. Peak Finding: Slices the signal between L2H and H2L indices to find the absolute local peak.
  5. Rate Calculation: Bins the detected spikes into stimulus time segments to calculate frequency.

About

Analyzes neural voltage data to detect action potentials and calculate firing rates over specific stimulus segments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages