Skip to content
Snippets Groups Projects
Commit f5488901 authored by Achilles Kappis's avatar Achilles Kappis
Browse files

Fixed bug in input argument checks in ptSrcFieldTD.m

parent c73cc7eb
No related branches found
No related tags found
1 merge request!3Update to v0.2.3
......@@ -93,15 +93,16 @@ function [rSig, rSigMean, rSigMtx, rSigMtxMean, Q] = ptSrcFieldTD(sPos, rPos, fs
validateattributes(Q, "numeric", {'scalar', 'real', 'nonnan', 'nonempty', 'finite', 'positive', 'integer'}, mfilename, "Length of source signals in samples", 4);
else
validateattributes(Q, "numeric", {'3d', 'real', 'nonnan', 'nonempty', 'finite', 'ncols', size(sPos, 1)}, mfilename, "Source signals", 4);
nTrials = size(Q, 3);
end
else
Q = 128;
end
if nargin > 4 && ~isempty(nTrials) && isscalar(Q)
validateattributes(nTrials, "numeric", {'scalar', 'positive', 'nonnan', 'nonempty', 'finite'}, mfilename, "Number of trials/sound field realisations", 5);
elseif nargin > 4 && isempty(nTrials)
if ~isscalar(Q)
nTrials = size(Q, 3);
elseif nargin > 4 && ~isempty(nTrials) && isscalar(Q)
validateattributes(nTrials, "numeric", {'scalar', 'positive', 'nonnan', 'nonempty', 'finite'}, mfilename, "Number of trials/sound field realisations", 5);
else
nTrials = 1;
end
......@@ -130,7 +131,7 @@ function [rSig, rSigMean, rSigMtx, rSigMtxMean, Q] = ptSrcFieldTD(sPos, rPos, fs
% Calculate signals
% ====================================================
% Go through the trials/sound field realisations
for jIdx = size(Q, 3):-1:1
for jIdx = nTrials:-1:1
% Go through the sources (calculate for all receivers in one go)
for sIdx = size(dist, 1):-1:1
rSigMtx(:, :, sIdx, jIdx) = (1./dist(sIdx, :)) .* delayseq(Q(:, sIdx, jIdx), del(sIdx, :), fs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment