Commit fb4452ea authored by Ernesto Accolti's avatar Ernesto Accolti

Merge branch 'master' of https://git.rwth-aachen.de/ita/toolbox

parents 058c1848 5918c8ee
......@@ -229,7 +229,7 @@ classdef itaHRTF < itaAudio
function EarSide = get.EarSide(this)
EarSide = this.mEarSide;
if numel(this.mEarSide)~=this.dimensions
EarSide = repmat(['L'; 'R'],this.dirCoord.nPoints, 1);
EarSide = repmat(['L'; 'R'],this.nDirections, 1);
end
end
......@@ -969,8 +969,8 @@ classdef itaHRTF < itaAudio
pLeftFiltered = pLeft(usedBins, :);
pRightFiltered = pRight(usedBins, :);
pLeftIntegral = sum( abs(pLeftFiltered).^2 );
pRightIntegral = sum( abs(pRightFiltered).^2 );
pLeftIntegral = sum( abs(pLeftFiltered).^2, 1 );
pRightIntegral = sum( abs(pRightFiltered).^2, 1 );
ILD = 10*log10( pLeftIntegral ./ pRightIntegral );
......
......@@ -76,25 +76,32 @@ obj.repetitions = repetitions; % 18 repetitions
% this data is used to determine the exact measurement speed and the time
% points where the arc is at defined positions
dataMotor = data_raw.ch(options.ttChannel);
dataMotor.timeData = dataMotor.timeData*0.9;
motorTime = triggerTime(dataMotor);
dataMotor.timeData = reshape(dataMotor.timeData,length(dataMotor.timeData)/2,2);
dataMotor.timeData(:,2) = fliplr(dataMotor.timeData(:,2).' ).';
motorPoints = ita_start_IR(dataMotor);
[~,tmp] = max(dataMotor.timeData);
if any(abs(tmp - motorPoints) > 250)
disp('Something is wrong with the motorPoint detection');
disp('Using max values - Handle with care');
motorPoints = tmp;
%triggerTime only triggers on positive edge
if numel(motorTime) ~= 2
error('could not find two switch positions in motor data. please take a look')
end
motorTime = motorPoints/dataMotor.samplingRate;
% the second motor time gets one tracklength to correct for the cut in half
motorTime(2) = dataMotor.trackLength - motorTime(2);
motorTime(2) = motorTime(2) + dataMotor.trackLength;
% dataMotor.timeData = dataMotor.timeData*0.9;
%
% dataMotor.timeData = reshape(dataMotor.timeData,length(dataMotor.timeData)/2,2);
% dataMotor.timeData(:,2) = fliplr(dataMotor.timeData(:,2).' ).';
%
% motorPoints = ita_start_IR(dataMotor);
%
% [~,tmp] = max(dataMotor.timeData);
%
% if any(abs(tmp - motorPoints) > 250)
% disp('Something is wrong with the motorPoint detection');
% disp('Using max values - Handle with care');
% motorPoints = tmp;
% end
%
% motorTime = motorPoints/dataMotor.samplingRate;
% % the second motor time gets one tracklength to correct for the cut in half
% motorTime(2) = dataMotor.trackLength - motorTime(2);
% motorTime(2) = motorTime(2) + dataMotor.trackLength;
% get the first and last sweep repetition (globally)
exactStartAndEndRepetition = motorTime/options.twait/nOutputChannels;
......@@ -287,4 +294,15 @@ for index = 1:length(result)
end
end
end
\ No newline at end of file
end
function triggerTimeOut = triggerTime(dataMotor)
%% find location of first positive edge in motor data and avoid ringing!
% looks for positive peaks, taking the first one within a 1 secong
% with a magnitude > 0.95 max value in timeData - helps with bouncing
%plot peak locations for debug: peakfind(dataMotor)
[~,triggerTimeOut] = findpeaks(dataMotor.timeData,dataMotor.samplingRate,'MinPeakDistance',1,'MinPeakHeight',0.95*max(abs(dataMotor.timeData)));
end
......@@ -346,6 +346,8 @@ device(end+1,:) = { 'GRAS Mic 1/4 40BF SN113028','0.0035 V/Pa','none',1};
device(end+1,:) = { 'GRAS Mic 1/4 40BF SN141768','0.0033 V/Pa','none',1};
device(end+1,:) = { 'GRAS Mic 1/4 40BP SN20033','0.00158 V/Pa','none',1};
device(end+1,:) = { 'GRAS Mic 1/2 40HL SN192584','0.9373 V/Pa','none',1};
device(end+1,:) = { 'Laser Doppler Vibrometer','1 V s/m','vibrometer',0};
device(end+1,:) = { 'F8200 SN75','4.11e-3 V/N','force',1};
......
......@@ -636,7 +636,8 @@ classdef itaMSTFinterleaved < itaMSTF
% jri: changed default output behaviour to multi instance
% this is done to have a consistent behaviour with
% each use case of the class
timeData = reshape(data.timeData(1:nSamplesWait*this.repetitions*nOutputChannels, :) , nSamplesWait, data.nChannels*this.repetitions*nOutputChannels);
timeData = reshape(data.timeData(1:nSamplesWait*this.repetitions*nOutputChannels, :),...
nSamplesWait, data.nChannels*this.repetitions*nOutputChannels);
if (nOutputChannels > 1)
resultsMI = itaAudio(1,nOutputChannels);
for index = 1:nOutputChannels
......@@ -680,6 +681,7 @@ classdef itaMSTFinterleaved < itaMSTF
final_response = ita_extend_dat(final_response, data.nSamples, 'symmetric');
currentData = ita_divide_spk(data,final_response,'regularization', this.freqRange).';
else
%force time domain object
currentData = data.';
end
......
This diff is collapsed.
This diff is collapsed.
......@@ -65,7 +65,7 @@ function [output] = VA_generate_stubs()
code = [code sprintf('\t\t%%\n\n')];
% Matlab code that checks that a connection is established
code = [code sprintf('\t\tif this.handle==0, error(''Not connected.''); end;\n\n')];
code = [code sprintf('\t\tif this.handle==0, error(''Not connected.''); end\n\n')];
% Matlab code for default values in optional input parameters
for j=1:ninargs
......
......@@ -258,7 +258,6 @@ if ~isempty( current_natnet_dir )
end
function [ found, va_component_dir ] = find_VA_Component( va_search_dir, component, recursive )
found = false;
va_component_dir = '';
......
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