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

Add output argument to return the condition number of the RmmMtx from the obsFiltTD.m

parent 13015a2c
Branches
Tags
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
% Author: Achilles Kappis % Author: Achilles Kappis
% e-mail: axilleaz@protonmail.com % e-mail: axilleaz@protonmail.com
% %
% Date: 14/09/2024 (DD/MM/YYYY) % Date: 15/09/2024 (DD/MM/YYYY)
% %
% Copyright: MIT % Copyright: MIT
% -------------------------------------------------- % --------------------------------------------------
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
% RmmMtx [numeric]: This is the matrix with the cross-correlation matrices % RmmMtx [numeric]: This is the matrix with the cross-correlation matrices
% of the monitoring microphone signals stacked together. % of the monitoring microphone signals stacked together.
% The dimensions are TotFiltLenxTotFiltLenxJ. % The dimensions are TotFiltLenxTotFiltLenxJ.
%
% condNum [numeric]: The condition number of the monitoring microphone
% cross-correlation matrix "RmmMtx". This is a vector of
% length J, with each element corresponding to the
% condition number of the matrix for each trial/sound
% field realisation.
% %
% mMtx [numeric]: The monitoring microphone signals vectorised so that they % mMtx [numeric]: The monitoring microphone signals vectorised so that they
% can be used directly with either "Ovec" or "Oopt" % can be used directly with either "Ovec" or "Oopt"
...@@ -136,12 +142,12 @@ ...@@ -136,12 +142,12 @@
% Stephen J. Elliott and Jordan Cheer. % Stephen J. Elliott and Jordan Cheer.
% %
% -------------------------------------------------- % --------------------------------------------------
function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, mMtx, Omean, RmeMean, RmmMean, Oopt, RmeMtxMean, RmmMtxMean] = obsFiltTD(e, m, beta, filtLen, delay, fs) function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, condNum, mMtx, Omean, RmeMean, RmmMean, Oopt, RmeMtxMean, RmmMtxMean] = obsFiltTD(e, m, beta, filtLen, delay, fs)
% ==================================================== % ====================================================
% Check for number of arguments % Check for number of arguments
% ==================================================== % ====================================================
narginchk(2, 6); narginchk(2, 6);
nargoutchk(0, 13); nargoutchk(0, 14);
% ==================================================== % ====================================================
% Validate input arguments % Validate input arguments
...@@ -253,13 +259,20 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, mMtx, Omean, RmeMean, RmmMean, Oopt ...@@ -253,13 +259,20 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, mMtx, Omean, RmeMean, RmmMean, Oopt
% ==================================================== % ====================================================
% Provide additional output arguments % Provide additional output arguments
% ==================================================== % ====================================================
% The monitoring microphone signals vectorised per trial/sound field realisation % Condition number of RmmMtx for each trial/sound field realisation
if nargout > 6 if nargout > 6
for jIdx = size(RmmMtx, 3):-1:1
condNum(jIdx) = cond(Rmm(:, :, jIdx));
end
end
% The monitoring microphone signals vectorised per trial/sound field realisation
if nargout > 7
mMtx = reshape(m, prod(size(m, [1, 2])), size(m, 3)); mMtx = reshape(m, prod(size(m, [1, 2])), size(m, 3));
end end
% Observation filter calculated with the mean Rme and Rmm over the trials/sound field realisation % Observation filter calculated with the mean Rme and Rmm over the trials/sound field realisation
if nargout > 7 if nargout > 8
% Average the RmeMtx and RmmMtx matrices % Average the RmeMtx and RmmMtx matrices
RmeMtxMean = mean(RmeMtx, 3); RmeMtxMean = mean(RmeMtx, 3);
RmmMtxMean = mean(RmmMtx, 3); RmmMtxMean = mean(RmmMtx, 3);
...@@ -272,12 +285,12 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, mMtx, Omean, RmeMean, RmmMean, Oopt ...@@ -272,12 +285,12 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, mMtx, Omean, RmeMean, RmmMean, Oopt
end end
% Mean cross-correlations between monitoring and virtual microphones over trials/sound field realisations % Mean cross-correlations between monitoring and virtual microphones over trials/sound field realisations
if nargout > 8 if nargout > 9
RmeMean = mean(Rme, 4); RmeMean = mean(Rme, 4);
end end
% Mean cross-correlations of monitoring microphones over trials/sound field realisations % Mean cross-correlations of monitoring microphones over trials/sound field realisations
if nargout > 9 if nargout > 10
RmmMean = mean(Rmm, 5); RmmMean = mean(Rmm, 5);
end end
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