Aufgrund einer Wartung wird GitLab am 04.06. zwischen 8:00 und 10:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 04.06. between 8:00 and 10:00 am.

Commit 0f11afd4 authored by Jan-Gerrit Richter's avatar Jan-Gerrit Richter

changes to itd: ignore phase at dc

parent de092f03
......@@ -714,7 +714,7 @@ classdef itaHRTF < itaAudio
earCoords = this.getEar('L').channelCoordinates;
switch dirID
case {'phi_deg', 'p'}
phiValues = unique(earCoords.phi_deg);
phiValues = uniquetol(earCoords.phi_deg);
[~,index] = min(abs(phiValues - dir_deg));
exactPhiValue = phiValues(index);
tmp = earCoords.n(earCoords.phi_deg == exactPhiValue);
......@@ -722,7 +722,7 @@ classdef itaHRTF < itaAudio
slice = this.findnearestHRTF(thetaU,dir_deg);
case {'theta_deg', 't'}
thetaValues = unique(earCoords.theta_deg);
thetaValues = uniquetol(earCoords.theta_deg);
[~,index] = min(abs(thetaValues - dir_deg));
exactThetaValue = thetaValues(index);
tmp = earCoords.n(earCoords.theta_deg == exactThetaValue);
......@@ -731,12 +731,12 @@ classdef itaHRTF < itaAudio
slice = this.findnearestHRTF(dir_deg,phiU);
end
end
switch dirID
case {'phi_deg', 'p'}
slice = this.findnearestHRTF(thetaU,dir_deg);
case {'theta_deg', 't'}
slice = this.findnearestHRTF(dir_deg,phiU);
end
% switch dirID
% case {'phi_deg', 'p'}
% slice = this.findnearestHRTF(thetaU,dir_deg);
% case {'theta_deg', 't'}
% slice = this.findnearestHRTF(dir_deg,phiU);
% end
end
function slice = ss(this,dirID,dir_deg)
......@@ -915,10 +915,12 @@ classdef itaHRTF < itaAudio
ITD = phasenDiff./(2*pi*repmat(thisC.freqVector,1,size(phase1,2)));
else % averaged
phase = unwrap(angle(thisC.freqData));
t0_freq = bsxfun(@rdivide, phase,2*pi*thisC.freqVector);
usedBins = thisC.freq2index(sArgs.filter(1)):thisC.freq2index(sArgs.filter(2));
phase = unwrap(angle(thisC.freqData(2:end,:)));
freqVector = thisC.freqVector;
t0_freq = bsxfun(@rdivide, phase,2*pi*freqVector(2:end));
t0_freq = t0_freq(~isnan(t0_freq(:,1)),:);
t0_mean = mean(t0_freq(unique(thisC.freq2index(sArgs.filter(1)):thisC.freq2index(sArgs.filter(2))),:)); %mean is smoother than max; lower freq smooths also the result
t0_mean = mean(t0_freq(usedBins,:)); %mean is smoother than max; lower freq smooths also the result
ITD = t0_mean(thisC.EarSide == 'L') - t0_mean(thisC.EarSide == 'R');
end
case 'xcorr'
......
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