expyfun.stimuli.convolve_hrtf#

expyfun.stimuli.convolve_hrtf(data, fs, angle, source='cipic', interp=False)[source]#

Convolve a signal with a head-related transfer function.

Technically we will be convolving with binaural room impulse responses (BRIRs), but HRTFs (freq-domain equiv. representations) are the common terminology.

Parameters:
data1-dimensional or 1xN array-like

Data to operate on.

fsfloat

The sample rate of the data. (HRTFs will be resampled if necessary.)

anglefloat

The azimuthal angle of the HRTF.

sourcestr

Source to use for HRTFs. Currently ‘barb’ and ‘cipic’ are supported. The former is default for legacy purpose. ‘cipic’ is recommended for new experiments.

interpbool

Parameter to determine whether to restrict use to known HRTF values or to use an interpolated HRTF for angles not in the source; set to False by default

Returns:
data_hrtfarray

A 2D array shape=(2, n_samples) containing the convolved data.

Notes

CIPIC data downloaded from:

Additional documentation:

The data were modified to suit our experimental needs. Below is the licensing information for the CIPIC data:

Copyright

Copyright (c) 2001 The Regents of the University of California. All Rights Reserved.

Disclaimer

THE REGENTS OF THE UNIVERSITY OF CALIFORNIA MAKE NO REPRESENTATION OR WARRANTIES WITH RESPECT TO THE CONTENTS HEREOF AND SPECIFICALLY DISCLAIM ANY IMPLIED WARRANTIES OR MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE.

Further, the Regents of the University of California reserve the right to revise this software and/or documentation and to make changes from time to time in the content hereof without obligation of the Regents of the University of California to notify any person of such revision or change.

Use of Materials The Regents of the University of California hereby grant users permission to reproduce and/or use materials available therein for any purpose- educational, research or commercial. However, each reproduction of any part of the materials must include the copyright notice, if it is present.

In addition, as a courtesy, if these materials are used in published research, this use should be acknowledged in the publication. If these materials are used in the development of commercial products, the Regents of the University of California request that written acknowledgment of such use be sent to:

CIPIC- Center for Image Processing and Integrated Computing University of California 1 Shields Avenue Davis, CA 95616-8553

Examples using expyfun.stimuli.convolve_hrtf#

Generate more advanced auditory stimuli

Generate more advanced auditory stimuli