Julie-Fabre / bombcell

Automated quality control, curation and neuron classification of spike-sorted electrophysiology data
GNU General Public License v3.0
115 stars 28 forks source link

question about SNR calculation #21

Closed LaurenzMuessig closed 1 year ago

LaurenzMuessig commented 1 year ago

Hi,

Thanks for putting togther this very useful toolbox. I have a question about the signal to noise calc in _bcextractRawWaveformsFast line 159: abs(nanmax(squeeze(rawWaveformsFull(X,rawWaveformsPeakChan(X),:))))...

Is this meant to get the amplitude of the average waveform? If so, shouldn't it be nanmin or the abs and squeeze calls have to be swapped around? Atm this will more likely get the amplitude of the AHP of the spike which will be positive rather than the negative peak of the AP. Apologies if I am misunderstanding the SNR calculation. Cheers

Julie-Fabre commented 1 year ago

Hi Laurenz, Thank you for your message! Sorry for the late reply. Yes, you're right, it looks like there was an error in the implementation of SNR that I didn't catch. abs(nanmax(squeeze(rawWaveformsFull(X,rawWaveformsPeakChan(X),:)))) should be nanmax(abs(squeeze(rawWaveformsFull(X,rawWaveformsPeakChan(X),:)))) to include both somatic and non somatic action potentials. Just pushed a commit to fix that. Cheers

LaurenzMuessig commented 1 year ago

Hey Julie. Apologies for the delayed response. Yes, I meant swapping the nanmax and abs calls around. Glad I could help. Cheers