music.hrir

music.hrir(elevation=0, azimuth=90, directory=None)[source]

The impulse responses measured nearest to one direction.

Parameters:
elevationscalar

Degrees above the horizontal, from -40 to 90. Rounded to the nearest measured elevation, which are ten degrees apart.

azimuthscalar

Degrees, measured from the ear axis as localize() and localize_linear() measure them (only localize2() measures from straight ahead): 0 is to the right, 90 straight ahead, 180 to the left and 270 behind. Rounded to the nearest measured azimuth, which are between five and thirty degrees apart depending on the elevation.

directorypath, optional

Where the measurements are. Defaults to hrtf_dir().

Returns:
elevation, azimuthintegers

The direction actually measured, which is what the responses are for. Read them rather than assuming you got what you asked for.

left, rightndarray

512 samples each, at 44.1 kHz, scaled to [-1, 1).

Raises:
FileNotFoundError

If the measurements are not there. Run setup_hrtf().

ValueError

If the elevation is outside the measured range.

Parameters:
Return type:

tuple[int, int, NDArray[float64], NDArray[float64]]

See also

localize_hrtf

convolves a sound with the pair.

setup_hrtf

fetches the measurements.

available_azimuths

what was measured at an elevation.

Notes

The measurements are at a fixed distance of 1.4 metres, so they carry no distance cue: scale the result yourself for anything nearer or further.

Examples

>>> elevation, azimuth, left, right = hrir(0, 90)
>>> left.shape
(512,)