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

Change the order of the output arguments to avoid copies when just the max delay is needed

parent 78854854
No related branches found
No related tags found
1 merge request!10Update 3D rotations function interface
......@@ -68,13 +68,13 @@
% mass of the array. M is the number of sensors and N is the
% number of directions.
%
% maxDel [numeric]: The maximum delay from the centre of mass to the
% sensors.
%
% amMtx [numeric]: This is an LMxKxN array, where LM is equal to L * M.
% This corresponds to the vectorised version of "am" with
% the "am" of each sensor stacked under each other.
%
% maxDel [numeric]: The maximum delay from the centre of mass to the
% sensors.
%
% --------------------------------------------------
% Notes
%
......@@ -92,7 +92,7 @@
% - Dependencies: * winSincFracDel() to calculate the fractional delay
% filters.
% --------------------------------------------------
function [am, amMtx, maxDel] = arrManTD(mPos, dirs, nRows, delLen, delWin, fs, c)
function [am, maxDel, amMtx] = arrManTD(mPos, dirs, nRows, delLen, delWin, fs, c)
% ====================================================
% Check for number of arguments
% ====================================================
......@@ -171,10 +171,10 @@ function [am, amMtx, maxDel] = arrManTD(mPos, dirs, nRows, delLen, delWin, fs, c
% Return additional output arguments
% =============================================
if nargout > 1
amMtx = reshape(permute(am, [1, 3, 2, 4]), [], size(am, 2), size(am, 4));
maxDel = ceil(maxDel);
end
if nargout > 2
maxDel = ceil(maxDel);
amMtx = reshape(permute(am, [1, 3, 2, 4]), [], size(am, 2), size(am, 4));
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment