Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
fdcbbc13
Commit
fdcbbc13
authored
Aug 05, 2019
by
Dipl.-Ing. Jonas Stienen
Browse files
WIP
parent
ed1af57d
Changes
2
Hide whitespace changes
Inline
Side-by-side
applications/SoundFieldSimulation/Diffraction/plots/ita_diffraction_plot_utd_tsingos_total_field.m
View file @
fdcbbc13
...
...
@@ -2,13 +2,12 @@
n1
=
[
1
1
0
]
/
sqrt
(
2
);
n2
=
[
-
1
1
0
]
/
sqrt
(
2
);
loc
=
[
0
0
0
];
source_pos
=
5
*
[
-
1
0
0
]
/
sqrt
(
2
)
;
source_pos
=
5
*
[
-
1
0
0
];
receiver_start_pos
=
5
*
[
-
1
-
1
0
]
/
sqrt
(
2
);
w
=
itaInfiniteWedge
(
n1
,
n2
,
loc
);
apex_point
=
w
.
get_aperture_point
(
source_pos
,
receiver_start_pos
);
apex_dir
=
w
.
aperture_direction
;
%delta = 0.05;
c
=
344
;
% Speed of sound
freq
=
[
20
,
50
,
100
,
200
,
400
,
800
,
1600
,
3200
,
6400
,
12800
,
24000
]
'
;
...
...
applications/SoundFieldSimulation/Diffraction/tests/ita_diffraction_test_utd_shadow_zone_transition.m
View file @
fdcbbc13
%% Test transition at shadown zone of UTD diffraction
w
=
itaInfiniteWedge
(
[
1
0
0
],
[
0
0
-
1
],
[
0
0
0
]
);
% OpenGL coordinates
n1
=
[
1
1
0
]
/
sqrt
(
2
);
n2
=
[
-
1
1
0
]
/
sqrt
(
2
);
loc
=
[
0
0
0
];
source_pos
=
5
*
[
-
1
0
0
];
w
=
itaInfiniteWedge
(
n1
,
n2
,
loc
);
delta
=
0.001
;
s_shadow
=
[
(
-
3
-
delta
)
0
-
3
];
s_illuminated
=
[
(
-
3
+
delta
)
0
-
3
];
r
=
[
3
0
3
];
r_shadow
=
5
*
[
1
-
delta
0
];
r_illuminated
=
5
*
[
1
delta
0
];
assert
(
ita_diffraction_shadow_zone
(
w
,
s_shadow
,
r
)
)
assert
(
~
ita_diffraction_shadow_zone
(
w
,
s_illuminated
,
r
)
)
assert
(
ita_diffraction_shadow_zone
(
w
,
s
ource_pos
,
r
_shadow
)
)
assert
(
~
ita_diffraction_shadow_zone
(
w
,
s
ource_pos
,
r
_illuminated
)
)
utd_tf
=
itaAudio
(
1
);
utd_tf
.
fftDegree
=
11
;
...
...
@@ -16,13 +19,13 @@ utd_tf.fftDegree = 11;
f
=
utd_tf
.
freqVector
(
2
:
end
);
c
=
341
;
[
H1
,
D1
,
A1
]
=
ita_diffraction_utd
(
w
,
s_shadow
,
r
,
f
,
c
);
[
H1
,
D1
,
A1
]
=
ita_diffraction_utd
(
w
,
s
ource_pos
,
r
_shadow
,
f
,
c
);
utd_tf
.
freqData
(
:,
1
)
=
[
0
H1
];
[
H2
,
D2
,
A2
]
=
ita_diffraction_utd
(
w
,
s_illuminated
,
r
,
f
,
c
);
[
H2
,
D2
,
A2
]
=
ita_diffraction_utd
(
w
,
s
ource_pos
,
r
_illuminated
,
f
,
c
);
utd_tf
.
freqData
(
:,
2
)
=
[
0
H2
];
d
=
norm
(
r
-
s
_illuminated
);
d
=
norm
(
source_pos
-
r
_illuminated
);
c
=
343
;
k
=
2
*
pi
*
f
/
c
;
H_direct
=
1
.
/
d
.*
exp
(
-
1
i
.*
k
.*
d
);
...
...
@@ -32,4 +35,51 @@ utd_tf.freqData( :, 4 ) = [ 0 ( H2 + H_direct ) ./ H_direct ];
utd_tf
.
channelNames
=
{
'Diffracted field (shadow)'
,
'Diffracted field (illuminated)'
,
'Insertion loss (shadowed)'
,
'Insertion loss (illuminated)'
};
utd_tf
.
pf
%utd_tf.pf
%% Trajectories
receiver_start_pos
=
5
*
[
-
1
-
1
0
]
/
sqrt
(
2
);
apex_point
=
w
.
get_aperture_point
(
source_pos
,
receiver_start_pos
);
apex_dir
=
w
.
aperture_direction
;
freq
=
[
20
,
50
,
100
,
200
,
400
,
800
,
1600
,
3200
,
6400
,
12800
,
24000
]
'
;
k
=
2
*
pi
*
freq
.
/
c
;
num_angles
=
1000
;
alpha_d_start
=
w
.
opening_angle
;
alpha_d_end
=
0
;
alpha_d
=
linspace
(
alpha_d_start
,
alpha_d_end
,
num_angles
);
% Set different receiver positions rotated around the aperture
recevier_positions
=
norm
(
receiver_start_pos
)
*
[
cos
(
alpha_d
-
pi
/
4
);
sin
(
alpha_d
-
pi
/
4
);
zeros
(
1
,
numel
(
alpha_d
)
)
]
'
;
H_diffracted_field_log
=
[];
N
=
size
(
recevier_positions
,
1
);
for
n
=
1
:
N
receiver_pos
=
recevier_positions
(
n
,
1
:
3
);
r_dir
=
norm
(
receiver_pos
-
source_pos
);
H_direct_field
=
1
.
/
r_dir
.*
exp
(
-
1
i
.*
k
.*
r_dir
);
rcv_in_shadow_zone
=
ita_diffraction_shadow_zone
(
w
,
source_pos
,
receiver_pos
);
% UTD total wave field
H_diffracted_field
=
ita_diffraction_utd
(
w
,
source_pos
,
receiver_pos
,
freq
,
c
);
if
rcv_in_shadow_zone
H_total_field
=
H_diffracted_field
;
else
H_total_field
=
H_diffracted_field
+
H_direct_field
;
end
H_diffracted_field_log
=
[
H_diffracted_field_log
,
H_total_field
.
/
H_direct_field
];
end
figure
plot
(
db
(
H_diffracted_field_log
(
:,
:
)
'
)
)
Write
Preview
Supports
Markdown
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