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

Add checks for the dimensions of Svv in obsFiltEst.m

parent bc876f99
No related branches found
No related tags found
1 merge request!2Update the MATLAB implementation of the optimal frequency domain observation filter
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment