<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div dir="ltr">Dear all, <div><br></div><div>I am trying to use the STA function to calculate the average of the LFP around the spikes. The LFP was recorded with an intracranial system (not supported by FT directly), so I used Spike2 software to open the file, I select the LFP channels and save it as a .mat file. I can use the file perfectly in FT. In the other hand, the spikes were sorted and save  with wave_clus as a .mat file. </div><div>I can open and analyze both file independently and even merge them as one structure.</div><div>But the problem arises when I try to see the relationship between the LFP and the spikes with ft functions as ft_spiketriggeredaverage. The data and the figure looks as  they are not synchronized among them at all. </div><div><br></div><div><br></div><div>I can't do a read_header with spike2 files (I have the error "unsopported ced6 format"), I built the hdr info by myself:<br></div><div><div>data_lfp.hdr = []</div><div>data_lfp.hdr.Fs = 20kHz;</div><div>data_lfp.hdr.nSamples = nsamples (in this case 1000 sec means 20000000 samples)</div><div>data_lfp.hdr.FirstTimeStamp =1;</div></div><div><br></div><div>There is any other way to synchronized a continuous LFP with spike data?</div><div><br></div><div>It is possible that I have an issue with the timestamps reading? </div><div><br></div><div>Thanks in advance,</div><div><br></div><div>Alex</div><div><br></div><div><br></div></div></div>