Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institute of Technical Acoustics (ITA)
toolbox
Commits
10b6bd08
You need to sign in or sign up before continuing.
Commit
10b6bd08
authored
8 years ago
by
Jan-Gerrit Richter
Browse files
Options
Downloads
Patches
Plain Diff
removed writeDaffFile from itaHRTF (again)
parent
f12e09ef
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/Binaural-HRTF/HRTF_class/@itaHRTF/itaHRTF.m
+0
-4
0 additions, 4 deletions
applications/Binaural-HRTF/HRTF_class/@itaHRTF/itaHRTF.m
applications/ListeningTests/javaGUI/itaListeningTestStimulus.m
+33
-30
33 additions, 30 deletions
...cations/ListeningTests/javaGUI/itaListeningTestStimulus.m
with
33 additions
and
34 deletions
applications/Binaural-HRTF/HRTF_class/@itaHRTF/itaHRTF.m
+
0
−
4
View file @
10b6bd08
...
@@ -1378,10 +1378,6 @@ classdef itaHRTF < itaAudio
...
@@ -1378,10 +1378,6 @@ classdef itaHRTF < itaAudio
grid
on
;
set
(
gca
,
'layer'
,
'top'
)
grid
on
;
set
(
gca
,
'layer'
,
'top'
)
end
end
%% Jan's Functions
function
writeDAFFFile
(
this
,
filePath
)
% writes DAFF file to hard disc
% writes DAFF file to hard disc
%
%
% Input: filePath / fileName (string)
% Input: filePath / fileName (string)
...
...
This diff is collapsed.
Click to expand it.
applications/ListeningTests/javaGUI/itaListeningTestStimulus.m
+
33
−
30
View file @
10b6bd08
...
@@ -32,7 +32,8 @@ classdef itaListeningTestStimulus
...
@@ -32,7 +32,8 @@ classdef itaListeningTestStimulus
properties
properties
UseHRTF
=
1
;
UseHRTF
=
1
;
UseHeadphoneEquilization
=
1
;
UseHeadphoneEquilization
=
1
;
UseSoundLevelVariation
=
1
;
%TODO UseTracker = 1;
HRTFFile
;
HRTFFile
;
StimulusFile
;
StimulusFile
;
...
@@ -47,11 +48,12 @@ classdef itaListeningTestStimulus
...
@@ -47,11 +48,12 @@ classdef itaListeningTestStimulus
mHRTF
;
mHRTF
;
mHeadphoneEquilization
;
mHeadphoneEquilization
;
mStimulus
;
mStimulus
;
hrtfmerge
;
end
end
%% methods
%% methods
methods
methods
function
returnSignal
=
getStimulusForDirection
(
this
,
azimuth
,
elevation
)
function
returnSignal
=
getStimulusForDirection
(
this
,
azimuth
,
elevation
,
soundLevel
)
returnSignal
=
this
.
mStimulus
;
returnSignal
=
this
.
mStimulus
;
...
@@ -60,13 +62,18 @@ classdef itaListeningTestStimulus
...
@@ -60,13 +62,18 @@ classdef itaListeningTestStimulus
returnSignal
=
this
.
convoleSignals
(
returnSignal
,
HRTF
);
returnSignal
=
this
.
convoleSignals
(
returnSignal
,
HRTF
);
end
end
if
(
this
.
UseHeadphoneEquilization
)
if
(
this
.
UseHeadphoneEquilization
==
1
)
returnSignal
=
this
.
convoleSignals
(
returnSignal
,
this
.
mHeadphoneEquilization
);
returnSignal
=
this
.
convoleSignals
(
returnSignal
,
this
.
mHeadphoneEquilization
);
end
end
% TODO: Better normalization
%returnSignal = returnSignal./256;
if
(
this
.
UseSoundLevelVariation
==
1
)
returnSignal
=
returnSignal
.
/
soundLevel
;
end
% TODO: Better normalization
% returnSignal = returnSignal./64;
end
end
end
end
...
@@ -81,18 +88,16 @@ classdef itaListeningTestStimulus
...
@@ -81,18 +88,16 @@ classdef itaListeningTestStimulus
end
end
function
HRTF
=
getHRTFForDirection
(
this
,
azimuth
,
elevation
)
function
HRTF
=
getHRTFForDirection
(
this
,
azimuth
,
elevation
)
%
hrtf = this.hrtfmerge;
%
this.mHRTF
%
coords = hrtf.channelCoordinates;
% targetCoord = itaCoordinates(1);
% targetCoord = itaCoordinates(1);
% targetCoord.phi_deg = azimuth;
% targetCoord.phi_deg = azimuth;
% targetCoord.theta_deg = elevation;
% targetCoord.theta_deg = elevation;
% targetCoord.r = 1;
% targetCoord.r = 1;
if
isa
(
hrtf
,
'itaHRTF'
)
% index = coords.findnearest(targetCoord);
HRTF
=
hrtf
.
findnearestHRTF
(
targetCoord
);
% HRTF = this.mHRTF(ceil(index/2));
else
hrtf
=
this
.
hrtfmerge
.
findnearestHRTF
(
elevation
,
azimuth
);
index
=
coords
.
findnearest
(
targetCoord
);
HRTF
=
hrtf
.
itaHRTF2itaAudio
;
HRTF
=
this
.
mHRTF
(
ceil
(
index
/
2
));
end
end
end
end
end
...
@@ -113,32 +118,29 @@ classdef itaListeningTestStimulus
...
@@ -113,32 +118,29 @@ classdef itaListeningTestStimulus
% load the HRTF data
% load the HRTF data
HRTF
=
ita_read
(
value
);
HRTF
=
ita_read
(
value
);
mergeHRTF
=
merge
(
HRTF
);
% TODO: normalization
maxValue
=
max
(
max
(
abs
(
mergeHRTF
.
freqData
)));
% mergeHRTF = merge(HRTF);
for
index
=
1
:
length
(
HRTF
)
% maxValue = max(max(abs(mergeHRTF.freqData)));
HRTF
(
index
)
.
freqData
=
HRTF
(
index
)
.
freqData
.
/
maxValue
;
% for index = 1:length(HRTF)
% HRTF(index).signalType = 'energy';
% HRTF(index).freqData = HRTF(index).freqData./maxValue;
end
% % HRTF(index).signalType = 'energy';
% end
this
.
mHRTF
=
HRTF
;
this
.
mHRTF
=
HRTF
;
this
.
hrtfmerge
=
itaHRTF
(
this
.
mHRTF
);
this
.
hrtfmerge
=
itaHRTF
(
merge
(
this
.
mHRTF
));
end
end
function
result
=
get
.
StimulusFile
(
this
)
function
result
=
get
.
StimulusFile
(
this
)
result
=
this
.
StimulusFile
;
result
=
this
.
StimulusFile
;
end
end
function
this
=
set
.
StimulusFile
(
this
,
value
)
function
this
=
set
.
StimulusFile
(
this
,
value
)
if
~
(
isa
(
value
,
'itaAudio'
))
this
.
StimulusFile
=
value
;
this
.
StimulusFile
=
value
;
% read the simulus file
% read the simulus file
this
.
mStimulus
=
ita_read
(
value
);
this
.
mStimulus
=
ita_read
(
value
);
else
this
.
mStimulus
=
value
;
end
% normalize
% normalize
this
.
mStimulus
.
timeData
=
this
.
mStimulus
.
timeData
.
/
max
(
abs
(
this
.
mStimulus
.
timeData
));
%
this.mStimulus.timeData = this.mStimulus.timeData./max(abs(this.mStimulus.timeData));
end
end
...
@@ -150,7 +152,8 @@ classdef itaListeningTestStimulus
...
@@ -150,7 +152,8 @@ classdef itaListeningTestStimulus
% read the file
% read the file
headphoneEquilization
=
ita_read
(
value
);
headphoneEquilization
=
ita_read
(
value
);
headphoneEquilization
.
freqData
=
headphoneEquilization
.
freqData
.
/
max
(
max
(
abs
(
headphoneEquilization
.
freqData
)));
% TODO: normalization
%headphoneEquilization.freqData = headphoneEquilization.freqData./max(max(abs(headphoneEquilization.freqData)));
this
.
mHeadphoneEquilization
=
headphoneEquilization
;
this
.
mHeadphoneEquilization
=
headphoneEquilization
;
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