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

attenuator that works with non-tonal stimuli #8

Open
nzjrs opened this issue Nov 20, 2020 · 3 comments
Open

attenuator that works with non-tonal stimuli #8

nzjrs opened this issue Nov 20, 2020 · 3 comments

Comments

@nzjrs
Copy link
Collaborator

nzjrs commented Nov 20, 2020

AFAICT FlyVR 1.0 (https://github.com/murthylab/fly-vr/blob/flyvr-1.0/audio/attenuation.py) and it's port to FlyVR2
(https://github.com/murthylab/fly-vr/blob/master/flyvr/audio/attenuation.py) only ever supported tonal attenuation using interp1d.

Use of a the white-noise transfer file / calibration information was never supported in FlyVR 1.0.

c.f. this with the MATLAB side (fbfd0b4), we are lacking the reverse transform using the white noise transform

@nzjrs
Copy link
Collaborator Author

nzjrs commented Dec 29, 2020

[--transfer_file TRANSFER_FILE]--transfer_file TRANSFER_FILE
                        A file specifying the transfer function for auditory white noise.]

@nzjrs
Copy link
Collaborator Author

nzjrs commented Jan 12, 2021

If the frequency for a given stim in the playlist is 0 then it is white noise in which case do:
    -> convolve with the transfer function
    -> multiply by the attenuation factor near frequency = 0 in the attenuation file
    -> Do both 1-2 for the correct channel

If the frequency is not 0, then - 
    -> Find the frequency from the table, and use the corresponding attenuation factor
    -> If Freq does not appear in the table but in the range of frequencies in the table (typically 100-900Hz), interpulate
    -> If <min or >max: through an error

@nzjrs
Copy link
Collaborator Author

nzjrs commented Jan 12, 2021

tf coefficients

  • scipy.io.loadmat('cal20160628_transferFunction_Ca')['mean_ifft_transferFct_voltToStim'].shape -> (1, 10000)
  • scipy.io.loadmat('20201119_transferFunction')['mean_ifft_tf_micToStim'].shape -> (1, 44100)

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

No branches or pull requests

1 participant