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.
- 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.
This graph demonstrates the algorithm accurately identifying the threshold crossings and isolating the local maxima (spikes) within the voltage data.
A breakdown of the firing rates across different stimulus segments, comparing the standard rate (R) with the ISI-based average rate.
- Language: Python
- Libraries:
NumPy(for array manipulation and mathematical operations),Matplotlib(for data visualization)
- Data Loading: Imports raw continuous voltage arrays.
- Thresholding: Creates a boolean mask to find segments where the signal exceeds
-20mV. - Transition Mapping: Uses
np.diffto locate the exact indices where the signal crosses the threshold upwards (L2H) and downwards (H2L). - Peak Finding: Slices the signal between L2H and H2L indices to find the absolute local peak.
- Rate Calculation: Bins the detected spikes into stimulus time segments to calculate frequency.



