csn-le / wave_clus

A fast and unsupervised algorithm for spike detection and sorting using wavelets and super-paramagnetic clustering
127 stars 66 forks source link

Setting an absolute threshold level #119

Closed AdrianRees closed 5 years ago

AdrianRees commented 5 years ago

Would it be possible to have an option to set the threshold as a voltage or absolute value rather than having to specify some number of times the estimated standard deviation of the noise?
We want to compare firing before and after application of drugs which lead to large changes in firing rate. The latter changes the standard deviation so we end up with a different threshold for the control condition and the drug condition. If we concatonate all the blocks we end up with a threshold based on all of them.
If we could set the threshold from the control firing we could then compare the spikes fired in the drug and recovery conditions using the same threshold as in the control.
Many thanks Adrian

ferchaure commented 5 years ago

The threshold is calculated from the filtered signal, use a absolute value is not a trivial configuration. If you know the time of the drug application you could change the parameter par.segments_length to cut the raw data in segments just before and after that time.