Commit 5a09f968 authored by Hark Braren's avatar Hark Braren

updates to continous HRTF post-processing

parent 8d1642ae
......@@ -115,6 +115,7 @@ options.repetitions = diff(firstAndLastNeededRepetition);
% to crop, a new measurement setup is created
obj = itaMSTFinterleaved;
obj.samplingRate = data.samplingRate;
obj.inputChannels = 1:3;
obj.outputChannels = 1:nOutputChannels;
obj.repetitions = repetitions;
......@@ -260,7 +261,9 @@ end
% calculate ITD and shift to 0 -- search for "ITD == 0"
[centerPoint,itdData] = ita_HRTFarc_pp_itdInterpolate(results_split,fullCoords,options);
if itdData.error > 0.01
disp('warning: itd match does not look good. something is wrong in either the data, or the itd method');
disp('warning: ITD match does not look good. something is wrong in either the data, or the ITD method');
figure;
plot(itdData.xData,itdData.data)
end
options.itdCenterCorrection = centerPoint;
fullCoords.phi_deg = fullCoords.phi_deg -centerPoint;
......@@ -303,6 +306,6 @@ function triggerTimeOut = triggerTime(dataMotor)
%plot peak locations for debug: peakfind(dataMotor)
[~,triggerTimeOut] = findpeaks(dataMotor.timeData,dataMotor.samplingRate,'MinPeakDistance',1,'MinPeakHeight',0.95*max(abs(dataMotor.timeData)));
[~,triggerTimeOut] = findpeaks(abs(dataMotor.timeData),dataMotor.samplingRate,'MinPeakDistance',1,'MinPeakHeight',0.75*max(abs(dataMotor.timeData)));
end
......@@ -24,14 +24,15 @@ function [results,shift,shCoeffs,epsilon] = ita_HRTFarc_pp_process_spherical(dat
n = ita_sph_linear2degreeorder(1:nSH).';
D = I .* diag(1 + n.*(n+1));
shCoeffs = complex(nan(nSH,data.nBins));
% wb = itaWaitbar(length(data.freqVector),'SH Transformation');
wb = itaWaitbar(length(data.freqVector),'SH Transformation');
tmpFreq = data.freqVector;
tmpFreqData = data.freqData;
newPhiData = 0:360/(options.repetitions+1):359;
for index = 1:length(tmpFreq)
wb.inc;
tmpCoords = fullCoords;
tmpOptions = options;
% tmpData = data;
......@@ -79,7 +80,7 @@ function [results,shift,shCoeffs,epsilon] = ita_HRTFarc_pp_process_spherical(dat
shCoeffs(:,index) = nominator\ denominatorMatrix * freqData.';
end
wb.delete
%% reconstruction
if isempty(options.reconstructSampling)
newSampling = ita_sph_sampling_equiangular(37,72,'theta_type','[]');
......
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