THE AUDITORY MODELING TOOLBOX

Applies to version: 0.9.5

View the code

Go to function

ENZNER2008 - Calculate HRIR set

Usage

[hrir_data,hrir_angles,fs] = enzner2008(mu,delta_phi,...)

Description

Required data: hrtf/enzner2008

Input parameters

'',mu NLMS stepzize, e.g., 0.75 or 1
'',delta_phi azimuthal resolution (delta_phi) in degree to store hrir,e.g., 0.1 or 1

System Message: WARNING/2 (<string>, line 26)

Option list ends without a blank line; unexpected unindent.

'=varargin (not necessary, '= function will also run without)''

'fig2': plot figure like [Enzner2008, Fig.2] 'fig4_enzner2009': plot figure like [Enzner2009, Fig.4]

Output parameters

'',hrir_data sampled HRIR data at arbitrary azimuth-resolution delta_phi
'',hrir_angles vector with azimuthal angles corresponding to the azimuthal index of hrir_data
'',fs sampling rate of the used binaural ear signal recording

enzner2008 calculates a set of HRIRs using the normalized LMS-algorithm. A test signal in mono, e.g., white noise, perfect sweeps, or a reference recording at the position in the middle of the listeners head is used as the input of the algorithm, whereas the other input of the algorithm is given by the corresponding spatially-continuous (i.e., dynamical) binaural recording.

This recording contains the measured ear signals along the trajectory of interest, e.g., the horizontal plane, plus some symmetric overhead. The overhead is used to ensure capturing of all data of interest, to give the algorithm a scope to adapt and to be able to shift the signals against each other to ensure causality (see sys_latency). The binaural recording of the ear signals has to begin/end at the rear of the subject. Thus the first recorded sample number subsequent to the required overhead (see adapt) corresponds to an azimuth of phi = 180° (rear).

From a given set of example files, the HRIR data will be calculated. Per default the measured ear signals (stimulus: white noise) and the corresponding reference recording will be used for the computation. If you want to use the loudspeaker driving signals or a perfect sweep data set, please uncomment only the case of interest in the section "changeable parameters" in lines 74-104. In this section you can also adjust the used filter length.

The computation is performed continuously for each sample, in compliance with a continuous-azimuth HRIR representation. The storage of the HRIR data is sampled with an arbitrary azimuth-spacing delta_phi. The HRIR data will be written into the array hrir_data.

Structure of hrir_data:
hrir_data(filter coefficients, left/right, no. of channels, azimuthal index)

filter coefficients: see h_length left/right: 1 = left, 2 = right no. of channels: allways 1 (single channel NLMS-algorithm) azimuthal index: corresponding to an azimuth phi

System Message: ERROR/3 (<string>, line 79)

Unexpected indentation.
Note: The rotational direction during the recording of the ear signals is counterclockwise! (1 = -180 °, 2 = -180 ° + delta_phi, end = 180 ° - delta_phi )

Changeable parameters (See the section "Changeable parameters" in the code:

h_length = filter length in samples, e.g., 256 (or 308 for single channel perfect sweeps)

Adjust only if using own mwasurements: rec_filename = recorded ear signals as WAV-file (stereo) ref_filename = reference WAV-file (mono), e.g., reference recording or

System Message: ERROR/3 (<string>, line 93)

Unexpected indentation.
playback (white noise, perfect sweeps,...)

System Message: WARNING/2 (<string>, line 94)

Block quote ends without a blank line; unexpected unindent.
adapt = No. of symmetrically overlapping samples of the recorded ear signals
arround phi = 180 °, used as adaptation buffer before HRIR data will be stored, also used to shift the algorithm's input signals to enshure causality, e.g, adapt = 20000 for the given examples
sys_latency = system latency, No. of samples to shift input signals against
each other (ensure causality), e.g. 30, if using a reference recording or -290, if using loudspeaker driving signals whereupon the loudspeaker distance is approx. 2 m (fs = 44100)