flatironinstitute / ironclust

Spike sorting software being developed at Flatiron Institute, based on JRCLUST (Janelia Rocket Cluster)
Apache License 2.0
28 stars 7 forks source link

qqFactor definition #29

Closed kouichi-c-nakamura closed 5 years ago

kouichi-c-nakamura commented 5 years ago

Hi,

In default.prm, qqFactor is defined as

qqFactor = 4.5 % Spike detection thresold (Threshold = qqFactor*S, S = med(x-med(x))/.6745). (RQ Quiroga'04).

Quiroga (2004) refers to Donoho and Johnstone (1994) and that paper says:

Our software estimates the noise level sigma as the median absolute deviation of the wavelet coefficients at the finest level J, divided by 0.6745.

So, I'm wondering if the above description should be corrected as

Threshold = qqFactor*S, S = median(abs(x-median(x)))/0.6745

in other words, we may need abs, and also to make it MATLAB friendly use median instead of med?

jamesjun commented 5 years ago

The comment is fixed. In actuality, I perform

Threshold = qqFactor*S, S = median(abs(x)) / 0.6745 since median(x)==0 after performing high-pass filtering operation (see line3242 inirc.m). The median is estimated after subsampling the recording (100,000 samples) for each channel.

kouichi-c-nakamura commented 5 years ago

Thanks for the swift response!