6.7.28 SaveVectorFrames Outline of the node

Saves data of frames in the Vector<ObjectRef>  type in a file. Note that the supported ObjectRef are the float type and the complex<float> type only. Necessary file

No files are required. Usage

When to use

This node is used to save data stored in the Vector<ObjectRef> type for multiple frames in one file.

Typical connection

Figure 6.137 shows a connection example using SaveVectorFrames in a network. In this network, SaveVectorFrames takes data outputted in the SPECTRUM terminal, the hidden output of LocalizeMUSIC , as the input. The data is power of the MUSIC spectrum for every direction. For future use or for documentation, SaveVectorFrames can be used to save the data in a file. For more information on LocalizeMUSIC hidden output SPECTRUM, see LocalizeMUSIC Node Reference, specifically LocalizeMUSIC ’s Input-output and property of the node.

\includegraphics[width=.8\textwidth ]{fig/modules/SaveVectorFrames}
Figure 6.137: Connection example of SaveVectorFrames Input-output and property of node



: Data of frames in the Vector<ObjectRef> type. The supported types are the Vector<float> type and the Vector<complex<float> > type.



: A file in which data in the Vector<ObjectRef> type for multiple frames were saved.


Table 6.132: Parameter list of SaveVectorFrames 

Parameter name


Default value






The file name of the output file.





The file format options for the output file. Select TEXT for a text file or RAW for a binary file.


: string  type. The file name for the output file.


: string  type. The file format options for the output file. Select TEXT for text files or RAW for binary files. The default value is TEXT. Details of the node

SaveVectorFrames takes data in either the Vector< float > type or the Vector<complex<float> > type for multiple frames as the input and then saves all data in one file. The file format is to be specified in the OUTPUTTYPE parameter. When the OUTPUTTYPE parameter is set to RAW, data of frames will be written in IEEE 754 32-bit single-precision floating-point number format by little- endian order. The default value of this parameter, TEXT, will output human-readable data unlike RAW.

Table 6.133 shows the details of how data will be formatted in the file when TEXT is selected in the OUTPUTTYPE parameter. Each data is separated by space and the data of frames are separated per frame in the Vector size by a line feed.

Table 6.133: File Format for TEXT OUTPUTTYPE


File Format


data[0] data[1] data[2] ... data[n]


data[0] data[1] data[2] ...... data[n]



data[0].real() data[0].imag() data[1].real() data[1].imag() ... data[n].real() data[n].imag()




Where n is based on the Vector size of the input data.

SaveVectorFrames checks the size of the Vector when it receives the data. In the sample network above (Figure 6.137), LocalizeMUSIC outputs Vector< float > . When the transfer function specified in the LocalizeMUSIC generated from 72 sound sources, the expected vector size will be 72. A transfer function is a model of sound propagation. The number of sound sources of a transfer function is one of the factors that affects the vector size and it is decided during transfer function creation. For more information on transfer function, please see a video on "HARK Transfer Function Tutorial" at https://www.hark.jp/document/harktv/. The detailed documents for generating Transfer Function can be found at https://www.hark.jp/document/transfer-function-generation-manuals/ as well.

Suppose the input data were stored in the Vector<float> type where the column size is 72 and there are 6397 frames in total, the contents of the output data file will be like one shown in Figure 6.138. It is assumed that the data were saved in the TEXT file format described in the Table 6.133.

\includegraphics[width=.8\textwidth ]{fig/modules/SaveVectorFrames-2}
Figure 6.138: Sample SaveVectorFrames Output File Content for TEXT Float Type

Note that the Frame numbers written on the left side of Figure 6.138 and Figure 6.139 are not written in the files.

Figure 6.139 gives sample contents of the output file when the input data were in the Vector<complex<float> > type like ones in the sample network given by Figure 6.137. The column size is 71 for each frame. There are 6397 frames in total. It is also assumed that the data were saved in the TEXT file format described in the Table 6.133.

\includegraphics[width=.8\textwidth ]{fig/modules/SaveVectorFrames-3}
Figure 6.139: Sample SaveVectorFrames Output File Content for TEXT Complex Float Type


An option to use a special pattern, {tag:format}, with the data properties as known as a format string is available when specifying the value in the FILENAME parameter. The format string allows the users to set a filename which contains the information of the input data and so convenient for the later use.
The available tags are listed in the Table 6.134.

Table 6.134: Tag list of SaveVectorFrames 





Data Type (float or complex float)



Column size of Vector



Data Dimension (Fixed value. 1 for Vector)


The examples of the format string and the output are given in the Table 6.135.

Table 6.135: Examples of the format string and the output for Vector<complex<float> > where the Vector size is 20.

Format String (Parameter FILENAME value)

Output (Formatted Filename)











It is required to specify the column size and the data type in parameters when using LoadVectorFrames to load a file outputted by SaveVectorFrames into the Vector<ObjectRef> type. Hence, having data information in the filename will be useful for the later use.

As indicated in the Table 6.135, there is no rules on the file name extension. It can be any as user specify. It allows to have no file name extensions as well.

The value for "format" in {tag:format} is optional. The "format" can be used to specify the number of digits, for instance, 03d where the format specifiers are the same as the ones of printf in C.