diff --git a/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFiltTd.m b/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFiltTd.m index aeb51e7376560da0eea1a07cb1765d3b2bec138c..b8744afab0b8d630a7104333b309ca109ed95119 100644 --- a/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFiltTd.m +++ b/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFiltTd.m @@ -3,7 +3,7 @@ % Author: Achilles Kappis % e-mail: axilleaz@protonmail.com % -% Date: 22/01/2025 (DD/MM/YYYY) +% Date: 26/02/2025 (DD/MM/YYYY) % % Copyright: MIT % -------------------------------------------------- @@ -214,7 +214,7 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, condNum, mMtx, Omean, RmeMean, RmmM if nargin > 6 && ~isempty(fs) validateattributes(fs, "numeric", {'scalar', 'integer', 'positive', 'nonnan', 'nonempty', 'finite', 'real'}, mfilename, "The sampling frequency", 7); else - fs = []; + fs = 1; end @@ -223,14 +223,8 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, condNum, mMtx, Omean, RmeMean, RmmM % ==================================================== % Delay the virtual microphone signals if sum(logical(delay)) - if isempty(fs) - for jIdx = size(e, 3):-1:1 - e(:, :, jIdx) = delayseq(e(:, :, jIdx), delay); - end - else - for jIdx = size(e, 3):-1:1 - e(:, :, jIdx) = delayseq(e(:, :, jIdx), delay, fs); - end + for jIdx = size(e, 3):-1:1 + e(:, :, jIdx) = delayseq(e(:, :, jIdx), delay, fs); end end @@ -244,7 +238,7 @@ function [O, Rme, Rmm, Ovec, RmeMtx, RmmMtx, condNum, mMtx, Omean, RmeMean, RmmM tmp = m(:, mIdx, jIdx); % 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); Rme(:, mIdx, eIdx, jIdx) = corr(filtLen + 1:-1:2);