Loads a data file created by SaveMatrixFrames into the Matrix<float> type or the Matrix<complex<float> > type per frame.
A data file in either text format (TEXT) or binary format (RAW) created by SaveMatrixFrames .
When to use
This node is used to restore data of frames saved in a file in advance by SaveMatrixFrames to either the Matrix<float> type or the Matrix<complex<float> > type so that the data in the file can be processed.
Typical connection
Figure 6.103 below shows a connection example using LoadMatrixFrames in a network. This sample network is for producing a wav file in the end from data of frames in the Matrix type saved in a data file. Since Synthesize accepts data only in the Map $<$int , Vector<complex<float> > $>$ type, MatrixToMap is needed between LoadMatrixFrames and Synthesize for data type conversion.
Input
No inputs.
Output
: Matrix<float> or Matrix<complex<float> > of the Matrix<ObjectRef> types. 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
: 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 row size of the Matrix<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 8.
: int type. The column size of the Matrix<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.
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. |
||
ROW_SIZE |
8 |
The row size of the Matrix<ObjectRef> type in which data in the data file are to be restored. |
||
COL_SIZE |
512 |
The column size of the Matrix<ObjectRef> type in which data in the data file are to be restored. |
To make the parameter value settings for LoadMatrixFrames easier, it is strongly recommended to use a special pattern, {tag:format}, aka a format string, when saving data in a file by SaveMatrixFrames . The file name will then contain the data type, the row size, and the column size of the Matrix<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.90 below for each parameter except FILENAME. For more details on {tag:format}, refer to SaveMatrixFrames node reference specifically, Tag list of SaveMatrixFrames .
Format String (FILENAME parameter value) |
Output (Formatted Filename) |
samplefile.dat |
samplefile.dat |
samplefile_{datatype}.txt |
samplefile_complex_float.txt |
samplefile_row{rowsize}.raw |
samplefile_row8.raw |
samplefile_col{colsize}.dat |
samplefile_col512.dat |
samplefile_dim{dim}.dat |
samplefile_dim2.dat |
samplefile_{datatype}_row{rowsize}_col{colsize}_dim{dim}.dat |
samplefile_complex_float_row8_col512_dim2.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.
LoadMatrixFrames reads a file generated by SaveMatrixFrames and then restore the data in the file to either the Matrix<float> type or the Matrix<complex<float> > type per frame. The iteration process for loading data into the Matrix<ObjectRef> type per frame will be conducted by following the parameter values specified in the INPUT_TYPE, the ROW_SIZE, and the COL_SIZE. Table 6.91 below shows the all available INPUT_TYPE parameter values and the corresponding output data types in LoadMatrixFrames .
INPUT_TYPE |
Output Type |
Text Float |
|
Raw Float |
|
Text Complex Float |
|
Raw Complex Float |
When reaching the end of file of the data file, LoadMatrixFrames sets NOT_EOF to false so that the iteration process for loading data from the file into Matrix<ObjectRef> can be terminated.