Document toolboxDocument toolbox

(8.D.1.2) Tablesource

Overview

Copies the column data pointed to by Index to the output wire

Discussion

This module maintains a user configurable 2D array (table) of user data (int, float, Fract32). At the input pin it accepts an integer index that is used as a column index selector of the table. All the elements of the selected column are then output at the output wire.

The column selector index is zero-based and will be internally limited to the allowable range of the table. If input index is less than zero, then the first column will be selected. If index is greater than numCols, then the last column will be selected. Only the first element of the input pin is considered as the column selector. All other values are ignored.

Type Definition

typedef struct _ModuleTablesource { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 index; // current column index into the multi-dimensional array INT32 numRows; // the size of each vector INT32 numCols; // the number of vectors FLOAT32* coeff; // 2-D table. } ModuleTablesourceClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

index

int

parameter

0

0

Unrestricted

 

numRows

int

const

0

5

Unrestricted

 

numCols

int

const

0

1

Unrestricted

 

coeff

float*

parameter

0

[5 x 1]

Unrestricted

 

Pins

Input Pins

Name: in

Description: Input signal

Data type: int

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: Output data

Data type: float

MATLAB Usage

File Name: tablesource_module.m

M = tablesource_module(NAME, DATATYPE, NUMROWS, NUMCOLS, ISCOMPLEX) The module maintains a user configurable 2D array (table) of user data (int, float, fract32). At the input pin it accepts an integer index that is used as a column index selector of the multi-dimensional array. All the elements of the selected column are then output at the output wire. Arguments: NAME - Name of the module DATATYPE - String specifying the data type of the array elements. Also used for the data type of the output pin. Allowable values are 'int', 'float', or 'fract32' NUMROWS - Number of rows of the table NUMCOLS - Number of columns of the table ISCOMPLEX - Boolean indicating whether the table and output data is complex. By default, ISCOMPLEX = 0