Skip to content

Correct way to center the signal by channel and by trial/event #219

Answered by bnicenboim
lnalborczyk asked this question in Q&A
Discussion options

You must be logged in to vote

Hi! Thanks for the kind words!

Yeah, good point. eeg_baseline only baselines using the signal before the start of the trial (the time 0). That's how I've always done it and seen it. But I could make eeg_baseline more flexible. Could you open an issue and provide a reference on a paper where it's done the way you want it?

In any case, what you want to do (if I understood it right), it's relatively straight forward to do:

data_segments <- data_faces_ERPs %>% eeg_group_by(.id) %>%
  eeg_mutate(across_ch(~.x - mean(.x)))

across_ch is like dplyr's across but by default across all the channels of the object, so for every channel in every segment, you take it and subtract the mean. That's what …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lnalborczyk
Comment options

Answer selected by lnalborczyk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants