From cbb81fe89a2bf38559b73f9f73dd9847e43837e8 Mon Sep 17 00:00:00 2001
From: ZaellixA <axilleaz@protonmail.com>
Date: Wed, 4 Sep 2024 18:39:58 +0100
Subject: [PATCH] Changed variable name of srcCsd to Svv in obsFilt.m

---
 .../MATLAB/Functions/obsFilt.m                | 22 +++++++++----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFilt.m b/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFilt.m
index 846e087..a36d8f4 100644
--- a/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFilt.m	
+++ b/Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFilt.m	
@@ -22,10 +22,10 @@
 %               where K is the number of monitoring microphones and M is
 %               the number of sources.
 %
-% srcCsd [numeric] (Optional): The source cross spectral density matrix.
-%                              This must be a square (MxM) symmetric matrix
-%                              with the cross power spectral density of the
-%                              sources. [Default: eye(M)]
+% Svv [numeric] (Optional): The source cross spectral density matrix. This
+%                           must be a square (MxM) symmetric matrix with
+%                           the cross power spectral density of the
+%                           sources. [Default: eye(M)]
 % 
 % regFacs [numeric] (Optional): The regularisation factors used for the
 %                               inversion of the cross-spectra of the
@@ -75,7 +75,7 @@
 %   for local active sound control" by W. Jung, S. J. Elliott and J. Cheer.
 % 
 % --------------------------------------------------
-function [oOpt, Sme, Smm, condNum] = obsFilt(Pe, Pm, srcCsd, regFacs, snrVal)
+function [oOpt, Sme, Smm, condNum] = obsFilt(Pe, Pm, Svv, regFacs, snrVal)
     % ====================================================
     % Check for number of arguments
     % ====================================================
@@ -90,17 +90,17 @@ function [oOpt, Sme, Smm, condNum] = obsFilt(Pe, Pm, srcCsd, regFacs, snrVal)
     validateattributes(Pm, "numeric", {'nonnan', 'nonempty', 'finite'}, mfilename, "Monitoring microphone pressure", 2);
 
     % Validate optional arguments
-    if nargin > 2 && ~isempty(srcCsd)
-        validateattributes(srcCsd, "numeric", {'2d', 'nonnan', 'finite'}, mfilename, "Source cross spectral density matrix", 3)
+    if nargin > 2 && ~isempty(Svv)
+        validateattributes(Svv, "numeric", {'2d', 'nonnan', 'finite'}, mfilename, "Source cross spectral density matrix", 3)
 
         % Check for correct dimensions
-        if diff(size(srcCsd))
+        if diff(size(Svv))
             error("The source power spectral density matrix must be a square matrix");
-        elseif size(srcCsd, 1) ~= size(Pe, 1)
+        elseif size(Svv, 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));
+        Svv = eye(size(Pe, 2));
     end
 
     if nargin > 3 && ~isempty(regFacs)
@@ -134,7 +134,7 @@ function [oOpt, Sme, Smm, condNum] = obsFilt(Pe, Pm, srcCsd, regFacs, snrVal)
     % Calculate optimal filters
     % ====================================================
     % Calculate needed quantities
-    tmpVal = srcCsd * Pm';
+    tmpVal = Svv * Pm';
     
     Sme = Pe * tmpVal; % Virtual-Monitor mics cross-spectra
     Smm = Pm * tmpVal; % Monitor-Monitor mics cross-spectra
-- 
GitLab