Spike detection based on continuous wavelet transform with data-driven templates.
This method is based on:
Nenadic Z, Burdick JW.
Spike detection using the continuous wavelet transform.
IEEE Trans Biomed Eng. 2005;52(1):74-87.
doi:10.1109/TBME.2004.839800
Through adapting custom wavelets based on spike waveforms, it creates a family of templates that are then scaled:
- Horizontally in time domain,
- Vertically in voltage (amplitude) domain.
This allows for a more robust spike detection that accounts for the physiological spike waveforms (as opposed to abstract wavelets).
-
Filter the raw voltage trace (3rd order Butterworth, 600 Hz - 8 kHz).
-
Using the aggregated median spike waveform adapt a custom wavelet.
Spike Overlay | Average waveform | Adapted wavelet |
---|---|---|
![]() |
![]() |
![]() |
- Run spike detection scaling the custom wavelet across scales.
- Compare with threshold-based method and built-in wavelets from MATLAB Wavelet Toolbox.
Clone git repository:
git clone https://github.com/jeremi-chabros/CWT.git
Requires MATLAB with Wavelet Toolbox and Signal Processing Toolbox.
Preferred method is executing (or calling from command window) getSpikesApp.m
- Toggle between setting path to the folder with data or loading specific file(s)
- Select files/folder
- Select output folder (by default saves in current directory)
- Set parameters and save them
- Run spike detection
Tip: Hover mouse over a parameter to display its value and usage.
Organization of different functions is as follows:
├── batchDetectSpikes.m
│ └── detectSpikesCWT.m
│ ├── getTemplate.m
│ │ └── detectSpikesThreshold.m
│ ├── adaptWavelet.m
│ └── detectSpikesWavelet.m
This method is still under development and troubleshooting and hence frequent
git pull
is recommended:
git stash -A
git pull