<div dir="ltr">Hello all,<br><br>I'm trying to do some exploratory spectral analysis on EEG data from a reaction time experiment, in which the trial ends as soon as the subject detects a target. The trails are up to 6 sec in length, but they average closer to 2-3 sec.<br><br>My goal is to make time-frequency plots, using the multi-taper method, aligned to the end of the trial (subject response) rather than the beginning. I tried the following approach first:<br><ul><li>Flip each trial’s data in time, such that sample 1 is now the end of the trial<br></li><li>Nan-pad each trial so they all have the same number of samples (6 sec * 256 Hz = 1536 samples).<br></li><li>Perform multi-taper spectral analysis with ft_freqanalysis</li></ul>It seems that FieldTrip isn’t ignoring the NaN’s when calculating the power at each time point. Effectively, I’m limiting my data to the shortest trial duration rather than plotting it out to the longest time point.<br><br>Any help on NaN removal with ft_freqanalysis, or if there’s a smarter way to align time-frequency analyses to the ends of trials, would be much appreciated!<br><br>Thanks,<br>-<br>Justin F.</div>