Adding support for HATO and OTAH reference concepts for FABIAN

parent 5f6303ba
......@@ -3,24 +3,40 @@ function [ data, samplerate, metadata ] = dfAKtools( alpha, beta, config )
% Retrieves data from FABIAN via AKtools using AKhrirInterpolation
% routine for azimuth, elevation and head-above-torso orientation
% First two channels are always neutral hato position (for backwards
% compatibility)
% Align channels
% First two channels are always neutral hato position (for backwards compatibility)
% Define range angle vector with neutral direction as first entry
assert( config.hatorange( 1 ) <= 0 && config.hatorange( 2 ) >= 0 )
hato_negative_range = config.hatorange( 1 ):config.hatores:-config.hatores;
hato_positive_range = config.hatores:config.hatores:config.hatorange( 2 );
hato = [ 0 hato_negative_range hato_positive_range ];
data = zeros( config.numchannels, config.numsamples );
for n = 1:(config.numchannels/2)
% Assemble data
if isfield( config, 'reference' ) && strcmpi( config.reference, 'head' )
[ l, r ] = AKhrirInterpolation( alpha + hato( n ), beta - 90, hato( n ) );
% head rotates against torso (HATO) [default]
data = zeros( config.numchannels, config.numsamples );
for n = 1:(config.numchannels/2)
[ l, r ] = AKhrirInterpolation( alpha + hato( n ), beta - 90, hato( n ) );
% Interleave for DAFF (odd = left, even = right)
data( 2*n-1, : ) = l';
data( 2*n, : ) = r';
end
else
% torso rotates against head (OTAH)
[ l, r ] = AKhrirInterpolation( alpha, beta - 90, hato );
l = l';
r = r';
% Interleave for DAFF (odd = left, even = right)
data( 2*n-1, : ) = l';
data( 2*n, : ) = r';
data = reshape( [ l(:) r(:) ]', 2 * size( l, 1 ), [] );
end
samplerate = config.samplerate;
......
......@@ -12,6 +12,8 @@ export_properties.betares = 5;
export_properties.betarange = [0 180];
export_properties.hatores = 5;
export_properties.hatorange = [-50 50];
export_properties.reference = 'torso'; % the head-above-torso angle rotates the head above torso [default FABIAN reference]
%% Set up metadata
additional_metadata = daffv17_add_metadata( [], 'hato', 'BOOL', true );
......@@ -22,5 +24,11 @@ additional_metadata = daffv17_add_metadata( additional_metadata, 'AKtools_resour
additional_metadata = daffv17_add_metadata( additional_metadata, 'FABIAN_resource', 'STRING', 'http://dx.doi.org/10.14279/depositonce-5718.2' );
additional_metadata = daffv17_add_metadata( additional_metadata, 'FABIAN_license', 'STRING', 'Creative Commons BY-NC-SA 4.0' );
%% Export
daffv17_convert_from_aktools( 'FABIAN_HATO_5x5x5_256_44100Hz.v17.ir.daff', export_properties, additional_metadata )
%% Export untouched
additional_metadata_untouched = daffv17_add_metadata( additional_metadata, 'reference', 'STRING', export_properties.reference );
daffv17_convert_from_aktools( 'FABIAN_HATO_5x5x5_256_44100Hz.v17.ir.daff', export_properties, additional_metadata_untouched )
%% Export for VA with head as reference frame
export_properties.reference = 'head'; % the head-above-torso angle rotates torso not head (for Virtual Acoustics)
additional_metadata_va = daffv17_add_metadata( additional_metadata, 'reference', 'STRING', export_properties.reference );
daffv17_convert_from_aktools( 'FABIAN_OTAH_5x5x5_256_44100Hz.v17.ir.daff', export_properties, additional_metadata_va )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment