From bc876f99800eee575b6eed665944ed5536474055 Mon Sep 17 00:00:00 2001
From: ZaellixA <axilleaz@protonmail.com>
Date: Wed, 4 Sep 2024 18:37:08 +0100
Subject: [PATCH] Add check for corrrect dimension of Svv in obsFilt.m

---
 .../Remote Microphone Technique/MATLAB/Functions/obsFilt.m      | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFilt.m b/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFilt.m
index 2431f64..846e087 100644
--- a/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFilt.m	
+++ b/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFilt.m	
@@ -96,6 +96,8 @@ function [oOpt, Sme, Smm, condNum] = obsFilt(Pe, Pm, srcCsd, regFacs, snrVal)
         % 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));
-- 
GitLab