Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Martin Karlsson
turtlerob1
Commits
4752a980
Commit
4752a980
authored
Sep 25, 2015
by
Fredrik Bagge Carlson
Browse files
bin example
parent
ead83e50
Changes
1
Hide whitespace changes
Inline
Side-by-side
binaulocExample.m
0 → 100644
View file @
4752a980
% Assuming that you already have a 'client' handle, and that the 'binauloc'
% component is running on the turtlebot, load this component.
binauloc
=
client
.
load
(
'binauloc'
)
% Connect the input port of binauloc to the output port of bass, so that
% binauloc receives the raw audio data from bass. Note that the data flow
% goes from bass on the Raspberry Pi to binauloc on the turtlebot. The
% audio data does not pass by Matlab here.
binauloc
.
connect_port
(
'Audio'
,
'bass/Audio'
)
% Setup the parameters of the algorithm. To have a bit more information
% about the role of each parameter, you can call binauloc.Setup('-h'). To
% have further information, c.f. Portello et al. IROS 2013 & IROS 2014
binauloc
.
Setup
(
...
'/home/turtlebot/genom3/activeloc/data/setup'
,
...
% just a file to write parameters in (please do not change)
24414
,
...
% the sample rate
5000
,
...
% the maximum frequency
1024
,
...
% the number of samples per frame (here a frame is a block of audio)
512
,
...
% the overlap between two frames
'::localization::HANNING'
,
...
% the window function
10
,
...
% contributes to the smoothing of the pseudo-likelihood
'/home/turtlebot/genom3/activeloc/data/projector'
,
...
% another file to write data in (please do not change)
'/home/turtlebot/genom3/activeloc/data/noise'
)
% yet another file to write data in (please do not change)
% Learn the noise characteristics. Make sure the environment is silent
% before calling this service!
binauloc
.
LearnNoise
(
2
)
% 2 seconds
% Use the inter-aural transfer function to compute a projector on the space
% spanned by the steering vector [1; inter-aural transfer function]
binauloc
.
PretabProj
(
'/home/turtlebot/genom3/activeloc/steerVecs/steerVecS72'
)
% Start the localization (runs indefinitely, don't forget the '-a' option)
rLocalizeSources
=
binauloc
.
LocalizeSources
(
'-a'
,
1
,
1
,
4
)
% The azimuth detection is now running, you can retrieve the current
% estimated azimuth in p = binauloc.Azimuths(). The value is in radians,
% increasing towards right.
% The localization can be stopped with binauloc.StopLocalization()
\ No newline at end of file
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