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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Karlsson
turtlerob1
Commits
a29091b3
Commit
a29091b3
authored
9 years ago
by
Fredrik Bagge Carlson
Browse files
Options
Downloads
Plain Diff
do
parents
63863cb7
cb274178
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
get_distance.m
+15
-10
15 additions, 10 deletions
get_distance.m
state_machine.m
+2
-1
2 additions, 1 deletion
state_machine.m
with
17 additions
and
11 deletions
get_distance.m
+
15
−
10
View file @
a29091b3
function
[
d_close
,
ic_mean
]
=
get_distance
(
signal
,
thr
)
function
[
d_close
,
ic_mean
]
=
get_distance
(
signal
,
thr
,
plot_
)
% function to get the estimated distance from a binaural measurement with
% using the interaural coherence
...
...
@@ -30,9 +30,9 @@ requests = {'ic'};
% Parameters of the auditory filterbank processor
fb_type
=
'gammatone'
;
fb_lowFreqHz
=
300
;
fb_highFreqHz
=
2
000
;
fb_nChannels
=
8
;
fb_lowFreqHz
=
100
;
%
300
fb_highFreqHz
=
8
000
;
%2k
fb_nChannels
=
32
;
% Parameters of innerhaircell processor
ihc_method
=
'dau'
;
...
...
@@ -65,16 +65,21 @@ mObj1.processSignal();
%
%
plot
=
0
;
%
plot = 0;
if
plot
if
plot
_
% Plot the original ear signal
dObj1
.
plot
([],[],
'bGray'
,
1
,
'decimateRatio'
,
3
,
'bSignal'
,
1
);
ylim
([
-
1.25
1.25
]);
%
dObj1.plot([],[],'bGray',1,'decimateRatio',3,'bSignal',1);
%
ylim([-
2^16/2 2^16/2
]);
% Plot IC
dObj1
.
ic
{
1
}
.
plot
;
title
(
'Interaural coherence (anechoic)'
)
title
(
'Interaural coherence'
)
lims_x
=
get
(
gca
,
'Xlim'
);
lims_y
=
get
(
gca
,
'Ylim'
);
rectangle
(
'Position'
,[
lims_x
(
1
)
6
sum
(
abs
(
lims_x
))
19
-
6
],
'LineWidth'
,
4
)
% Plot the original ear signal
% dObj2.plot([],[],'bGray',1,'decimateRatio',3,'bSignal',1);
...
...
@@ -90,7 +95,7 @@ ic_Obj = dObj1.ic;
ic_Obj
=
ic_Obj
{
1
}
.
Data
;
ic
=
ic_Obj
(:);
ic_mean
=
mean
(
mean
(
ic
));
ic_mean
=
mean
(
mean
(
ic
(:,
6
:
19
)
));
if
ic_mean
>=
thr
d_close
=
1
;
...
...
This diff is collapsed.
Click to expand it.
state_machine.m
+
2
−
1
View file @
a29091b3
...
...
@@ -20,7 +20,7 @@ while(true)
end
% The angle to the source is small enough, take a step forward
[
there
,
ic
]
=
get_distance
(
audio
,
th_dist
);
[
there
,
ic
]
=
get_distance
(
audio
,
th_dist
,
0
);
if
~
there
sendPosition
.
moveRelativePosition
(
'map'
,
step_distance
,
0
,
0
);
...
...
@@ -30,6 +30,7 @@ while(true)
% We are there, analyze the source
audio
=
get_audio
(
12000
);
[
source_num
,
source_name
]
=
analyze_source
(
audio
,
fs
);
[
there
,
ic
]
=
get_distance
(
audio
,
th_dist
,
1
);
display
(
'Source label determined'
)
disp
(
source_name
)
...
...
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