Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module: Evoked Experiment #107

Closed
kylemath opened this issue Jan 5, 2020 · 5 comments
Closed

Module: Evoked Experiment #107

kylemath opened this issue Jan 5, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@kylemath
Copy link
Owner

kylemath commented Jan 5, 2020

Classic ERP experiment

Either auditory or visual stimuli

~700 ms apart with random jitter
2 types
red vs blue
high vs low tone

we collect 30-50 trials , 20% of which are one condition

we save a snip of data locked to the onset for each presentation
200 ms before and 1000 ms after

we append this to an array 1200 ms by number of trials, one for each condition

we subtract the 200 ms baseline average from the whole trial for each channel and trial

we average over the trials for each channel, average over hemispheres and get a single time series for each condition

plot this and save it

@kylemath
Copy link
Owner Author

kylemath commented Jan 5, 2020

class MovingAverageCalculator {
	constructor() {
		this.count = 0
		this._mean = 0
	}
	update(newValue) {
		this.count++
		const differential = (newValue - this._mean) / this.count
		const newMean = this._mean + differential
		this._mean = newMean
	}
	get mean() {
		this.validate()
		return this._mean
	}
	validate() {
		if (this.count == 0) {
			throw new Error('Mean is undefined')
		}
	}
}

@kylemath
Copy link
Owner Author

kylemath commented Jan 5, 2020

const a = [[1,2,3], [4,5,6], [7,8,9]]
math.mean(a, 1) // [4, 5, 6]

@kylemath
Copy link
Owner Author

kylemath commented Jan 5, 2020

const reallyImportantData = []
LOOP ME FORVER:
    reallyImportantData.push(channel.datasets[0].data)

@kylemath
Copy link
Owner Author

kylemath commented Jan 5, 2020

@korymath korymath added the enhancement New feature or request label Jan 5, 2020
@kylemath
Copy link
Owner Author

kylemath commented Jan 6, 2020

addressed in #110

@kylemath kylemath closed this as completed Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants