Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Overview

Sets filter coefficients in other modules

Discussion

The Coeff Table module, also called the Param Set Table module, writes the values of one column of a statically defined table to an internal array of another module. A common use case is to update the coefficients of an FIR module based on changing conditions in the system.

The numCols variable determines the number of vectors that can be stored in the internal table, and the numRows variable determines the length of each vector. It is the responsibility of the user to ensure that the numRows variable matches the size of the target module's array. The integer value of the input pin is used to select which column to copy to the target module's array.

See the Param Set module documentation for more detail on how to specify the target module's array, and the meaning of each setBehavior type.

Type Definition

typedef struct _ModuleCoeffTable
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 index;                                  // current index to coeff table
    INT32 numRows;                                // the size of each vector
    INT32 numCols;                                // the number of vectors
    INT32 setBehavior;                            // Controls the behavior of the module
    FLOAT32* coeff;                               // 2-D coeff table.
    void * modPtr;                                // Points to the module to set
    void * varPtr;                                // Points to the variable to set within the module instance structure
} ModuleCoeffTableClass;

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

setBehavior

int

parameter

0

3

Unrestricted

coeff

float*

parameter

0

[5 x 1]

Unrestricted

modPtr

void *

parameter

1

Unrestricted

varPtr

void *

parameter

1

Unrestricted

Pins

Input Pins

Name: in

Description: parameter value

Data type: int

Channel range: 1

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

MATLAB Usage

File Name: coeff_table_module.m

 M=coeff_table_module(NAME, DATATYPE, NUMROWS, NUMCOLS, MODVAR)
 Coefficients table set module.  This module can reach into the instance structure
 of other modules and set filter coefficients.  Arguments:
    NAME - name of the module.
    DATATYPE - string specifying the data type of the variable and this
               is also used for the data type of the input pin.  Allowable
               values are'int'.
    NUMROWS - the dimension X of internal coefficient table.
    NUMCOLS - the dimension Y of internal coefficient table.
    MODVAR - specifies the module and variable name using the form:
              'MOD.VAR' where MOD is the module name and VAR is the 
              variable name.  You can also specify internal subsystems using
              'SUBSYS.MOD.VAR'.

  • No labels