The-Lammert-Lab / TinnitusExpWebApp.jl

GNU Affero General Public License v3.0
0 stars 0 forks source link

Add resynth adjustment protocol #80

Closed nelson-barnett closed 2 months ago

nelson-barnett commented 4 months ago

OVERVIEW:

After the basic reverse correlation protocol, where subjects respond yes or no to stimuli, we have two sections we refer to as "follow up" experiments. This is the first part of the follow up sequence. This is the protocol I'm referring to. It allows the subject to move two sliders that alter the way their reconstruction sounds. We ask the subject to move the sliders around and listen to the result until it is as close to their tinnitus (or the target sound!) as they can get it.

TECHNICAL DESCRIPTION:

We do the reconstruction in "bin space", where the values represent amplitudes of bins that are logarithmically spaced over the frequency domain. From there, we have lots of options for how to go from bin space to the time domain, where subjects can actually listen to their reconstruction. The binnedrepr2wav method does this conversion based on two parameters we refer to as mult and binrange. Those alter the "sharpness" of the peaks and the dynamic range of the signal. These are the values that the sliders control on the subject-facing GUI.

TASK DESCRIPTION:

When you start working on this, I can send you some data I have so you can experiment with the matlab version if you'd like. Just let me know.

nelson-barnett commented 4 months ago

I added the binnedrepr2wav (here) function to TinnitusReconstructor.jl and published a new version (0.3.0), which should be available soon. Make sure you're using that version now when your working on the website. binnedrepr2wav is the function to use to pass mult and binrange parameters to during the adjustment protocol. The first return value is the resynthesized waveform.

nelson-barnett commented 4 months ago

One more note, what you'll have to do is: Collect the responses and stimuli for the current user and the current experiment. Responses should be an n x 1 column vector and stimuli should be an n x m matrix, where n is the number of trials and m is the number of bins. There's a whole bunch of array transposing going on, but I believe this is the correct orientation to pass them to gs. Generate a reconstruction (you only need to do this once) by passing responses and stimuli to the function TinnitusReconstructor.gs(responses, stimuli). Then, generate the first waveform to play with whatever default mult and binrange values you're using (we can check in about this). Maybe start at mult = 0.001 and binrange = 60. resynth_waveform, = binnedrepr2wav(stimgen, mult, binrange). Play the user that waveform and generate a new one every time they press "play sound" with whatever mult and binrange values are currently selected.