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

Fix bug in obsFilt.m to allow for negative values in the source strength PSD...

Fix bug in obsFilt.m to allow for negative values in the source strength PSD matrix so that complex numbers can be used
parent b0271353
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 @@ ...@@ -3,7 +3,7 @@
% Author: Achilles Kappis % Author: Achilles Kappis
% e-mail: axilleaz@protonmail.com % e-mail: axilleaz@protonmail.com
% %
% Date: 01/09/2024 (DD/MM/YYYY) % Date: 04/09/2024 (DD/MM/YYYY)
% %
% Copyright: MIT % Copyright: MIT
% -------------------------------------------------- % --------------------------------------------------
...@@ -91,7 +91,12 @@ function [oOpt, Sme, Smm, condNum] = obsFilt(Pe, Pm, srcCsd, regFacs, snrVal) ...@@ -91,7 +91,12 @@ function [oOpt, Sme, Smm, condNum] = obsFilt(Pe, Pm, srcCsd, regFacs, snrVal)
% Validate optional arguments % Validate optional arguments
if nargin > 2 && ~isempty(srcCsd) if nargin > 2 && ~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");
end
else else
srcCsd = eye(size(Pe, 2)); srcCsd = eye(size(Pe, 2));
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment