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

Revert to serial for-loops and set Fs to 1 to simplify delay for-loop execution in obsFiltTd.m

parent c1be34eb
No related branches found
No related tags found
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: 22/01/2025 (DD/MM/YYYY) % Date: 26/02/2025 (DD/MM/YYYY)
% %
% Copyright: MIT % Copyright: MIT
% -------------------------------------------------- % --------------------------------------------------
...@@ -214,7 +214,7 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, condNum, mMtx, Omean, RmeMean, RmmM ...@@ -214,7 +214,7 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, condNum, mMtx, Omean, RmeMean, RmmM
if nargin > 6 && ~isempty(fs) if nargin > 6 && ~isempty(fs)
validateattributes(fs, "numeric", {'scalar', 'integer', 'positive', 'nonnan', 'nonempty', 'finite', 'real'}, mfilename, "The sampling frequency", 7); validateattributes(fs, "numeric", {'scalar', 'integer', 'positive', 'nonnan', 'nonempty', 'finite', 'real'}, mfilename, "The sampling frequency", 7);
else else
fs = []; fs = 1;
end end
...@@ -223,14 +223,8 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, condNum, mMtx, Omean, RmeMean, RmmM ...@@ -223,14 +223,8 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, condNum, mMtx, Omean, RmeMean, RmmM
% ==================================================== % ====================================================
% Delay the virtual microphone signals % Delay the virtual microphone signals
if sum(logical(delay)) if sum(logical(delay))
if isempty(fs) for jIdx = size(e, 3):-1:1
for jIdx = size(e, 3):-1:1 e(:, :, jIdx) = delayseq(e(:, :, jIdx), delay, fs);
e(:, :, jIdx) = delayseq(e(:, :, jIdx), delay);
end
else
for jIdx = size(e, 3):-1:1
e(:, :, jIdx) = delayseq(e(:, :, jIdx), delay, fs);
end
end end
end end
...@@ -244,7 +238,7 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, condNum, mMtx, Omean, RmeMean, RmmM ...@@ -244,7 +238,7 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, condNum, mMtx, Omean, RmeMean, RmmM
tmp = m(:, mIdx, jIdx); tmp = m(:, mIdx, jIdx);
% Calculate the cross-correlations between virtual and monitoring microphones % Calculate the cross-correlations between virtual and monitoring microphones
parfor eIdx = 1:size(e, 2) for eIdx = 1:size(e, 2)
corr = xcorr(tmp, e(:, eIdx, jIdx), filtLen); corr = xcorr(tmp, e(:, eIdx, jIdx), filtLen);
Rme(:, mIdx, eIdx, jIdx) = corr(filtLen + 1:-1:2); Rme(:, mIdx, eIdx, jIdx) = corr(filtLen + 1:-1:2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment