3.3.3 Creating a network for beginners

This section shows an example of building a sound source localizing network for users who are creating such a network for the first time. As well as the main network tab, the subnetwork tab for Iteration is needed. First, we will build a sound source waveform reader in the main tab, then create a subnetwork and build localization and result display parts in the subnetwork.

We first describe the modular arrangement of the sound source waveform reading part, as well as its connections and property settings. Start FlowDesigner, and the MAIN (subnet) tab will appear on the right side of the window. Proceed to work in this tab first. Add the Constant node and the InputStream node as shown in Figure 3.4. Right-click on the grey background in the tab, and a pull-down menu will appear. Move the mouse cursor onto New Node, and the list of nodes registered in FlowDesigner will be displayed. Here, select the General category, and the list of nodes registered in General will be displayed. The Constant node is included in this list. From there, move the mouse cursor onto Constant to add a Constant node in the MAIN (subnet) tab. In the following descriptions, an operation to select this node out of a pull-down menu is indicated as “New Node $\rightarrow $ General $\rightarrow $ Constant". In the same way, add the InputStream node as New Node $\rightarrow $ IO $\rightarrow $ InputStream.

\includegraphics[width=120mm]{fig/FirstStep/tutorial1-1}
Figure 3.4: Addition of two nodes

Next, connect the Constant node and an InputStream node as shown in Figure3.5.

\includegraphics[width=120mm]{fig/FirstStep/tutorial1-2}
Figure 3.5: Connections of two nodes

Next, set properties of the node. Here, set only the Constant node. The InputStream node does not have settable property values. Right-click on the Constant node and select Properties to reveal the property setting dialog. The dialog contains Parameters, Comments and Inputs/Outputs tabs, with the Parameters tab open by default. The Comments tab and Inputs/Outputs tab are not used. The Parameters tab contains three items NAME, Type and Value. NAME is for a property name, Type indicates a data type of values to be set, Value indicates the value to be designated for attributes. The Constant node has only one settable property, which has the attribute name VALUE. Since a file name is to be indicated in this node, give tutorial1.wav for the file name in the property value. The data type is string . Finally, save the settings by pressing “Apply" in the "Properties" window, followed by "Close". Alternatively, pressing “OK” to perform these two operations simultaneously. Since the user cannot operate other windows of FlowDesigner while the "Properties" window is displayed, it is necessary to finish the property setting before returning to such operations. Here, the property setting is complete, and a network to read from a sound source waveform has been created.

Next, we describe subnetwork creation. A subnetwork is created by selecting "Add Iterator" from the "Networks" menu in FlowDesigner. Select “Add Iterator" to enter a name for the Iterator tab. If using the default name "LOOP0", press "OK". Subnetwork creation is cancelled by pressing the cancel button. Clicking on "OK" for LOOP0, a tab named "LOOP0" appears next to the MAIN (subnet) tab and the LOOP0 tab becomes active. Build a localization part and result display part in this tab. This sound source localization subnetwork is built with nodes for file reading, FFT, sound source localization using the MUSIC method, sound source tracking and localization result display. Figure 3.6 shows nodes added using the following procedures.

New Node $\rightarrow $ HARK $\rightarrow $ AudioIO $\rightarrow $ AudioStreamFromMic 
New Node $\rightarrow $ HARK $\rightarrow $ MISC $\rightarrow $ MultiFFT 
New Node $\rightarrow $ HARK $\rightarrow $ Localization $\rightarrow $ LocalizeMUSIC 
New Node $\rightarrow $ HARK $\rightarrow $ Localization $\rightarrow $ SourceTracker 
New Node $\rightarrow $ HARK $\rightarrow $ Localization $\rightarrow $ DisplayLocalization 

\includegraphics[width=120mm]{fig/FirstStep/tutorial1-3}
Figure 3.6: Nodes for sound source localizing part

Connect these nodes as shown in Figure 3.7.

\includegraphics[width=120mm]{fig/FirstStep/tutorial1-4}
Figure 3.7: Connection of node for sound source localizing part

After completing the connection, set node properties, assuming the audio file to be processed is 16,000 [Hz]. In the AudioStreamFromWave node, there are three property values LENGTH, ADVANCE and USE_WAIT. LENGTH and ADVANCE indicate the analysis frame length and frame shift length of speech by unit samples, respectively. The data type is int . Default values 512 and 160 are set, which correspond to 32 msec and 10 msec, respectively. The user does not need to change these values. The default value falseis set in USE_WAIT of the data type bool . The user does not need to change these values.

In the MultiFFT node, there are three properties to set LENGTH, WINDOW and WINDOW_LENGTH. The analysis frame length, window function type and window length of the sound are expressed in unit samples. The default values 512, CONJ and 512 are set. LENGTH and WINDOW_LENGTH correspond to 32 msec and its data type is int . CONJ designates the user to use the CONJ window as an analysis window. Its data type is string . The user does not need to change these values. LocalizeMUSIC nodes have nineteen properties to set MUSIC_ALGORITHM, TF_CHANNEL_SELECTION, LENGTH, SAMPLING_RATE, A_MATRIX, ELEVATION, WINDOW, PERIOD, NUM_SOURCE, MIN_DEG, MAX_DEG, LOWER_BOUND_FREQUENCY, UPPER_BOUND_FREQUENCY, SPECTRUM_WEIGHT_TYPE, A_CHAR_SCALING, MANUAL_WEIGHT_SPLINE, MANUAL_WEIGHT_SQUARE, ENABLE_EIGENVALUE_WEIGHT, and DEBUG. The details of those parameters are given in the Parameters section in LocalizeMUSIC . The example of the parameter setting is shown below.

For the DisplayLocalization node, there is one property for the value of LOG_IS_PROVIDED. To perform logging of the source locations, set true. Its data type is bool , and the default value is false. The user does not need to change these values.

Next, set Iterator. Iterator can be considered as a subroutine of MAIN (subnet) and requires INPUT, OUTPUT and CONDITION. INPUT and OUTPUT can be likened to the input and output of the subroutine. Iterator repeatedly performs processing while it is the subroutine; therefore, the user needs to describe CONDITION, which is the loop’s halt condition. Set it as shown in Figure 3.8. To set INPUT, left-click on the input terminal while holding down Shift. Press “OK" and “INPUT" will be displayed on the input terminal in red letters. To set OUTPUT, left-click on the input terminal while holding down Shift. Press “OK," and “OUTPUT" will be displayed on the terminal in blue letters. CONDITION is set by left-clicking on the output terminal while holding down Control. “CONDITION" is displayed in purple. When setting INPUT, OUTPUT or CONDITION in an unintended location, the user may cancel the setting by left-clicking on those letters while pressing Shift.

\includegraphics[width=120mm]{fig/FirstStep/tutorial1-5}
Figure 3.8: Setting of INPUT, OUTPUT and CONDITION on sound source localization node

Finally, integrate Iterator and Subnet. Return to the network display of MAIN (subnet) by pressing the MAIN (subnet) tab. Left-click on the grey background and move the mouse cursor onto New Node; a new item named subnet should have appeared on the node category name, with an item named LOOP0. Left-click on LOOP0, similar to when creating a node, and a node named LOOP0 with one input and one output will be added. In other words, the subnetwork described in LOOP0 (Iterator) is made with this virtual node. To complete the source localization network, connect InputStream to LOOP0 and set OUTPUT on LOOP0 as shown in Figure 3.9.

\includegraphics[width=120mm]{fig/FirstStep/tutorial1-6}
Figure 3.9: Source localization network completed