Overview
Copies the data at the input pin and writes it in an CSV file
Discussion
The file sink module copies the data at the input pin to an .csv file. The copy operation occurs at each block process and thus the data continuously written to file. User has to specify the file path and file name as an argument where output file to be created and written. If the file path is not specified then the default Matlab location, pwd, will be used and if the file name is not specified then the heirarchy name will be used as the file name. The module also expects output format of the data to be written to the file, like float, int or fract32. If it is null then the format will be derived from the input pin type.
...
The first row of the output csv file contins block size, number of chnnels, data type and sample rate of the system. Each row of the output csv file contains the data of each channel of the input pin. The module will work with any data type of both real and complex data.
Type Definition
Code Block |
---|
typedef struct _ModuleFileSink { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 fullFileSize; // Size of the array to hold the full file path of the output .csv file INT32 initialize; // Flag which controls initial configurations INT32* FullFileName; // Complete file path of the output .csv file to be written data INT32* OutputFormatString; // Format of the output data to be written to .csv file INT32* DataType; // Data type of the input pin FILE * filePtr; // File pointer of the output .csv file } ModuleFileSinkClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
fullFileSize | int | derived | 1 | 6 | Unrestricted | |
initialize | int | state | 1 | 1 | Unrestricted | |
FullFileName | int* | parameter | 1 | [1 x 6] | Unrestricted | |
OutputFormatString | int* | parameter | 1 | [1 x 1] | Unrestricted | |
DataType | int* | parameter | 1 | [1 x 2] | Unrestricted | |
filePtr | FILE * | state | 1 | Unrestricted |
Pins
Input Pins
Name: in
Description: audio input
...
Complex support: Real and Complex
MATLAB Usage
File Name: file_sink_module.m
...