Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
4
Merge Requests
4
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
83d43f67
Commit
83d43f67
authored
Nov 22, 2016
by
Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding fallback implementation when reading from DAFF into itaHRTF for old version (v15)
parent
4c0c2647
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
14 deletions
+39
-14
applications/Binaural-HRTF/HRTF_class/@itaHRTF/itaHRTF.m
applications/Binaural-HRTF/HRTF_class/@itaHRTF/itaHRTF.m
+39
-14
No files found.
applications/Binaural-HRTF/HRTF_class/@itaHRTF/itaHRTF.m
View file @
83d43f67
...
...
@@ -103,7 +103,7 @@ classdef itaHRTF < itaAudio
end
properties
(
Dependent
=
true
,
SetAccess
=
private
)
openD
aff
2itaHRTF
;
openD
AFF
2itaHRTF
;
itaAudio2itaHRTF
;
init
;
hdf2itaHRTF
;
...
...
@@ -133,7 +133,7 @@ classdef itaHRTF < itaAudio
end
% openDaff input
if
~
isempty
(
find
(
strcmpi
(
varargin
,
'Daff'
)
==
1
,
1
))
this
.
openD
aff
2itaHRTF
=
varargin
{
find
(
strcmpi
(
varargin
,
'Daff'
)
==
1
)
+
1
};
this
.
openD
AFF
2itaHRTF
=
varargin
{
find
(
strcmpi
(
varargin
,
'Daff'
)
==
1
)
+
1
};
end
% hdf5 input
if
~
isempty
(
find
(
strcmpi
(
varargin
,
'hdf5'
)
==
1
,
1
))
...
...
@@ -351,19 +351,44 @@ classdef itaHRTF < itaAudio
end
end
function
this
=
set
.
openDaff2itaHRTF
(
this
,
pathDaff
)
handleDaff
=
DAFF
(
'open'
,
pathDaff
);
props
=
DAFF
(
'getProperties'
,
handleDaff
);
counter
=
1
;
data
=
zeros
(
props
.
filterLength
,
props
.
numRecords
*
2
,
'double'
)
;
coordDaff
=
zeros
(
props
.
numRecords
,
2
)
;
for
iDir
=
1
:
props
.
numRecords
data
(:,[
counter
counter
+
1
])
=
DAFF
(
'getRecordByIndex'
,
handleDaff
,
iDir
)
'
;
%coordDaff(iDir,:) = DAFF('getRecordCoords', handleDaff, 'object', iDir)';
coordDaff
(
iDir
,:)
=
DAFF
(
'getRecordCoords'
,
handleDaff
,
'data'
,
iDir
)
'
;
counter
=
counter
+
2
;
function
this
=
set
.
openDAFF2itaHRTF
(
this
,
daff_file_path
)
try_daff_old_version
=
false
;
% First try new version (v17)
try
handleDaff
=
DAFFv17
(
'open'
,
daff_file_path
);
props
=
DAFFv17
(
'getProperties'
,
handleDaff
);
counter
=
1
;
data
=
zeros
(
props
.
filterLength
,
props
.
numRecords
*
2
,
'double'
)
;
coordDaff
=
zeros
(
props
.
numRecords
,
2
)
;
for
iDir
=
1
:
props
.
numRecords
data
(:,[
counter
counter
+
1
])
=
DAFFv17
(
'getRecordByIndex'
,
handleDaff
,
iDir
)
'
;
coordDaff
(
iDir
,:)
=
DAFFv17
(
'getRecordCoords'
,
handleDaff
,
'data'
,
iDir
)
'
;
counter
=
counter
+
2
;
end
catch
disp
(
'Could not read DAFF file right away, falling back to old version and retrying ...'
);
try_daff_old_version
=
true
;
end
if
try_daff_old_version
% Old version (v15)
handleDaff
=
DAFFv15
(
'open'
,
daff_file_path
);
props
=
DAFFv15
(
'getProperties'
,
handleDaff
);
counter
=
1
;
data
=
zeros
(
props
.
filterLength
,
props
.
numRecords
*
2
,
'double'
)
;
coordDaff
=
zeros
(
props
.
numRecords
,
2
)
;
for
iDir
=
1
:
props
.
numRecords
data
(:,[
counter
counter
+
1
])
=
DAFFv15
(
'getRecordByIndex'
,
handleDaff
,
iDir
)
'
;
coordDaff
(
iDir
,:)
=
DAFFv15
(
'getRecordCoords'
,
handleDaff
,
'data'
,
iDir
)
'
;
counter
=
counter
+
2
;
end
end
% Proceed (version independent)
phiM
=
coordDaff
(:,
1
)
*
pi
/
180
;
%phiM = mod(coordDaff(:,1),360)*pi/180;
...
...
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