Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
faq:in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip [2015/11/26 21:48]
robert
faq:in_what_way_can_frequency_domain_data_be_represented_in_fieldtrip [2017/08/17 11:21] (current)
Line 1: Line 1:
 {{tag>​faq freq connectivity coherence}} {{tag>​faq freq connectivity coherence}}
-===== In what way can frequency domain data be represented in FieldTrip? ===== +====== In what way can frequency domain data be represented in FieldTrip? ======
- +
-=== Different output options in ft_freqanalysis ​===+
  
 +===== Different output options in ft_freqanalysis =====
  
 When computing the frequency domain representation of your data using **[[:​reference:​ft_freqanalysis]]**,​ you can specify the cfg-option '​output'​. This option determines the representation of your data: When computing the frequency domain representation of your data using **[[:​reference:​ft_freqanalysis]]**,​ you can specify the cfg-option '​output'​. This option determines the representation of your data:
Line 67: Line 66:
 The numeric data are now stored in the (complex-valued) '​fourierspctrm'​ field. It is important to realize that it is typically not a meaningful operation to average these across trials / tapers. Hence, the output will always contain the single trial / taper data. As such this representation is the most '​basic'​ of all three outputs because both power and cross spectra can be obtained from the fourier-representation of the data.  The numeric data are now stored in the (complex-valued) '​fourierspctrm'​ field. It is important to realize that it is typically not a meaningful operation to average these across trials / tapers. Hence, the output will always contain the single trial / taper data. As such this representation is the most '​basic'​ of all three outputs because both power and cross spectra can be obtained from the fourier-representation of the data. 
  
-=== Choosing the right output option for ft_freqanalysis ===+===== Choosing the right output option for ft_freqanalysis ​=====
  
  
 Which representation is most useful for your analysis depends very much on what you want to do with it, how big your data sets are, etc. The disadvantage of the fourier representation is that it requires the single trial and tapers to be stored in memory, and if that is not needed, a representation containing the average across trials or tapers may be more memory efficient. On the other hand, a cross spectrum between all channel pairs and a lot of frequency bins (and time bins) can quickly become a very big matrix, and the more concise representation of fourier spectra may be more efficient. ​ Which representation is most useful for your analysis depends very much on what you want to do with it, how big your data sets are, etc. The disadvantage of the fourier representation is that it requires the single trial and tapers to be stored in memory, and if that is not needed, a representation containing the average across trials or tapers may be more memory efficient. On the other hand, a cross spectrum between all channel pairs and a lot of frequency bins (and time bins) can quickly become a very big matrix, and the more concise representation of fourier spectra may be more efficient. ​
  
-=== A historical note ===+===== A historical note =====
  
  
 Note that the '​powspctrm'​ is actually nothing else than the cross-spectrum between a channel and itself. As such, it can in principle be represented in a '​crsspctrm'​-like way, i.e. having a labelcmb {'​a'​ '​a'​},​ rather than a label. For historical reasons, the data representation in FieldTrip makes the distinction between the auto-spectra and the cross-spectra. Note that the '​powspctrm'​ is actually nothing else than the cross-spectrum between a channel and itself. As such, it can in principle be represented in a '​crsspctrm'​-like way, i.e. having a labelcmb {'​a'​ '​a'​},​ rather than a label. For historical reasons, the data representation in FieldTrip makes the distinction between the auto-spectra and the cross-spectra.
  
-=== Yet another representation ===+===== Yet another representation ​=====
  
 Using **[[:​reference:​ft_connectivityanalysis]]** on frequency domain data containing fourier-spectra,​ without specifying cfg.channelcmb will result in yet another representation of (bivariate) frequency domain data. Using **[[:​reference:​ft_connectivityanalysis]]** on frequency domain data containing fourier-spectra,​ without specifying cfg.channelcmb will result in yet another representation of (bivariate) frequency domain data.
Line 94: Line 93:
 Note that this representation lacks a '​labelcmb'​ field, and that the '​dimord'​ is '​chan_chan_freq'​. This means that the numeric data now implicitly contains both the combinations {'​a'​ '​b'​} (in coh.cohspctrm(1,​2,:​) ) , and the combination {'​b'​ '​a'​} (in coh.cohspctrm(2,​1,:​) ). For a quantity like the coherence spectrum the values across the diagonal are symmetric, but for complex-valued quantities, as well as for directional measures of interaction,​ the values at the entries across the diagonal are typically different. The convention used by Fieldtrip is that the row-channel '​causes'​ the column-channel. Note that this representation lacks a '​labelcmb'​ field, and that the '​dimord'​ is '​chan_chan_freq'​. This means that the numeric data now implicitly contains both the combinations {'​a'​ '​b'​} (in coh.cohspctrm(1,​2,:​) ) , and the combination {'​b'​ '​a'​} (in coh.cohspctrm(2,​1,:​) ). For a quantity like the coherence spectrum the values across the diagonal are symmetric, but for complex-valued quantities, as well as for directional measures of interaction,​ the values at the entries across the diagonal are typically different. The convention used by Fieldtrip is that the row-channel '​causes'​ the column-channel.
  
-=== Toggling between the different representations === +===== Toggling between the different representations =====
  
-It is possible (but not recommended for standard ​users) to toggle between the different representations using **[[:​reference:​ft_checkdata]]** in combination with the key '​cmbrepresentation'​. For example:+It is possible (but not recommended for non-expert ​users) to toggle between the different representations using **[[:​reference:​ft_checkdata]]** in combination with the key '​cmbrepresentation'​. For example:
  
 <​code>​ <​code>​