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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPAH
IN-NOVA
Virtual Sensing
Commits
e3f83c1c
Commit
e3f83c1c
authored
11 months ago
by
Achilles Kappis
Browse files
Options
Downloads
Patches
Plain Diff
Add an additional parameter to mulCoh.m to also get the multiple coherence
parent
b2c729a1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Virtual Sensing/Generic/MATLAB/Functions/mulCoh.m
+12
-6
12 additions, 6 deletions
Virtual Sensing/Generic/MATLAB/Functions/mulCoh.m
with
12 additions
and
6 deletions
Virtual Sensing/Generic/MATLAB/Functions/mulCoh.m
+
12
−
6
View file @
e3f83c1c
...
@@ -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: 1
2
/07/2024 (DD/MM/YYYY)
% Date: 1
6
/07/2024 (DD/MM/YYYY)
%
%
% Copyright: MIT
% Copyright: MIT
% --------------------------------------------------
% --------------------------------------------------
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
% --------------------------------------------------
% --------------------------------------------------
% Output
% Output
%
%
% cohSq [numeric]: The multiple coherence squared.
%
% coh [numeric]: The multiple coherence.
% coh [numeric]: The multiple coherence.
%
%
% --------------------------------------------------
% --------------------------------------------------
...
@@ -36,12 +38,12 @@
...
@@ -36,12 +38,12 @@
% virtual signal and physical signals in remote acoustic sensing" by
% virtual signal and physical signals in remote acoustic sensing" by
% P. Zhang, S. Wang, H. Duan, J. Tao, H. Zou and X. Qiu.
% P. Zhang, S. Wang, H. Duan, J. Tao, H. Zou and X. Qiu.
% --------------------------------------------------
% --------------------------------------------------
function
coh
=
mulCoh
(
Px
,
Py
,
Sqq
,
xRegFac
)
function
[
coh
Sq
,
coh
]
=
mulCoh
(
Px
,
Py
,
Sqq
,
xRegFac
)
% ====================================================
% ====================================================
% Check for number of arguments
% Check for number of arguments
% ====================================================
% ====================================================
narginchk
(
2
,
4
);
narginchk
(
2
,
4
);
nargoutchk
(
0
,
1
);
nargoutchk
(
0
,
2
);
% ====================================================
% ====================================================
% Validate input arguments
% Validate input arguments
...
@@ -78,7 +80,11 @@ function coh = mulCoh(Px, Py, Sqq, xRegFac)
...
@@ -78,7 +80,11 @@ function coh = mulCoh(Px, Py, Sqq, xRegFac)
Syy
=
Py
*
Sqq
*
Py
'
;
Syy
=
Py
*
Sqq
*
Py
'
;
Sxy
=
Px
*
Sqq
*
Py
'
;
Sxy
=
Px
*
Sqq
*
Py
'
;
% Calculate multiple coherence
% Calculate multiple coherence squared
coh
=
diag
((
Sxy
'
/(
Sxx
+
xRegFac
*
eye
(
size
(
Sxx
,
1
)))
*
Sxy
)
.
/
Syy
);
cohSq
=
diag
((
Sxy
'
/(
Sxx
+
xRegFac
*
eye
(
size
(
Sxx
,
1
)))
*
Sxy
)
.
/
Syy
);
coh
=
real
(
coh
);
% Make sure to get rid of residual imaginary parts
cohSq
=
real
(
cohSq
);
% Make sure to get rid of residual imaginary parts
if
nargout
>
1
coh
=
sqrt
(
cohSq
);
end
end
end
\ No newline at end of file
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