Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ollyl
AeroAcoustics.jl
Commits
7809a373
Commit
7809a373
authored
Sep 23, 2020
by
ollyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added experimental coherence weighting
parent
1b2b7af3
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
6 deletions
+43
-6
.gitlab-ci.yml
.gitlab-ci.yml
+1
-1
Project.toml
Project.toml
+1
-1
src/AeroAcoustics.jl
src/AeroAcoustics.jl
+35
-1
src/types.jl
src/types.jl
+6
-3
No files found.
.gitlab-ci.yml
View file @
7809a373
image
:
julia:1.
5
# image comes from Docker hub
image
:
julia:1.
3
# image comes from Docker hub
before_script
:
-
apt-get -qq update; apt-get -y install git hdf5-tools
...
...
Project.toml
View file @
7809a373
...
...
@@ -21,7 +21,7 @@ Distances = "0.9.0"
LazyArrays
=
"0.18.1"
NLsolve
=
"4.4.1"
Parameters
=
"0.12.1"
julia
=
"^1"
julia
=
"^1
.4
"
[extras]
BinaryProvider
=
"b99e7846-7c00-51b0-8f62-c81ae34c0232"
...
...
src/AeroAcoustics.jl
View file @
7809a373
...
...
@@ -25,7 +25,9 @@ export Environment,
octavebands
,
narrow2oct
,
enbw
,
coherence_weights
coherence_weights
,
DR!
,
DR
include
(
"utils.jl"
)
...
...
@@ -65,4 +67,36 @@ function narrow2oct(x::FreqArray,n;nomial::Bool=true,psd::Bool=false)
return
FreqArray
(
out
,
fc
)
end
"""
DR!(CSM::FreqArray)
Apply diagonal removal to CSM.
"""
function
DR!
(
CSM
::
FreqArray
)
T
=
eltype
(
CSM
)
M
,
M
,
Nf
=
size
(
CSM
)
for
j
=
1
:
Nf
for
i
=
1
:
M
CSM
.
arr
[
i
,
i
,
j
]
=
zero
(
T
)
end
end
end
"""
DR(CSM::FreqArray)
Apply diagonal removal to CSM and new array.
"""
function
DR
(
CSM
::
FreqArray
)
T
=
eltype
(
CSM
)
M
,
M
,
Nf
=
size
(
CSM
)
CSMd
=
copy
(
CSM
)
for
j
=
1
:
Nf
for
i
=
1
:
M
CSMd
[
i
,
i
,
j
]
=
zero
(
T
)
end
end
return
FreqArray
(
CSMd
,
CSM
.
fc
)
end
end
\ No newline at end of file
src/types.jl
View file @
7809a373
...
...
@@ -35,7 +35,8 @@ setup, constants, and stores the relevant data together. The microphone array is
- `xlim::Tuple=(-1.,1.)`: Cartesian x-coordinate limits.
- `ylim::Tuple=(-1.,1.)`: Cartesian y-coordinate limits.
- `wv=ones(size(micgeom,2))`: Microphones on/off.
- `wc::Bool`: Microphones coherence weighting.
- `wc::Bool=false`: Microphones coherence weighting.
- `dr::Bool=false`: Diagonal removal of CSM
- `w=ones(M,Nf)`: Microphone weights. If `wc=true` it calculates coherence weighting.
- `shear::Bool = false`: Amiet phase correction
- `ampcorr::Bool = shear`: Amiet amplitude correction (only applies when shear = true)
...
...
@@ -59,15 +60,17 @@ setup, constants, and stores the relevant data together. The microphone array is
Ma
::
Real
=
0.0
# Flow Mach speed (in positive x-direction) TODO: Generalize to NTuple{3,Real}
h
::
Real
=
0.0
# Distance from array center to shear layer
### Compute extra parameters
dr
::
Bool
=
false
Cinds
=
(
CSM
.
fc
.>=
flim
[
1
])
.&
(
CSM
.
fc
.<=
flim
[
2
])
fn
=
CSM
.
fc
[
Cinds
]
wv
::
Vector
=
ones
(
size
(
micgeom
,
2
))
# weights vector
micgeom_s
=
micgeom
[
:
,
Bool
.
(
wv
)]
CSM_s
=
FreqArray
(
CSM
[
Bool
.
(
wv
),
Bool
.
(
wv
),
Cinds
],
fn
)
CSM_w
=
FreqArray
(
CSM
[
Bool
.
(
wv
),
Bool
.
(
wv
),
Cinds
],
fn
)
CSM_s
=
ifelse
(
dr
,
DR
(
CSM_w
),
CSM_w
)
M
::
Int
=
size
(
micgeom_s
,
2
)
#count((!iszero).(wv))
Nf
::
Int
=
length
(
fn
)
wc
::
Bool
=
false
w
=
ifelse
(
wc
,
coherence_weights
(
CSM_
s
),
ones
(
M
,
Nf
))
w
=
ifelse
(
wc
,
coherence_weights
(
CSM_
w
),
ones
(
M
,
Nf
))
N
=
Nx
*
Ny
rx
=
range
(
xlim
[
1
],
stop
=
xlim
[
2
],
length
=
Nx
)
ry
=
range
(
ylim
[
1
],
stop
=
ylim
[
2
],
length
=
Ny
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment