1

I want to generate EEG data via R and test my phase prediction methods on it and how stable they are aggainst different levels of noise. But my generated "EEG" data seems to be off, I think I need to change the time or so. I really cannot figure it out at the moment.

Does anyone know how to proper generate an EEG signal with gaussian white noise?

Thank you!

t_generated <- t2

n <- 500    #500Hz signal
s <- 120     # 2 seconds of data
t2 <- seq(0, s, length.out = s * n)  #time vector
wave.1 <- 4*sin(4.3*2*pi*t2)                   
wave.2 <- 1.5*sin(9.0*2*pi*t2)                 
wave.3 <- 2*sin(20*2*pi*t2)
wave.4 <- 4*sin(32.2*pi*t2)


gaussian_noise <- rnorm(60000, mean = 0, sd = 0.5)

gen_EEG_noNoise <- wave.1 + wave.2 + wave.3 + wave.4
gen_EEG_WN <- gen_EEG_noNoise + gaussian_noise
Pauwsmaul
  • 23
  • 3

1 Answers1

0

EEG recordings are not stationary signals and most of real world recordings consist of many artifacts and various background activities whereas white noise is generally a stationary signal and would not be a good representation for EEG, However for testing purposes you might be able to include wave-forms of different frequencies with varying amplitude that represent EEG bands(Delta:0.5–4 Hz, Theta:4–8 Hz, etc.). also you can add a subtle 50 or 60 Hz sin wave to simulate the power-line noise that is usually present in EEG.