diff --git a/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFiltEst.m b/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFiltEst.m index ae04ff955bfa2b4308dddc30437016c9ec68c04c..c01a20e1059bd01b620d7acdd8024d0fcaa357f4 100644 --- a/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFiltEst.m +++ b/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFiltEst.m @@ -3,7 +3,7 @@ % Author: Achilles Kappis % e-mail: axilleaz@protonmail.com % -% Date: 23/08/2024 (DD/MM/YYYY) +% Date: 04/09/2024 (DD/MM/YYYY) % % Copyright: MIT % -------------------------------------------------- @@ -83,7 +83,14 @@ function [est, err, errSqr, normErrSqr, See] = obsFiltEst(Pm, O, Pe, srcCsd) end if nargin > 3 && ~isempty(srcCsd) - validateattributes(srcCsd, "numeric", {'2d', 'nonnegative', 'nonnan', 'finite'}, mfilename, "Source cross spectral density matrix", 3) + validateattributes(srcCsd, "numeric", {'2d', 'nonnan', 'finite'}, mfilename, "Source cross spectral density matrix", 3) + + % Check for correct dimensions + if diff(size(srcCsd)) + error("The source power spectral density matrix must be a square matrix"); + elseif size(srcCsd, 1) ~= size(Pe, 1) + error("The number of rows of the source power spectral density matrix must be equal to the number of sources"); + end else srcCsd = eye(size(Pe, 2)); end