This is the first non-RC experiment. The MATLAB code for it is here.
The user interface:
Text instructions
Slider that controls the volume. The maximum value should be 95 dB, the minimum is less important, but let's say -95dB for now.
Button to play the tone
Button to save the selected volume
Checkbox that says "can't hear" and is only active if the slider is at maximum.
Technical requirements:
Tones should increase from some minimum frequency to some maximum frequency. We can discuss how controllable these values should be, but for now just set them at 500 and 16000.
Tones should be played twice in succession. The first time, the tone starts at 60dB, the next time it starts at the user-selected value + 10dB. If the selected value + 10dB is greater than max_db, the second starting db should be just the previous user-selected value. If the user selected "can't hear" on the first instance of a tone, the second instance should start at 60 dB.
Tones need to be played at the selected dB.
Tones should immediately stop if "play sound" is clicked and the new tone at the new dB should play. Tone should immediately stop if "save choice" is selected while a tone is playing.
If "can't hear" is selected, the "play sound" button should be disabled.
Values that need to be saved are the selected dB and the corresponding tone. If "can't hear" was selected, NaN can be saved as the dB value.
This should be accessible from the home page. It can be static and doesn't need to "added" as an experiment like the RC ones do. I also think it's okay if it's repeatable, but you could have the button be disabled if there's a complete dataset for the current user. If it is repeatable, make sure all data is saved. Don't write over their data from the first time they did the experiment.
Technical support:
Subtract the calibration dB value from all slider values. That is, if the calibration dB was 105, the actual maximum slider value should be 95-105 (this will be played to the user as 95dB).
Playback dBs can be controlled by applying a gain. That is, if curr_dB is the slider value, the gain is: gain = 10^(curr_dB/20) and if curr_tone = pure_tone(5000, 0.5, 44100), you can apply the gain by multiplying: scaled_tone = gain*curr_tone.
The tones should be generated this way: test_freqs = gen_octaves(min_tone_freq, max_tone_freq, 2, "semitone"). It is not a guarantee that the max frequency will be in test_freqs if the parameters are different. So there should be a check to see if max_freq is in test_freqs, and if not, append the value to the array. This won't be a problem for 500 and 16000, but is best practice.
A Tukey window should be applied to all tones. This smooths the beginning and ending of the sound. DSP.jl can generate a Tukey window. Something like using DSP: Windows: tukey; win = tukey(length(curr_tone), 0.08); window_stim = win .* curr_tone;
This is the first non-RC experiment. The MATLAB code for it is here.
The user interface:
Technical requirements:
Technical support:
curr_dB
is the slider value, the gain is:gain = 10^(curr_dB/20)
and ifcurr_tone = pure_tone(5000, 0.5, 44100)
, you can apply the gain by multiplying:scaled_tone = gain*curr_tone
.test_freqs = gen_octaves(min_tone_freq, max_tone_freq, 2, "semitone")
. It is not a guarantee that the max frequency will be in test_freqs if the parameters are different. So there should be a check to see if max_freq is in test_freqs, and if not, append the value to the array. This won't be a problem for 500 and 16000, but is best practice.DSP.jl
can generate a Tukey window. Something likeusing DSP: Windows: tukey; win = tukey(length(curr_tone), 0.08); window_stim = win .* curr_tone;