petersenpeter / CellExplorer

CellExplorer is a graphical user interface, a standardized processing module and data structure for exploring and classifying single cells acquired using extracellular electrodes.
https://cellexplorer.org/
BSD 3-Clause "New" or "Revised" License
96 stars 59 forks source link

Generalization for all sampling frequencies #57

Closed hyr2 closed 2 years ago

hyr2 commented 2 years ago

Is your feature request related to a problem? Please describe. The script CCG.m assumes a default value of 20KHz for the sampling rate. Many labs record at 25KHz or 30KHz. This needs to be generalized. To generalize it, we need to add an extra input parameter for the function that calls CCG.m: ce_MonoSynConvClick.m

Describe the solution you'd like I am attaching the updated ce_MonoSynConvClick.m so that you can make the appropriate change. I have added an extra input parameter for the sampling rate.
Screenshot from 2022-04-18 19-12-33 Screenshot from 2022-04-18 19-12-08

petersenpeter commented 2 years ago

Hi

Thanks for the suggestion and code. I incorporated the changes across the various CCG calls, as you suggested, but maintained the variable name sr for sampling rate. For historical reasons, the CCG function takes Fs=1/sr as input.

Here is the commit: https://github.com/petersenpeter/CellExplorer/commit/69c4a1eca9aba5ec8dc6eaee6f75fdc96c7d283e

Let me know if you experience any errors.

petersenpeter commented 2 years ago

I am closing this issue now, but feel free to open it if you still experience issues.