Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
37b586d9
Commit
37b586d9
authored
Sep 13, 2017
by
Jan-Gerrit Richter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some quick fix in spherical slice to only get one slice.
parent
8490ec6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
+28
-3
applications/Binaural-HRTF/HRTF_class/@itaHRTF/itaHRTF.m
applications/Binaural-HRTF/HRTF_class/@itaHRTF/itaHRTF.m
+28
-3
No files found.
applications/Binaural-HRTF/HRTF_class/@itaHRTF/itaHRTF.m
View file @
37b586d9
...
...
@@ -698,12 +698,37 @@ classdef itaHRTF < itaAudio
phiUni
=
rad2deg
(
phi_Unique
(
this
,
varargin
));
end
function
slice
=
sphericalSlice
(
this
,
dirID
,
dir_deg
)
function
slice
=
sphericalSlice
(
this
,
dirID
,
dir_deg
,
exactSearch
)
% dir in degree
% dirID [phi, theta]
if
~
exist
(
'exactSearch'
,
'var'
)
exactSearch
=
0
;
end
phiU
=
rad2deg
(
this
.
phi_Unique
);
thetaU
=
rad2deg
(
this
.
theta_Unique
);
if
~
exactSearch
phiU
=
rad2deg
(
this
.
phi_Unique
);
thetaU
=
rad2deg
(
this
.
theta_Unique
);
else
earCoords
=
this
.
getEar
(
'L'
)
.
channelCoordinates
;
switch
dirID
case
{
'phi_deg'
,
'p'
}
phiValues
=
unique
(
earCoords
.
phi_deg
);
[
~
,
index
]
=
min
(
abs
(
phiValues
-
dir_deg
));
exactPhiValue
=
phiValues
(
index
);
tmp
=
earCoords
.
n
(
earCoords
.
phi_deg
==
exactPhiValue
);
thetaU
=
tmp
.
theta_deg
;
slice
=
this
.
findnearestHRTF
(
thetaU
,
dir_deg
);
case
{
'theta_deg'
,
't'
}
thetaValues
=
unique
(
earCoords
.
theta_deg
);
[
~
,
index
]
=
min
(
abs
(
thetaValues
-
dir_deg
));
exactThetaValue
=
thetaValues
(
index
);
tmp
=
earCoords
.
n
(
earCoords
.
theta_deg
==
exactThetaValue
);
phiU
=
tmp
.
phi_deg
;
slice
=
this
.
findnearestHRTF
(
dir_deg
,
phiU
);
end
end
switch
dirID
case
{
'phi_deg'
,
'p'
}
slice
=
this
.
findnearestHRTF
(
thetaU
,
dir_deg
);
...
...
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