This function creates a time frequency represention of EEG time series data. Currently, the only available method is a Morlet wavelet transformation performed using convolution in the frequency domain.

compute_tfr(data, ...)

# S3 method for default
compute_tfr(data, ...)

# S3 method for eeg_epochs
compute_tfr(data, method = "morlet", foi, n_freq,
  n_cycles = 7, keep_trials = FALSE, output = "power",
  downsample = 1, verbose = TRUE, ...)

# S3 method for eeg_evoked
compute_tfr(data, method = "morlet", foi, n_freq,
  n_cycles = 7, keep_trials = FALSE, output = "power",
  downsample = 1, verbose = TRUE, ...)

Arguments

data

An object of class eeg_epochs.

...

Further TFR parameters

method

Time-frequency analysis method. Defaults to "morlet".

foi

Frequencies of interest. Scalar or character vector of the lowest and highest frequency to resolve.

n_freq

Number of frequencies to be resolved. Scalar.

n_cycles

Scalar. Number of cycles at each frequency. Currently only supports a single number of cycles at all frequencies.

keep_trials

Keep single trials or average over them before returning. Defaults to FALSE.

output

Sets whether output is power, phase, or fourier coefficients.

downsample

Downsampling factor. Integer. Selects every n samples after performing time-frequency analysis.

verbose

Print informative messages in console.

Methods (by class)

  • default: Default method for compute_tfr

  • eeg_epochs: Default method for compute_tfr

  • eeg_evoked: Method for eeg_evoked objects.

Examples

compute_tfr(demo_epochs, method = "morlet", foi = c(4, 30), n_freq = 10, n_cycles = 3)
#> Output frequencies: 4 6.89 9.78 12.67 15.56 18.44 21.33 24.22 27.11 30
#> Removing channel means per epoch...
#> Epoched EEG TFR data #> #> Frequency range : 4 6.89 9.78 12.67 15.56 18.44 21.33 24.22 27.11 30 #> Number of channels : 11 #> Electrode names : A5 A13 A21 A29 A31 B5 B6 B8 B16 B18 B26 #> Number of epochs : None, averaged. #> Epoch limits : -0.197 - 0.451 seconds #> Sampling rate : 128 Hz