14.3.1 Off line sound source localization

Run the demoOffline8ch.sh in Localization directory. You will see the output such as 14.6 in terminal and visualized locations. This script reads four 8ch sound files and visualizes the locations. Each files includes sounds from 0, 90, 180, and 270 degrees, respectively.

$>$ demoOffline8ch.sh
Display sounds from 000 degrees
UINodeRepositoryScan()
Scanning def /usr/lib/flowdesigner/toolbox
done loading def files
loading XML document from memory
done!
Building network MAIN
reading A matrix
Identifier is different from HARK’s oneH
Try to read ../config/music.dat as header-less MUSIC transfer function format.
72 directions, 1 ranges, 8 microphones, 512 points
done
initialize
Source 0 is created.
Source 0 is removed.
Omitted
Source 9 is created.
Source 9 is removed.
Vector<ObjectRef> 
Vector<ObjectRef> 
Display sounds from 000 degrees
Figure 14.6: Execution example of demoOffline8ch.sh.

After you ran the script, you will find three text files in the directory, Localization000.txt, Localization090.txt, Localization180.txt and Localization270.txt. These files are the localization logs containing frame numbers and sound directions. See the format chapter in the HARK document.

If you fail to run the script, check the following things

  1. Check if f101_000.wav, f101_090.wav, f101_180.wav and f101_270.wav are in the ../data directory. These files are simulation synthetic sounds of the 8ch sound recording audio waveforms to which impulse responses from the 0, 90, 180 and 270 degrees direction are superimposed. They are interpreted as sounds obtained in the case sounds are given to a virtual robot from each direction. Sound source localization results are not displayed without these files.

  2. Check if the music.dat files are in the ../config directory. They are the impulse response files of a virtual robot. Sound source localization results are not displayed without these files.

This sample has ten nodes. Three nodes are in MAIN (subnet) and seven nodes are in MAIN_LOOP (iterator). MAIN (subnet) and MAIN_LOOP (iterator) are shown in Figures and . The audio waveforms which collected with AudioStreamFromWave module are analyzed in MultiFFT and sound source localization is performed in LocalizeMUSIC . It is a netwok structure in which Localization results are tracked with SourceTracker and SourceIntervalExtender , displayed in DisplayLocalization and written in files in SaveSourceLocation .

\includegraphics{fig/recipes/demo-LocalizationOffline8ch-MAIN.png}
Figure 14.7: MAIN (subnet)
\includegraphics{fig/recipes/demo-LocalizationOffline8ch-MAIN_LOOP.png}
Figure 14.8: MAIN_LOOP (iterator)

Table 14.9 summarizes the main parameters. Note that the parameter A_MATRIX, which specifies a file name of transfer function for localization made with harktool3, is crucial.

Table 14.9: Parameter list

Node name

Parameter name

Type

Value

MAIN_LOOP

LENGTH

int 

512

 

ADVANCE

int 

160

 

SAMPLING_RATE

int 

16000

 

A_MATRIX

int 

ARG2

 

FILENAME

subnet_param 

ARG3

 

DOWHILE

bool 

(empty)

LocalizeMUSIC 

NUM_CHANNELS

int 

8

 

LENGTH

subnet_param 

LENGTH

 

SAMPLING_RATE

subnet_param 

SAMPRING_RATE

 

A_MATRIX

subnet_param 

A_MATRIX

 

PERIOD

int 

50

 

NUM_SOURCE

int 

1

 

MIN_DEG

int 

-180

 

MAX_DEG

int 

180

 

LOWER_BOUND_FREQUENCY

int 

500

 

HIGHER_BOUND_FREQUENCY

int 

2800

 

DEBUG

bool 

false