Open PatrickHonma opened 1 year ago
Hi Patrick, I don't think that spike_alignment could add a shift, maybe your filtering step? are you using zero phase filters?
I am using the 4th order ellip filter, which should be zero phase?
If you applied with the function filtfilt it should be zero phase
Here is what I used to filter, which I believe should match up with the Wave_clus filter:
if exist('ellip','file') %Checks for the signal processing toolbox [b,a] = ellip(4,0.1,40,[300 7500].*2./fs); if exist('FiltFiltM','file') filtWBdata = FiltFiltM(b, a, rawWBdata); else filtWBdata = filtfilt(b, a, rawWBdata); end
The timestamps of my laser stimulations are in seconds. Do you think the conversion of the wave_clus (ms) to seconds may be causing a shift in the timestamps? #143 and #210 also mention similar issues
Then the filtering is fine. I would recommend to check the alignment between recording and laser timestamps
Hi Ferchaure,
I have been using wave_clus to sort .pl2 files. Using raw WB signals collected on an OmniPlex, we filtered and digital filtered in matlab to create .mat files that are then fed into Wave_clus. The sorting has been working well; example results here:![fig2print_data_354_Ch14](https://user-images.githubusercontent.com/85576484/195753043-da02ec79-0d28-4aaf-b1e1-0dbf56975f92.png)
This data was collected during optogenetic stimulation, in which we are stimulating in periods of 2 minutes at 40 Hz (1 ms light on every 25 ms). When aligning the sorted spikes to the laser timestamps, we have noticed that some units appear ~1 ms before the laser turns on. Note that Cluster 3 is likely a light artifact. I have an alignment_window=10, w_pre = 30, w_post=44, interpolation='y', and par_detection='neg'. Will the spike_alignment with these parameters cause a shift in any of the timestamps or do you know what may be accounting for the shift in timing of these units?