Manu Sutela added The_following_script_was_used__.tex  about 8 years ago

Commit id: d7b072f1c8481127d98400f3bf5efa1820756a45

deletions | additions      

         

The following script was used for visualization:  \begin{verbatim}  %% Part 2  load('P2_event-related_data.mat')  data = epochs.data;  Fs = epochs.Fs;  freqVec = [3:30];  timeVec = (epochs.ns_pre:epochs.ns_post)/Fs;  n = 306;  TFRS = zeros(length(timeVec), length(freqVec), n);  for i = 1:size(data,1)  disp(i);  time_series = data{i};   for j = 1:n  for k = 1:length(freqVec)   TFR_current = TFRS(:,k,j) + energyvec(freqVec(k), time_series(:,j)', Fs)';  TFRS(:,k,j) = TFR_current;  end  end  end  TFRS = TFRS / epochs.ns_ep;  %%  plotTFR(freqVec,timeVec,permute(TFRS,[2 1 3]),'layout','NM306planar.lay','labels','on',...  'ylimits', [3,20], 'zlimits',[0 0.2373e-23])  %% Plot single channel  figure();  channel = 'MEG2043';  imagesc(timeVec, freqVec, TFRS(:,:,ismember(epochs.chan_names, channel))',[0 0.2373e-23])  set(gca,'YDir','normal')  xlabel('Time [s]'); ylabel('Frequency [Hz]'); title(channel);  colorbar();  \end{verbatim}