Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
turtlerob1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Karlsson
turtlerob1
Commits
1f081f48
Commit
1f081f48
authored
9 years ago
by
Axel Ahrens
Browse files
Options
Downloads
Patches
Plain Diff
added the distance estimator
parent
25e9db98
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
get_distance.m
+100
-0
100 additions, 0 deletions
get_distance.m
with
100 additions
and
0 deletions
get_distance.m
0 → 100644
+
100
−
0
View file @
1f081f48
function
[
d_close
,
ic_mean
]
=
get_distance
(
signal
,
thr
)
% function to get the estimated distance from a binaural measurement with
% using the interaural coherence
%This fcn is based on the DEMO_IC.m from the Two!Ears project
%% init
fs
=
24414
;
%% LOAD SIGNAL
%
% Create a data object based on the ear signals
dObj1
=
dataObject
(
signal
,
fs
);
% % Load erverberant signal
% load('Test_signals/DEMO_Speech_Room_D');
%
% % Create a data object based on the ear signals
% dObj2 = dataObject(earSignals(1:22494,:),fsHz);
%% PLACE REQUEST AND CONTROL PARAMETERS
%
%
% Request interaural coherence (IC)
requests
=
{
'ic'
};
% Parameters of the auditory filterbank processor
fb_type
=
'gammatone'
;
fb_lowFreqHz
=
300
;
fb_highFreqHz
=
2000
;
fb_nChannels
=
8
;
% Parameters of innerhaircell processor
ihc_method
=
'dau'
;
% Parameters of crosscorrelation processor
cc_wSizeSec
=
0.5
;
cc_hSizeSec
=
0.2
;
cc_wname
=
'hann'
;
% Summary of parameters
par
=
genParStruct
(
'fb_type'
,
fb_type
,
'fb_lowFreqHz'
,
fb_lowFreqHz
,
...
'fb_highFreqHz'
,
fb_highFreqHz
,
'fb_nChannels'
,
fb_nChannels
,
...
'ihc_method'
,
ihc_method
,
'cc_wSizeSec'
,
cc_wSizeSec
,
...
'cc_hSizeSec'
,
cc_hSizeSec
,
'cc_wname'
,
cc_wname
);
%% PERFORM PROCESSING
%
%
% Create two managers
mObj1
=
manager
(
dObj1
,
requests
,
par
);
%mObj2 = manager(dObj2,requests,par);
% Request processing
mObj1
.
processSignal
();
%mObj2.processSignal();
%% PLOT RESULTS
%
%
plot
=
0
;
if
plot
% Plot the original ear signal
dObj1
.
plot
([],[],
'bGray'
,
1
,
'decimateRatio'
,
3
,
'bSignal'
,
1
);
ylim
([
-
1.25
1.25
]);
% Plot IC
dObj1
.
ic
{
1
}
.
plot
;
title
(
'Interaural coherence (anechoic)'
)
% Plot the original ear signal
% dObj2.plot([],[],'bGray',1,'decimateRatio',3,'bSignal',1);
% ylim([-1.25 1.25]);
% % Plot IC
% dObj2.ic{1}.plot;
% title('Interaural coherence (reverberant)')
end
%% Distance guesstimation
ic_Obj
=
dObj1
.
ic
;
ic_Obj
=
ic_Obj
{
1
}
.
Data
;
ic
=
ic_Obj
(:);
ic_mean
=
mean
(
mean
(
ic
));
if
ic_mean
>=
thr
d_close
=
1
;
else
d_close
=
0
;
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