SAND-Lab / MEA-NAP

MEA-NAP. A streamlined diagnostic and analytic tool for data obtained using microelectrode arrays.
GNU General Public License v3.0
12 stars 6 forks source link

Spike detection error about: Nonfinite endpoints or increment for colon operator in index. #27

Closed Timothysit closed 1 year ago

Timothysit commented 1 year ago

The full error message is, this happens during spike detection using the wavelet method (but not the threshold method)

Warning: Your choice of Wid is not valid given the sampling rate and wavelet family

In detectSpikesWavelet>determine_scales (line 359) In detectSpikesWavelet (line 93) Most likely Wid(1) is too small Nonfinite endpoints or increment for colon operator in index.

Error in detectSpikesWavelet (line 118) Sigmaj = median(abs(c(i,1:round(W(i)):end) - mean(c(i,:))))/0.6745;

Timothysit commented 1 year ago

This is because the Wid value lower bound is too small, for recordings at eg. 10 kHz, the lower bound of 0.4, which was the previous default, does not work, but the range [0.5, 1.5] should work (https://cbmspc.eng.uci.edu/PUBLICATIONS/zn:08b.pdf) and in a spike detection tutorial the recommended range is [0.5, 1.0], which is now the new default