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
5b4ce8a5
Commit
5b4ce8a5
authored
7 months ago
by
Achilles Kappis
Browse files
Options
Downloads
Patches
Plain Diff
Update parameter list and checks in firstOrderDma.m
parent
34e5e24f
No related branches found
No related tags found
1 merge request
!12
Implementation of first order differential arrays in the time domain
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Signal Processing/Array Processing/MATLAB/Functions/firstOrderDma.m
+22
-15
22 additions, 15 deletions
...cessing/Array Processing/MATLAB/Functions/firstOrderDma.m
with
22 additions
and
15 deletions
Signal Processing/Array Processing/MATLAB/Functions/firstOrderDma.m
+
22
−
15
View file @
5b4ce8a5
...
@@ -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:
17
/1
1
/2024 (DD/MM/YYYY)
% Date:
04
/1
2
/2024 (DD/MM/YYYY)
%
%
% Copyright: MIT
% Copyright: MIT
% --------------------------------------------------
% --------------------------------------------------
...
@@ -64,39 +64,44 @@
...
@@ -64,39 +64,44 @@
% Notes
% Notes
%
%
% --------------------------------------------------
% --------------------------------------------------
function
[
h
,
output
]
=
firstOrderDma
(
input
,
freq
,
d
,
pPattern
,
beta
)
function
[
h
,
output
]
=
firstOrderDma
(
freq
,
d
,
pPattern
,
beta
,
input
)
% ====================================================
% ====================================================
% Check for number of arguments
% Check for number of arguments
% ====================================================
% ====================================================
narginchk
(
3
,
5
);
narginchk
(
2
,
5
);
nargoutchk
(
0
,
2
);
nargoutchk
(
0
,
2
);
% ====================================================
% ====================================================
% Validate input arguments
% Validate input arguments
% ====================================================
% ====================================================
validateattributes
(
input
,
{
'numeric'
},
{
'3d'
,
'nonnan'
,
'finite'
,
'nonempty'
},
mfilename
,
'Input'
,
1
);
validateattributes
(
freq
,
{
'numeric'
},
{
'real'
,
'nonnan'
,
'finite'
,
'nonempty'
,
'vector'
},
mfilename
,
'Frequencies'
,
1
);
validateattributes
(
d
,
{
'numeric'
},
{
'scalar'
,
'real'
,
'nonnan'
,
'finite'
,
'nonempty'
},
mfilename
,
'Inter-element distance'
,
2
);
% Check input
if
nargin
>
4
&&
~
isempty
(
input
)
validateattributes
(
input
,
{
'numeric'
},
{
'3d'
,
'nonnan'
,
'finite'
,
'nonempty'
,
'size'
,
[
NaN
,
NaN
,
length
(
freq
)]},
mfilename
,
'Input'
,
5
);
if
mod
(
size
(
input
,
1
),
2
)
~=
0
if
mod
(
size
(
input
,
1
),
2
)
~=
0
error
(
"First dimension of 'input' parameter must have even length."
)
error
(
"First dimension of 'input' parameter must have even length."
)
end
end
else
validateattributes
(
freq
,
{
'numeric'
},
{
'real'
,
'nonnan'
,
'finite'
,
'nonempty'
,
'vector'
,
'numel'
,
size
(
input
,
3
)},
mfilename
,
'Frequencies'
,
2
)
;
input
=
[]
;
validateattributes
(
d
,
{
'numeric'
},
{
'scalar'
,
'real'
,
'nonnan'
,
'finite'
,
'nonempty'
},
mfilename
,
'Inter-element distance'
,
3
);
end
% Check beta
% Check beta
if
nargin
>
4
if
nargin
>
3
&&
~
isempty
(
beta
)
validateattributes
(
beta
,
{
'numeric'
},
{
'scalar'
,
'real'
,
'finite'
,
'nonempty'
,
'nonnan'
,
'<='
,
1
,
'>='
,
0
},
mfilename
,
"Beta"
,
5
)
validateattributes
(
beta
,
{
'numeric'
},
{
'scalar'
,
'real'
,
'finite'
,
'nonempty'
,
'nonnan'
,
'<='
,
1
,
'>='
,
0
},
mfilename
,
"Beta"
,
4
)
else
else
beta
=
0
;
beta
=
0
;
end
end
% Check alpha (angle of null)
% Check alpha (angle of null)
if
nargin
>
3
if
nargin
>
2
&&
~
isempty
(
pPattern
);
if
isstring
(
pPattern
)
||
ischar
(
pPattern
)
if
isstring
(
pPattern
)
||
ischar
(
pPattern
)
validateattributes
(
pPattern
,
{
'char'
,
'string'
},
{
'scalartext'
,
'nonempty'
},
mfilename
,
'Polar pattern'
,
4
);
validateattributes
(
pPattern
,
{
'char'
,
'string'
},
{
'scalartext'
,
'nonempty'
},
mfilename
,
'Polar pattern'
,
3
);
elseif
isnumeric
(
pPattern
)
elseif
isnumeric
(
pPattern
)
validateattributes
(
pPattern
,
{
'numeric'
},
{
'scalar'
,
'real'
,
'nonnan'
,
'finite'
,
'nonempty'
},
mfilename
,
'Angle of null'
,
4
);
validateattributes
(
pPattern
,
{
'numeric'
},
{
'scalar'
,
'real'
,
'nonnan'
,
'finite'
,
'nonempty'
},
mfilename
,
'Angle of null'
,
3
);
end
end
else
else
pPattern
=
"dipole"
;
pPattern
=
"dipole"
;
...
@@ -151,7 +156,7 @@ function [h, output] = firstOrderDma(input, freq, d, pPattern, beta)
...
@@ -151,7 +156,7 @@ function [h, output] = firstOrderDma(input, freq, d, pPattern, beta)
% ====================================================
% ====================================================
% Calculate array output
% Calculate array output
% ====================================================
% ====================================================
if
nargout
>
1
if
nargout
>
1
&&
~
isempty
(
input
)
% Go through the frequencies
% Go through the frequencies
for
freqIdx
=
length
(
freq
):
-
1
:
1
for
freqIdx
=
length
(
freq
):
-
1
:
1
for
pairIdx
=
size
(
input
,
1
)/
2
:
-
1
:
1
for
pairIdx
=
size
(
input
,
1
)/
2
:
-
1
:
1
...
@@ -159,6 +164,8 @@ function [h, output] = firstOrderDma(input, freq, d, pPattern, beta)
...
@@ -159,6 +164,8 @@ function [h, output] = firstOrderDma(input, freq, d, pPattern, beta)
output
(
pairIdx
,
:,
freqIdx
)
=
h
(:,
freqIdx
)
'
*
input
(
pairIdx
*
2
-
1
:
pairIdx
*
2
,
:,
freqIdx
);
output
(
pairIdx
,
:,
freqIdx
)
=
h
(:,
freqIdx
)
'
*
input
(
pairIdx
*
2
-
1
:
pairIdx
*
2
,
:,
freqIdx
);
end
end
end
end
else
output
=
[];
end
end
end
end
...
...
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