6.7.7 LoadVectorFrames

6.7.7.1 Outline of the node

Loads a data file created by SaveVectorFrames into the Vector<float> type or the Vector<complex<float> > type per frame.

6.7.7.2 Necessary files

A data file in either text format (TEXT) or binary format (RAW) created by created by SaveVectorFrames .

6.7.7.3 Usage

When to use

This node is used to restore data of frames saved in a file in advance by SaveMatrixFrames to either the Vector<float> type or the Vector<complex<float> > type so that the data in the file can be processed.

Typical connection

Figure 6.104 below shows a connection example using LoadVectorFrames in a network. This sample network is for display the location of the input sound source(s) in the end. Instead of the hidden output terminal of LocalizeMUSIC , for the MUSIC_SPEC input terminal of NormalizeMUSIC , LoadVectorFrames outputs power of the MUSIC spectrum for every direction in the Vector<float> type. NormalizeMUSIC then can use both source positons determined by LocalizeMUSIC and MUSIC spectrum provided by LoadVectorFrames to stabilize the sound source detection by SourceTracker .

\includegraphics[width=.9\textwidth ]{fig/modules/LoadVectorFrames}
Figure 6.104: Connection Example of LoadVectorFrames 

6.7.7.4 Input-output and property of the node

Input

No inputs.

Output

OUTPUT

: Vector<float> or Vector<complex<float> > of the Vector<ObjectRef> type. Data of frames.

NOT_EOF

: bool type. A flag to indicate whether or not the end of file has been reached when a program is reading the data file. It is set to false when the program reaches the end of the data file. Then, the program will be terminated. Otherwise, it is being set to true.

Parameter

Table 6.92: Parameter list of LoadVectorFrames 

Parameter name

Type

Default value

Unit

Description

FILENAME

string 

   

The name of the data file to load.

INPUT_TYPE

string 

TEXT_float

 

The file format and the data type of the data file. Select TEXT_float, RAW_float, TEXT_complex_float, or RAW_complex_float.

COL_SIZE

int 

512

 

The column size of the Vector<ObjectRef> type in which data in the data file are to be restored.

FILENAME

: string type. The name of the data file to load.

INPUT_TYPE

: string type. The file format and the data type of the data file to load. Select appropriate one from the drop-down menu. Four options are available as follows.

  • TEXT_float

  • RAW_float

  • TEXT_complex_float

  • RAW_complex_float

The default value is set to TEXT_float. If the wrong value is selected, the Network will not run successfully.

COL_SIZE

: int type. The column size of the Vector<ObjectRef> type in which data in the data file are to be restored. If the wrong value is specified, the network will not run successfully. Default value is 512.

To make the parameter value settings for LoadVectorFrames easier, it is strongly recommended to use a special pattern, {tag:format}, aka a format string, when saving data in a file by SaveVectorFrames . The file name will then contain the data type and the column size of the Vector<ObjectRef> type in which the data in the data file are to be restored.

The example format strings and the outputs are given below in the Table 6.93 below for each parameter except FILENAME. For more details on {tag:format}, refer to SaveVectorFrames node reference specifically, Tag list of SaveVectorFrames .

Table 6.93: Example format strings and the outputs for the Vector<complex<float> > where the column size is 20

Format String (FILENAME parameter value)

Output (Formatted Filename)

samplefile.dat

samplefile.dat

samplefile_{datatype}.txt

samplefile_complex_float.txt

samplefile_col{colsize}.raw

samplefile_col20.raw

samplefile_dim{dim}.dat

samplefile_dim1.dat

samplefile_{datatype}_col{colsize}_dim{dim}.dat

samplefile_complex_float_col20_dim1.dat

Putting appropriate file extension will also be helpful to save the time to find out the file format. If not, the TEXT type is a text file and the RAW type is a binary file. In Ubuntu platform, RAW files cannot be accessed by text editors whereas they can be opened in Windows. In any case, RAW files are not "human-readable" unlike TEXT files.

6.7.7.5 Details of the node

LoadVectorFrames reads a file generated by SaveVectorFrames and then restore the data in the file to either the Vector<float> type or the Vector<complex<float> > type per frame. The iteration process for loading data into the Vector<ObjectRef> type per frame will be conducted by following the parameter values specified in the INPUT_TYPE and the COL_SIZE. Table 6.94 below shows the all available INPUT_TYPE parameter values and the corresponding output data types in LoadVectorFrames .

Table 6.94: LoadVectorFrames Output Type

INPUT_TYPE

Output Type

Text Float

Vector<float> 

Raw Float

Vector<float> 

Text Complex Float

Vector<complex<float> > 

Raw Complex Float

Vector<complex<float> > 

When reaching the end of file of the data file, LoadVectorFrames sets NOT_EOF to false so that the iteration process for loading data from the file into Vector<ObjectRef> can be terminated.