Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Virtual Sensing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPAH
IN-NOVA
Virtual Sensing
Commits
4569538f
Commit
4569538f
authored
3 months ago
by
Achilles Kappis
Browse files
Options
Downloads
Patches
Plain Diff
Update obsFilt function to allow a matrix of regularisation factors to be provided
parent
69d9f516
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFilt.m
+14
-7
14 additions, 7 deletions
...ng/Remote Microphone Technique/MATLAB/Functions/obsFilt.m
with
14 additions
and
7 deletions
Virtual Sensing/Remote Microphone Technique/MATLAB/Functions/obsFilt.m
+
14
−
7
View file @
4569538f
...
...
@@ -3,7 +3,7 @@
% Author: Achilles Kappis
% e-mail: axilleaz@protonmail.com
%
% Date: 1
3
/02/2025 (DD/MM/YYYY)
% Date: 1
4
/02/2025 (DD/MM/YYYY)
%
% Copyright: MIT
% --------------------------------------------------
...
...
@@ -31,9 +31,10 @@
% inversion of the cross-spectra of the
% monitoring microphones. Can be a vector
% with number of elements equal to K (number
% of monitoring microphones)
or
a scalar
% of monitoring microphones)
,
a scalar
% which will result in the same
% regularisation factor for all microphones.
% regularisation factor for all microphones,
% or a square matrix with dimensions KxK.
% [Default: 0]
%
% snrVal [numeric] (Optional): This is the Root-Mean-Square (RMS)
...
...
@@ -105,11 +106,15 @@ function [oOpt, Sme, Smm, condNum] = obsFilt(Pe, Pm, Svv, regFacs, snrVal)
end
if
nargin
>
3
&&
~
isempty
(
regFacs
)
validateattributes
(
regFacs
,
"numeric"
,
{
'
vector'
,
'nonnegative
'
,
'nonnan'
,
'nonempty'
,
'finite'
},
mfilename
,
"Regularisation factors"
,
4
);
validateattributes
(
regFacs
,
"numeric"
,
{
'
2d
'
,
'nonnan'
,
'nonempty'
,
'finite'
},
mfilename
,
"Regularisation factors"
,
4
);
% Make sure regFacs has correct dimensions
if
~
isscalar
(
regFacs
)
&&
numel
(
regFacs
)
~=
size
(
Pm
,
1
)
error
(
"Regularisation factors must be either a scalar or its length must match the number of monitoring microphones."
);
if
~
isscalar
(
regFacs
)
if
isvector
(
regFacs
)
&&
numel
(
regFacs
)
~=
size
(
Pm
,
1
)
error
(
"If the regularisation factors are given as a vector the number of elements must match the number of monitoring microphones."
);
elseif
ismatrix
(
regFacs
)
&&
~
isequal
(
size
(
regFacs
),
ones
(
1
,
2
)
.*
size
(
Pm
,
1
))
error
(
"If the regularisation factors are given as a matrix, it must be a square matrix with each dimension equal to the number of monitoring microphones."
);
end
end
else
regFacs
=
0
;
...
...
@@ -143,8 +148,10 @@ function [oOpt, Sme, Smm, condNum] = obsFilt(Pe, Pm, Svv, regFacs, snrVal)
% Regularisation matrix
if
isscalar
(
regFacs
)
regMat
=
eye
(
size
(
Smm
))
.*
regFacs
;
else
else
if
isvector
(
regFacs
)
regMat
=
diag
(
regFacs
);
else
regMat
=
regFacs
;
end
% Signal-to-Noise Ratio at the monitoring microphones
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment