Commit 458eec75 authored by Jonas Stienen's avatar Jonas Stienen
Browse files

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

parents 618f72b2 37c61750
...@@ -137,12 +137,13 @@ for idxRun = 1:sArgs.nRuns ...@@ -137,12 +137,13 @@ for idxRun = 1:sArgs.nRuns
equalizationRadSource = 2; equalizationRadSource = 2;
% room transfer function (free field assumption at this point) % room transfer function (free field assumption at this point)
Psi = sph_transfer_path(posReceiver,receiverNmax,posSource,sourceNmax,kVec,... Psi = sph_transfer_path(posReceiver,receiverNmaxAlias,posSource,sourceNmaxAlias,kVec,...
'r',distSourceReceiver,'r_eq',equalizationRadSource,'norm',false);
PsiAliasReceiver = sph_transfer_path(posReceiver,receiverNmaxAlias,posSource,sourceNmax,kVec,...
'r',distSourceReceiver,'r_eq',equalizationRadSource,'norm',false);
PsiAliasSource = sph_transfer_path(posReceiver,receiverNmax,posSource,sourceNmaxAlias,kVec,...
'r',distSourceReceiver,'r_eq',equalizationRadSource,'norm',false); 'r',distSourceReceiver,'r_eq',equalizationRadSource,'norm',false);
PsiAliasReceiver = Psi(1:(receiverNmaxAlias+1)^2,1:(sourceNmax+1)^2,:);
PsiAliasSource = Psi(1:(receiverNmax+1)^2,1:(sourceNmaxAlias+1)^2,:);
Psi = Psi(1:(receiverNmax+1)^2,1:(sourceNmax+1)^2,:);
if ~isempty(samplingDisplacement) && isempty(SNR) if ~isempty(samplingDisplacement) && isempty(SNR)
% rest happens inside loop, only here in case of an error % rest happens inside loop, only here in case of an error
...@@ -178,7 +179,7 @@ for idxRun = 1:sArgs.nRuns ...@@ -178,7 +179,7 @@ for idxRun = 1:sArgs.nRuns
if isempty(dirMeasurementFile) if isempty(dirMeasurementFile)
sourceBalias = ita_sph_modal_strength(sourceSampling,sourceNmaxAlias,kVec(idxFreq),'rigid','transducer','ls'); sourceBalias = ita_sph_modal_strength(sourceSampling,sourceNmaxAlias,kVec(idxFreq),'rigid','transducer','ls');
sourceB = sourceBalias(1:(sourceNmax+1)^2,1:(sourceNmax+1)^2); sourceB = sourceBalias(1:(sourceNmax+1)^2,1:(sourceNmax+1)^2);
if numel(unique(sourceSampling.r)) == 1; if numel(unique(sourceSampling.r)) == 1
Msource = sourceB * (sourceG.'.*sourceY'); Msource = sourceB * (sourceG.'.*sourceY');
else else
Msource = sourceB .* (sourceG.'.*sourceY'); Msource = sourceB .* (sourceG.'.*sourceY');
...@@ -237,7 +238,7 @@ for idxRun = 1:sArgs.nRuns ...@@ -237,7 +238,7 @@ for idxRun = 1:sArgs.nRuns
% alias error needed here since antialias bf needs them and parfor % alias error needed here since antialias bf needs them and parfor
% requires the variables to be initialized % requires the variables to be initialized
if simSMA if simSMA
if numel(unique(receiverSampling.r)) == 1; if numel(unique(receiverSampling.r)) == 1
EreceiverAlias = receiverYalias*receiverBalias; EreceiverAlias = receiverYalias*receiverBalias;
else else
EreceiverAlias = receiverYalias.*receiverBalias; EreceiverAlias = receiverYalias.*receiverBalias;
...@@ -542,7 +543,7 @@ data = fft(data); ...@@ -542,7 +543,7 @@ data = fft(data);
if isEven if isEven
data = data(1:(nSamples+2)/2,:,:); data = data(1:(nSamples+2)/2,:,:);
else else
display('MBE_FFT:: Be careful with odd numbers of time samples!'); disp('MBE_FFT:: Be careful with odd numbers of time samples!');
data = data(1:(nSamples+1)/2,:,:); data = data(1:(nSamples+1)/2,:,:);
end end
...@@ -558,4 +559,4 @@ if strcmp(signalType,'power') ...@@ -558,4 +559,4 @@ if strcmp(signalType,'power')
end end
end end
end end
\ No newline at end of file
...@@ -18,15 +18,10 @@ nSH = (nmax+1).^2; ...@@ -18,15 +18,10 @@ nSH = (nmax+1).^2;
filename = ['/Womersley/md' num2str(nmax,'%02d') '.' num2str(nSH,'%04d')]; filename = ['/Womersley/md' num2str(nmax,'%02d') '.' num2str(nSH,'%04d')];
% filepath = '~/MATLAB/Griddata'; url = 'http://www.ita-toolbox.org/Griddata';
% if ~exist(filepath,'dir') hyper = str2num(urlread([url filename])); %#ok<ST2NM>
% error(['Griddata folder missing: ' filepath])
url = 'http://www.ita-toolbox.org/Griddata';
hyper = str2num(urlread([url filename])); %#ok<ST2NM>
% else
% hyper = load([filepath filename]);
% end
s = itaSamplingSph(hyper(:,1:3),'cart'); s = itaSamplingSph(hyper(:,1:3),'cart');
s.r = ones(s.nPoints,1);
s.weights = hyper(:,4); s.weights = hyper(:,4);
s.nmax = nmax; s.nmax = nmax;
...@@ -115,7 +115,7 @@ for idx = 1:length(field_token) ...@@ -115,7 +115,7 @@ for idx = 1:length(field_token)
token = field_token{idx}; token = field_token{idx};
if numel(token) >= 5 % RSC - support for arguments shorter than 5 elements if numel(token) >= 5 % RSC - support for arguments shorter than 5 elements
if strcmpi(token(1:3),'pos') && strcmpi(token(5),'_') if strcmpi(token(1:3),'pos') && strcmpi(token(5),'_')
pos_num = str2double(token(4)); %this is the fixed position number in the argument list pos_num = sscanf(token(4),'%d'); %this is the fixed position number in the argument list
token_new = token(6:end); %get rid off prefix token_new = token(6:end); %get rid off prefix
if pos_num <= numel(Arguments) % rsc - check if enough arguments are given if pos_num <= numel(Arguments) % rsc - check if enough arguments are given
value = Arguments{pos_num}; %get value/object value = Arguments{pos_num}; %get value/object
......
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