Commit a1de8c35 authored by Michael Kohnen's avatar Michael Kohnen

Revert "developing"

This reverts commit 561ad46c.
parent 561ad46c
......@@ -379,25 +379,12 @@ classdef itaHRTF < itaAudio
handleDaff = DAFFv17( 'open', daff_file_path );
props = DAFFv17( 'getProperties', handleDaff);
if ~sum(strcmpi(fieldnames(props),'filterLength'))
[data, oob] = DAFFv17('getNearestNeighbourRecord', handleDaff, 'data', 0, 0);
props.filterLength = size(data,2);
end
if ~sum(strcmpi(fieldnames(props),'numRecords'))
error('Number of records not found in properties!');
end
if ~sum(strcmpi(fieldnames(props),'numChannels'))
[data, oob] = DAFFv17('getNearestNeighbourRecord', handleDaff, 'data', 0, 0);
props.filterLength = size(data,1);
end
counter = 1;
data = zeros(props.filterLength,props.numRecords*props.numChannels,'double' ) ;
data = zeros(props.filterLength,props.numRecords*2,'double' ) ;
coordDaff = zeros(props.numRecords,2) ;
for iDir = 1:props.numRecords
data(:,counter:(counter+props.numChannels-1)) = DAFFv17( 'getRecordByIndex', handleDaff,iDir )';
data(:,[counter counter+1]) = DAFFv17( 'getRecordByIndex', handleDaff,iDir )';
coordDaff(iDir,:) = DAFFv17( 'getRecordCoords', handleDaff, 'data', iDir )';
counter= counter+2;
end
......@@ -450,7 +437,7 @@ classdef itaHRTF < itaAudio
%phiM = mod(coordDaff(:,1),360)*pi/180;
%if ~isempty(find(0<coordDaff(:,2),1,'first'))
thetaM = mod(180-(coordDaff(:,2)),180)*pi/180;
% thetaM = coordDaff(:,2)*pi/180;
% thetaM = coordDaff(:,2)*pi/180;
%else
% thetaM = coordDaff(:,2)*pi/180;
......@@ -459,10 +446,11 @@ classdef itaHRTF < itaAudio
chCoord = itaCoordinates;
chCoord.sph = ones(size(data,2),3);
for idxChan=1:props.numChannels
chCoord.phi(idxChan:2:2*props.numRecords) = phiM;
chCoord.theta(idxChan:2:2*props.numRecords) = thetaM;
end
chCoord.phi(1:2:2*props.numRecords) = phiM;
chCoord.phi(2:2:2*props.numRecords) = phiM;
chCoord.theta(1:2:2*props.numRecords) = thetaM;
chCoord.theta(2:2:2*props.numRecords) = thetaM;
this.mMetadata = metadata;
this.data = data;
......@@ -471,8 +459,8 @@ classdef itaHRTF < itaAudio
this.mEarSide = repmat(['L'; 'R'],props.numRecords, 1);
this.signalType = 'energy';
% channelnames coordinates
% this.channelNames = ita_sprintf('%s ( %1.0f, \\theta= %1.0f)',...
% this.mEarSide , this.channelCoordinates.theta_deg, this.channelCoordinates.phi_deg);
this.channelNames = ita_sprintf('%s ( %2.0f, \\theta= %2.0f)',...
this.mEarSide , this.channelCoordinates.theta_deg, this.channelCoordinates.phi_deg);
end
......@@ -1397,7 +1385,7 @@ classdef itaHRTF < itaAudio
idxfMax = find(this.freqVector>2e4,1,'first');
if isempty(idxfMax), idxfMax = this.nBins; end
fMax = thisCs.freqVector(idxfMax);
% [tick, lab] = ita_plottools_ticks('log');
% [tick, lab] = ita_plottools_ticks('log');
data_dB= thisCs.freqData_dB;
cMax = max(max(data_dB(2:idxfMax,:)));
......@@ -1419,7 +1407,7 @@ classdef itaHRTF < itaAudio
zlab = get(cb,'ylabel');
set(zlab,'String','Level in [dB]');
% set(ah,'xtick',tick,'xticklabel',lab)
% set(ah,'xtick',tick,'xticklabel',lab)
xlabel('Frequency in Hertz');xlim([thisCs.freqVector(2) fMax ]);
ylabel(strXlabel);
......
......@@ -56,11 +56,6 @@ else
[~,~,N2] = ita_loudness_timevariant(input2);
end
N1.value=sum(N1.value);
N2.value=sum(N2.value);
currentAmp = 0;
% start with stepsize of 10 dB
......@@ -77,6 +72,7 @@ whileCounter = 0;
whileLimit = sArgs.whileLimit;
while (abs(N1.value-N2.value) / N1.value > errorThreshold)
if lastStatus ~= ( N1.value > N2.value) % if status change => decrease and invert stepsize
ampStep = ampStep / -10;
lastStatus = N1.value > N2.value;
......@@ -90,8 +86,6 @@ while (abs(N1.value-N2.value) / N1.value > errorThreshold)
[~,~,N2] = ita_loudness_timevariant(ita_amplify(input2, currentAmp, 'dB'));
end
N2.value=sum(N2.value);
ita_verbose_info( sprintf('CurrentAmp: %2.2f -- Error: %2.2f\n', currentAmp, abs(N1.value-N2.value) / N1.value),2);
whileCounter = whileCounter +1;
......
......@@ -40,7 +40,7 @@ if (H.nChannels<4)
end
if ~strcmpi(H.signalType,'energy')
warning('HRTFs are not energy signals! Changing them to energy...');
warning('HRTFs are not energy signals! Changing them to energy');
H.signalType='energy';
end
opts=ita_parse_arguments(opts,varargin(2:end));
......
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