LABSN / expyfun

Experimental paradigm functions.
BSD 3-Clause "New" or "Revised" License
13 stars 21 forks source link

build in BRIR / HRTF #77

Closed drammock closed 10 years ago

drammock commented 10 years ago

expyfun.stimuli build in BRIR / HRTF data from Barb's lab, and wrapper functions to do the convolution.

larsoner commented 10 years ago

We will either want to copy the filtering code from mne-python, or require a dependency on mne-python. WDYT?

drammock commented 10 years ago

If it's easy to from mnepython import foo then let's just do that.

drammock commented 10 years ago

One thing about Barb's data is that there were 3 iterations of each measurement, but not all of them worked out. We'll need to curate it a little bit.

larsoner commented 10 years ago

Yeah, I think we'll want to just pick whichever ones were the "best", with a record of which ones were selected.

drammock commented 10 years ago

any idea what criterion to use for "best"?

larsoner commented 10 years ago

We should probably hold a little meeting with Ross and decide what criteria to use.

rkmaddox commented 10 years ago

Not sure if this is relevant, but it might be good to get away from Barb's lab's HRTFs. There is a collection online (hosted at earlab's site) that goes in 5-deg increments instead of 10-deg. Should we compare freq responses of these as well? Just seems like if we're building in these IRs to the code that we should really go for best, whatever that means.

On Thu, Nov 14, 2013 at 9:15 AM, Daniel McCloy notifications@github.comwrote:

any idea what criterion to use for "best"?

— Reply to this email directly or view it on GitHubhttps://github.com/LABSN/expyfun/issues/77#issuecomment-28503034 .

larsoner commented 10 years ago

Sounds good to me. That way we have more options. We could even consider doing interpolation in the long-term (a good grad student project to get their feet wet) if there's a good algorithm.

drammock commented 10 years ago

Barb's actually goes in 15-degree increments, so going by 5s would be way better. Does the Earlab site have only anechoic? Barb's also have reverb...

rkmaddox commented 10 years ago

Ahhh reverb would be tougher. They are anechoic. Not sure what the best plan is here. Let's talk when I get in later today.

On Thu, Nov 14, 2013 at 9:22 AM, Daniel McCloy notifications@github.comwrote:

Barb's actually goes in 15-degree increments, so going by 5s would be way better. Does the Earlab site have only anechoic? Barb's also have reverb...

— Reply to this email directly or view it on GitHubhttps://github.com/LABSN/expyfun/issues/77#issuecomment-28503639 .

larsoner commented 10 years ago

@lkishline do you think this is something you can tackle with @drammock once you get accustomed to Python? I assume you need some subset of this functionality for your stuff anyway. You can essentially build a simple case in that works for your use case, but designed with future extensibility in mind. WDYT?

lkishline commented 10 years ago

Sure I can give it a whirl. I will let you know when I get to that point in the next few weeks.

On Saturday, March 15, 2014, Eric89GXL notifications@github.com wrote:

@lkishline https://github.com/lkishline do you think this is something you can tackle with @drammock https://github.com/drammock once you get accustomed to Python? I assume you need some subset of this functionality for your stuff anyway. You can essentially build a simple case in that works for your use case, but designed with future extensibility in mind. WDYT?

Reply to this email directly or view it on GitHubhttps://github.com/LABSN/expyfun/issues/77#issuecomment-37749646 .

Lindsey Kishline Research Assistant Laboratory for Auditory Brain Sciences & Neuroengineering ILABS 206-616-0102

rkmaddox commented 10 years ago

I'm inclined to say we should allow for multiple HRTF datasets with a specified format. I have some thoughts on how to fo this, but they'd probably be better discussed when we all happen to be in the same room than to type them all out.

On Sun, Mar 16, 2014 at 10:05 AM, Lindsey Kishline <notifications@github.com

wrote:

Sure I can give it a whirl. I will let you know when I get to that point in the next few weeks.

On Saturday, March 15, 2014, Eric89GXL notifications@github.com wrote:

@lkishline https://github.com/lkishline do you think this is something you can tackle with @drammock https://github.com/drammock once you get

accustomed to Python? I assume you need some subset of this functionality for your stuff anyway. You can essentially build a simple case in that works for your use case, but designed with future extensibility in mind. WDYT?

Reply to this email directly or view it on GitHub< https://github.com/LABSN/expyfun/issues/77#issuecomment-37749646> .

Lindsey Kishline Research Assistant Laboratory for Auditory Brain Sciences & Neuroengineering ILABS 206-616-0102

Reply to this email directly or view it on GitHubhttps://github.com/LABSN/expyfun/issues/77#issuecomment-37762882 .

larsoner commented 10 years ago

I think it should be something like convolve_hrtf(signal, angle, source='barb'). source could then also be a dict for datasets that had options, such as distance or reverberation level. The first version could implement only a single HRTF source (whichever one Lindsey needs), throwing an error if the requested angle is not present. We can later add other datasets and angle interpolation. That is the most user friendly yet readily implementable API I can think of.

rkmaddox commented 10 years ago

Yep, I agree. Angle should have the option of being a two-element list with the optional second argument for elevation. If it gets only a scalar then it should assume 0 deg elevation.

Also good behavior would be to raise an exception if you request an angle that is not in that set, unless interpolation=True (which should default to false).

Amplitude should also be calibrated so that convolving some reference signal with the 0 deg, 0 deg HRTF leaves the RMS unchanged. That way you can normalize your signals to .01 RMS first, and then apply the HRTF without having to re-scale.

On Sun, Mar 16, 2014 at 12:33 PM, Eric89GXL notifications@github.comwrote:

I think it should be something like convolve_hrtf(signal, angle, source='barb'). source could then also be a dict for datasets that had options, such as distance or reverberation level. The first version could implement only a single HRTF source (whichever one Lindsey needs), throwing an error if the requested angle is not present. We can later add other datasets and angle interpolation. That is the most user friendly yet readily implementable API I can think of.

Reply to this email directly or view it on GitHubhttps://github.com/LABSN/expyfun/issues/77#issuecomment-37767432 .

larsoner commented 10 years ago

We could also do something like convolve_hrtf(signal, az=0, el=0, interpolate=False, source='barb') to explicitly separate azimuth and elevation. I think I have a slight preference for just using angle like you suggest with the option of being a 2-element list, though, since we're unlikely to use elevation extensively in the future.