6.2.2 CMSave

Module Overview

Saves the sound source correlation matrix to a file.

Requested Files

None.

Usage

In what case is the node used?

Use when saving the correlation matrix for a sound source, created from CMMakerFromFFT  or CMMakerFromFFTwithFlag , etc.

Typical Examples

Figure. 6.11 shows a usage example of CMSave  node.

INPUTCM input terminal is connected with a correlation matrix calculated from CMMakerFromFFT  or CMMakerFromFFTwithFlag , etc. (type is Matrix<complex<float> >  type, but to process correlation matrices, convert it from a three dimensional complex array to a two dimensional complex array and then output). FILENAMER and FILENAMEI are string  type inputs, each indicating the saved files name containing the real and imaginary parts of the correlation matrix. OPERATION_FLAG is int  type or bool  type input, specifying when the correlation matrix is read. (Figure. 6.11 shows the connection of an Equal node as an example. However, if the node can output int  type or bool  type, then it does not matter at all).

\includegraphics[width=0.7\linewidth ]{fig/modules/CMSave.eps}
Figure 6.11: Network Example using CMSave 

I/O and property setting of the node

Table 6.15: Parameter list of CMSave

Parameter

Type

Default

Unit

Description

NB_CHANNELS

int 

8

 

Number of channels $M$ of input signal

LENGTH

int 

512

 

Frame length $NFFT$

ENABLE_DEBUG

bool 

false

 

ON/OFF of debugging information output

Input

INPUTCM

Matrix<complex<float> >  type. Correlation matrix of each frequency bin. $M$-th order complex square array with correlation matrix outputs $NFFT/2 + 1$ items. Matrix<complex<float> >  indicates the row of frequency ($NFFT/2 + 1$ rows), and column of complex correlation matrix ($M * M$ columns).

FILENAMER

string  type. Name of file containing the real part of the correlation matrix.

FILENAMEI

string  type. Name of file containing the imaginary part of the correlation matrix.

OPERATION_FLAG

int  type or bool  type. Only when this input terminal is 1 or when true, the correlation matrix is saved.

Output

OUTPUTCM

Matrix<complex<float> >  type. Same as INPUTCM.

Parameter

NB_CHANNELS

int  type. Number of channels for input signal. Equivalent to the order of the correlation matrix. Must be matched with the order of the former correlation matrix used. Default value is 8.

LENGTH

int  type. Default value is 512. FFT points at the time of Fourier transform. Must be matched till the former FFT points.

ENABLE_DEBUG

bool  type. Default value is false. When true, it is output to the standard output when saving the correlation matrix.

Module Description

Corrects the correlation matrix to Matrix<float>  type to a $M$-th order complex square array for each frequency bin, and saves with the specified file name. Saved files are divided into real and imaginary parts of the correlation matrix. If the number of frequency bins is $k$, and ($k = NFFT/2 + 1$), then the saved file will store $k$ rows and $M^2$ columns each. Saving is performed only when OPERATION_FLAG is 1 or true.