Commit 7c35b97b authored by Jan-Gerrit Richter's avatar Jan-Gerrit Richter

small speed improvement during daff creation

parent 752e1787
...@@ -662,6 +662,10 @@ classdef itaHRTF < itaAudio ...@@ -662,6 +662,10 @@ classdef itaHRTF < itaAudio
%HRTFout = this.direction(idxCoord); %HRTFout = this.direction(idxCoord);
end end
function this = buildsearchdatabase(this)
this.dirCoord = this.dirCoord.build_search_database;
end
function obj = direction(this, idxCoord) function obj = direction(this, idxCoord)
idxDir = zeros(numel(idxCoord)*2,1); idxDir = zeros(numel(idxCoord)*2,1);
idxDir(1:2:numel(idxCoord)*2,:) = 2*idxCoord-1; idxDir(1:2:numel(idxCoord)*2,:) = 2*idxCoord-1;
......
...@@ -414,6 +414,7 @@ function [] = daffv17_write( varargin ) ...@@ -414,6 +414,7 @@ function [] = daffv17_write( varargin )
% note: use round here to avoid errors if alphapoints are not exactly % note: use round here to avoid errors if alphapoints are not exactly
% integers but within epsilon % integers but within epsilon
x = cell( round( args.alphapoints ), round( args.betapoints ), args.channels ); x = cell( round( args.alphapoints ), round( args.betapoints ), args.channels );
args.userdata = args.userdata.buildsearchdatabase;
for b=1:args.betapoints for b=1:args.betapoints
beta = betastart + (b-1)*args.betares; beta = betastart + (b-1)*args.betares;
...@@ -422,13 +423,11 @@ function [] = daffv17_write( varargin ) ...@@ -422,13 +423,11 @@ function [] = daffv17_write( varargin )
points = 1; points = 1;
else else
points = args.alphapoints; points = args.alphapoints;
end end
for a=1:points for a=1:points
alpha = alphastart + (a-1)*args.alphares; alpha = alphastart + (a-1)*args.alphares;
% --= Impulse responses =-- % --= Impulse responses =--
if strcmp( args.content, 'IR' ) if strcmp( args.content, 'IR' )
% Get the data % Get the data
[ data, samplerate, metadata ] = args.datafunc( alpha, beta, args.userdata ); [ data, samplerate, metadata ] = args.datafunc( alpha, beta, args.userdata );
......
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