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
771e83fe
Commit
771e83fe
authored
3 months ago
by
Achilles Kappis
Browse files
Options
Downloads
Patches
Plain Diff
Vectorise calculation of array manifolds
parent
1a21124f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Signal Processing/Array Processing/MATLAB/Functions/firstOrderDma.m
+11
-8
11 additions, 8 deletions
...cessing/Array Processing/MATLAB/Functions/firstOrderDma.m
with
11 additions
and
8 deletions
Signal Processing/Array Processing/MATLAB/Functions/firstOrderDma.m
+
11
−
8
View file @
771e83fe
...
@@ -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:
04
/01/2025 (DD/MM/YYYY)
% Date:
27
/01/2025 (DD/MM/YYYY)
%
%
% Copyright: MIT
% Copyright: MIT
% --------------------------------------------------
% --------------------------------------------------
...
@@ -130,7 +130,7 @@ function [h, output] = firstOrderDma(freq, d, pPattern, beta, input)
...
@@ -130,7 +130,7 @@ function [h, output] = firstOrderDma(freq, d, pPattern, beta, input)
pPattern
=
pi
/
2
;
pPattern
=
pi
/
2
;
beta
=
0
;
beta
=
0
;
case
'cardioid'
case
'cardioid'
pPattern
=
pi
;
pPattern
=
-
pi
;
beta
=
0
;
beta
=
0
;
case
'hypercardioid'
case
'hypercardioid'
pPattern
=
(
2
*
pi
/
3
);
pPattern
=
(
2
*
pi
/
3
);
...
@@ -146,10 +146,13 @@ function [h, output] = firstOrderDma(freq, d, pPattern, beta, input)
...
@@ -146,10 +146,13 @@ function [h, output] = firstOrderDma(freq, d, pPattern, beta, input)
end
end
% Calculate array manifolds (per frequency)
arrManMtx
(:,
2
,
:)
=
arrManLoc
(
pPattern
,
d
,
freq
,
343
);
arrManMtx
(:,
1
,
:)
=
arrManLoc
(
0
,
d
,
freq
,
343
);
% Calculate filter(s)
% Calculate filter(s)
for
freqIdx
=
length
(
freq
):
-
1
:
1
for
fIdx
=
length
(
freq
):
-
1
:
1
arrManLocMtx
=
[
arrManLoc
(
0
,
d
,
freq
(
freqIdx
),
343
),
arrManLoc
(
pPattern
,
d
,
freq
(
freqIdx
),
343
)];
h
(:,
fIdx
)
=
(
arrManMtx
(:,
:,
fIdx
)
'
)\[
1
;
beta
];
h
(:,
freqIdx
)
=
(
arrManLocMtx
'
)\[
1
;
beta
];
end
end
...
@@ -158,10 +161,10 @@ function [h, output] = firstOrderDma(freq, d, pPattern, beta, input)
...
@@ -158,10 +161,10 @@ function [h, output] = firstOrderDma(freq, d, pPattern, beta, input)
% ====================================================
% ====================================================
if
nargout
>
1
&&
~
isempty
(
input
)
if
nargout
>
1
&&
~
isempty
(
input
)
% Go through the frequencies
% Go through the frequencies
for
f
req
Idx
=
length
(
freq
):
-
1
:
1
for
fIdx
=
length
(
freq
):
-
1
:
1
for
pairIdx
=
size
(
input
,
1
)/
2
:
-
1
:
1
for
pairIdx
=
size
(
input
,
1
)/
2
:
-
1
:
1
% Multiply the array filter with the input
% Multiply the array filter with the input
output
(
pairIdx
,
:,
f
req
Idx
)
=
h
(:,
f
req
Idx
)
'
*
input
(
pairIdx
*
2
-
1
:
pairIdx
*
2
,
:,
f
req
Idx
);
output
(
pairIdx
,
:,
fIdx
)
=
h
(:,
fIdx
)
'
*
input
(
pairIdx
*
2
-
1
:
pairIdx
*
2
,
:,
fIdx
);
end
end
end
end
else
else
...
@@ -173,6 +176,6 @@ end
...
@@ -173,6 +176,6 @@ end
%% Utility functions
%% Utility functions
% Calculate the array manifold
% Calculate the array manifold
function
am
=
arrManLoc
(
phi
,
d
,
freq
,
c
)
function
am
=
arrManLoc
(
phi
,
d
,
freq
,
c
)
k
=
-
2
j
*
pi
*
freq
*
cos
(
phi
)/
c
;
k
=
-
2
j
*
pi
*
freq
*
cos
(
phi
)/
c
;
k
=
k
(:)
.'
;
am
=
[
exp
(
k
*
(
-
d
/
2
));
exp
(
k
*
(
d
/
2
))];
am
=
[
exp
(
k
*
(
-
d
/
2
));
exp
(
k
*
(
d
/
2
))];
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