Skip to content

srData for single trial mic data preprocessing and ridge regression models #3

Open
kailinzhuang wants to merge 50 commits into
theunissenlab:mainfrom
kailinzhuang:mic
Open

srData for single trial mic data preprocessing and ridge regression models #3
kailinzhuang wants to merge 50 commits into
theunissenlab:mainfrom
kailinzhuang:mic

Conversation

@kailinzhuang

Copy link
Copy Markdown

this contains data preprocessing and model fitting functions for single-trial mic data as well as some data type / syntax fixes to be compatible with np version (2.4.4).

  • preprocess_sound_nwb: this is used for both trial-averaged (for efferent copy audio) and single trial (for mic audio)
  • add compute_amp_dev_threshold to compute the envelope, derivative, and find the derivative threshold for event detection with four options. threshold: 1) default (for efferent copy audio only) to use a fixed derivative threshold (default 0.5), 2) std of concatenated derivative for all trials of the same stimulus, 3) std of concatenated derivative of all trials of all stimuli, and 4) std of derivative, one per-trial .
  • added R2ST calculation in fit_seg to calculate single-trial R2 and single-trial error (to later compare with single-trial mic R2)
  • add fit_seg_st to solve ridge regression with LOO for single trial mic data.

minor:

  • update to now use np.complex128 and np.float64
  • use .item()

kailinzhuang and others added 20 commits May 18, 2026 14:23
…p (and for later to add 'single-trial' processing) with _generate_srdata
…e (same for all trials) in

generate_srData_nwb_single_trials
… calculating deriative threshold in mic trial data
…opy audio data vs single-trial mic data and compare single trial r2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant