Makinen: Makinen

View source: R/man.R

MakinenR Documentation

Makinen

Description

Generates Signal as per Makinen et. al 2005 paper

Usage

Makinen (frames, epochs, srate, position)

Arguments

frames

number of signal frames per each trial

epochs

number of simulated trials

srate

sampling rate of simulated signal in Hz

position=frames/2

position of the reset [in frames]; default: in the middle

Details

Generate simulated data by summing 4 phase reset sinusoids with freqencies chosen randomly from range 4-16Hz. Has the same parameters as phasereset except the parameters describing the frequency range.

Value

signal

simulated EEG signal; vector: 1 by frames*epochs containing concatenated trials

Author(s)

Adapted from Yeung N,Bogacz R, Holroyd C, Nieuwenhuis S, Cohen J

References

https://data.mrc.ox.ac.uk/data-set/simulated-eeg-data-generator

Examples

#mymak = Makinen (200, 1, 250, 115)
#plot (mymak)

## The function is currently defined as
Makinen <- function(frames, epochs, srate, position = frames / 2) {
  signal <- replicate(epochs * frames, 0)#generating empty wave
  #print(length(signal))
  for (i in 1:4) {
    #repeat for 4 sinusoids
    new_signal <- phasereset(frames, epochs, srate, 4, 16, position)
    #print(length(new_signal))
    signal = signal + new_signal#add new sin to summation
  }
  return(signal)
}










connolr3/eegdatasim documentation built on April 14, 2022, 10:39 a.m.