Loads a data file created by SaveVectorFrames into the Vector<float> type or the Vector<complex<float> > type per frame.
A data file in either text format (TEXT) or binary format (RAW) created by created by SaveVectorFrames .
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 .
Input
No inputs.
Output
: Vector<float> or Vector<complex<float> > of the Vector<ObjectRef> type. Data of frames.
: 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
Parameter name |
Type |
Default value |
Unit |
Description |
FILENAME |
The name of the data file to load. |
|||
INPUT_TYPE |
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 |
512 |
The column size of the Vector<ObjectRef> type in which data in the data file are to be restored. |
: string type. The name of the data file to load.
: 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.
: 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 .
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.
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 .
INPUT_TYPE |
Output Type |
Text Float |
|
Raw Float |
|
Text Complex Float |
|
Raw 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.