Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
faq:how_can_i_do_time-frequency_analysis_on_continuous_data [2014/09/18 08:26]
robert created
faq:how_can_i_do_time-frequency_analysis_on_continuous_data [2017/08/17 11:21] (current)
Line 45: Line 45:
 The time or latency of each trial can be constructed using the sampleinfo from the segmented data, which specified for each trial the begin and the end-sample relative in the original datafile.  ​ The time or latency of each trial can be constructed using the sampleinfo from the segmented data, which specified for each trial the begin and the end-sample relative in the original datafile.  ​
  
-  ​time (data_segmented.sampleinfo(:,​1)+data_segmented.sampleinfo(:,​2))/​data_segmented.fsample;​+  ​begsample ​= data_segmented.sampleinfo(:,​1)
 +  endsample = data_segmented.sampleinfo(:,​2)
 +  time = ((begsample+endsample)/​2) / data_segmented.fsample;​
  
-Then we proceed by copying the freq structure, in which we flip the power spectrum to change the "rot" dimension into the "​time"​ dimension: ​+Then we proceed by copying the freq structure, in which we flip the power spectrum to change the "rpt" dimension into the "​time"​ dimension: ​
  
-  freq_continuous = freq_segmented; ​+  freq_continuous ​          ​= freq_segmented; ​
   freq_continuous.powspctrm = permute(freq_segmented.powspctrm,​ [2, 3, 1]);   freq_continuous.powspctrm = permute(freq_segmented.powspctrm,​ [2, 3, 1]);
   freq_continuous.dimord ​   = '​chan_freq_time';​ % it used to be '​rpt_chan_freq'​   freq_continuous.dimord ​   = '​chan_freq_time';​ % it used to be '​rpt_chan_freq'​
   freq_continuous.time ​     = time;             % add the description of the time dimension   freq_continuous.time ​     = time;             % add the description of the time dimension
  
-Finally we can plot it, just like a regular time-ferquency ​representation+Finally we can plot it, just like a regular time-frequency ​representation
  
   cfg = []   cfg = []