Artifacts: Eye movements, power line noise#165
Artifacts: Eye movements, power line noise#165maanikmarathe wants to merge 32 commits intounfoldtoolbox:mainfrom
Conversation
maanikmarathe
commented
Sep 30, 2025
- Simulation for eye-movement and power line noise artifacts.
- Provide a modified hartmut-eyemodel with spherical eyes and with only eye-sources.
- Provide example EEG-eyetracking data from real dataset.
- Provide an example A-to-Z simulation function containing EEG, artifacts, and noise.
…on for eyemovement sim
behinger
left a comment
There was a problem hiding this comment.
just some thought - internet is crappy, sorry if something got lost
src/simulation.jl
Outdated
| # PLN simulation assumes that the sampling frequency of the final signal is the same as the sampling frequency of the other signals (eeg/artifacts). TODO: declare this more explicitly in the docstring. | ||
|
|
||
| println("Simulating EEG with no noise...") | ||
| eeg_signal,evts = simulate(rng,d,c,o,NoNoise()); |
src/simulation.jl
Outdated
| println("Simulating EEG with no noise...") | ||
| eeg_signal,evts = simulate(rng,d,c,o,NoNoise()); | ||
|
|
||
| sim_artifacts = [x for x in s if !(x isa PowerLineNoise)] # ignore PLN for now, it is handled separately since it needs to know the length of the final signal |
There was a problem hiding this comment.
I handled such cases in the past, that a length(x::AbstractContinuousSignal) needs to be defined (e.g. for AbstractComponents - could this be a solution? I dont want any ContinuousSignal be treated "special"
src/simulation.jl
Outdated
| end | ||
|
|
||
| # pad all signals to the same length (max length of all signals) | ||
| max_cols = maximum([size(mat, 2) for mat in combined_signals]) |
There was a problem hiding this comment.
does this work? just a tad simpler:
max(size.(combined_signals,2))
src/simulation.jl
Outdated
| println("Simulating EEG with no noise...") | ||
| eeg_signal,evts = simulate(rng,d,c,o,NoNoise()); | ||
|
|
||
| sim_artifacts = [x for x in s if !(x isa PowerLineNoise)] # ignore PLN for now, it is handled separately since it needs to know the length of the final signal |
There was a problem hiding this comment.
I handled such cases in the past, that a length(x::AbstractContinuousSignal) needs to be defined (e.g. for AbstractComponents - could this be a solution? I dont want any ContinuousSignal be treated "special"
There was a problem hiding this comment.
I was also thinking, if an AbstractConitnuousSignal can be generated with arbitrary length (like powernoise), one could basically return a generator, or a functioncall or whatever to be filled in later, after the "fixed-length" signals have been generated (at that point, you have the maxlength).
This is an alternative to requiring a defined length(x::AbstractcontinuousSignal)
src/simulation.jl
Outdated
| end | ||
|
|
||
| # pad all signals to the same length (max length of all signals) | ||
| max_cols = maximum([size(mat, 2) for mat in combined_signals]) |
There was a problem hiding this comment.
does this work? just a tad simpler:
max(size.(combined_signals,2))