14.3.2 Online sound source localization

14.3.2.1 Execution

First, connect your Microcone to a USB port of your computer. Then, run the following command:

> cat /proc/asound/cards 
 0 [AudioPCI       ]: ENS1371 - Ensoniq AudioPCI
                      Ensoniq AudioPCI ENS1371 at 0x2080, irq 16
 1 [Microcone      ]: USB-Audio - Microcone
                      DEV-AUDIO Microcone at usb-0000:02:03.0-1, high speed

If you see the word “Microcone”, the OS successfully recognized it. In this case, its device name is plughw:1 because the number shown in the left side of “Microcone” is one. Open localization_online_microcone.n by flowdesigner, and set DEVICE property of AudioStreamFromMic to plughw:1.

Then, run the script

> ./demo.sh online

You will see the result like Figure 14.9 in your terminal, and visualized sound locations.

 UINodeRepository::Scan()
 Scanning def /usr/lib/flowdesigner/toolbox
 done loading def files
 loading XML document from memory
 done!
 Building network  :MAIN
 TF was loaded by libharkio2.
 1 heights, 72 directions,1 ranges,7 microphones,512 points
 Source 0 is created.
 Source 0 is removed.
   (skipped)
Figure 14.9: Execution example of online sound source localization

14.3.2.2 Checking the result

If you have problem on localization, check the same things as offline localization. You can also refer to the recipe: Localization failed.

14.3.2.3 Sample network description

Seven modules are included in this sample. There is one module in MAIN (subnet) and are six modules in MAIN_LOOP (iterator). MAIN (subnet) and MAIN_LOOP (iterator) are shown in Figures and 14.11. AudioStreamFromMic records the sound. SaveWavePCM stores the sound. Simultaneously, MultiFFT transforms it to spectral representation, LocalizeMUSIC localizes it for each frame, SourceTracker tracks using temporal connectivity, and DisplayLocalization displays it.

\includegraphics{fig/recipes/demo-LocalizationWS8ch-MAIN.png}
Figure 14.10: MAIN (subnet)
\includegraphics{fig/recipes/demo-LocalizationWS8ch-MAIN_LOOP.png}
Figure 14.11: MAIN_LOOP (iterator)

Table 14.11 summarizes the main parameters.

Table 14.11: Parameter list

Node name

Parameter name

Type

Value

MAIN_LOOP

LENGTH

int 

512

 

ADVANCE

int 

160

 

SAMPLING_RATE

int 

16000

 

A_MATRIX

string 

ARG1

 

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