carrien / free-speech

Analysis and plotting code for speech neuroimaging experiments.
MIT License
4 stars 5 forks source link

parameterize definition of late trials in check_dataVals #60

Closed cwnaber closed 1 year ago

cwnaber commented 1 year ago

With my recent change to check_dataVals, you can now populate the errorParams input argument to specify how the function should decide if a trial is an "error trial" or not. This PR updates the "late trial" error. The "late trial" error previously worked in one of two ways:

  1. If it had info in expt about the trial length, it would check to see if the vowel ended in the first 96% of the trial. If it ended it the last 4%, error.
  2. If it DID NOT have info about trial length, it would check that the vowel ended after the first 1.5 seconds of the trial. If it ended more than 1.5 seconds since trial start, error.

That same functionality exists, but now the 4% part and the 1.5 seconds part are parameterized as errorParams.lateThresh_ratio and errorParams.lateThresh_absolute.

I also removed an unnecessary nested if/else clause. (It's unnecessary because the consequence of either statement is identical.)

This was brought to my attention by a student doing aphSIS data analysis. The late trial was being checked by parameter #2, and 1.5 seconds was not a useful threshold for them. This would resolve the issue. For aphSIS, people doing data analysis can call check_dataVals in this way instead:


errorParams.lateThresh_absolute = 2; % or some appropriate value for the study
check_dataVals([], [], [], [], [], errorParams);