Skip to content

TableLookupV2

Overview

Evenly spaced table lookup

Discussion

Multichannel input / multichannel output table lookup module. The table lookup is evenly spaced, using a variety of interpolation methods. The module performs lookup as Y=f(X) where X is the input to the module and Y is the output. The module contains a table of values which are assumed to be linearly spaced. The first value in the table corresponds to the function value at .minX. The last value in the table corresponds to the function value at .maxX. The field .interpolationType determines how the interpolation occurs.

.interpolationType = 0 - output the nearest value .interpolationType = 1 - linear interpolation between the two nearest values.

Input values outside of the range [minX maxX] are clipped.

Module Pack

Standard

ClassID

classID = 221

Type Definition

typedef struct _ModuleTableLookupV2
{
ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
INT32 L;                                      // Number of entries in the table.
INT32 interpolationType;                      // Selects the type of interpolation: 0=nearest, 1=linear.
FLOAT32 minX;                                 // X value corresponding to the first table entry.
FLOAT32 maxX;                                 // X value corresponding to the last table entry.
FLOAT32 divisor;                              // Precomputed constant = (L-1)/(maxX-minX) to eliminate division on the target.
INT32 tableHeap;                              // Heap in which to allocate memory.
FLOAT32* table;                               // Table of evenly spaced values.
} ModuleTableLookupV2Class;

Variables

Properties

Name Type Usage isHidden Default Value Range Units
L int const 0 10 2:1:5000
interpolationType int parameter 0 1 0:1:1
minX float parameter 0 -1 -1000:1000
maxX float parameter 0 1 -1000:1000
divisor float state 0 0 Unrestricted
tableHeap int const 1 2 Unrestricted
table float* parameter 0 [10 x 1] Unrestricted

Pins

Input Pins

Name in
Description audio input
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real

Output Pins

Name out
Description audio output
Data Type float

Matlab Usage

File Name: table_lookup_v2_module.m 
 M=table_lookup_v2_module(NAME, L, MEMHEAP) 
 Creates a table lookup module for use in the Audio Weaver environment.  
 This module has 1 multichannel input and 1 multichannel output and performs 
 evenly spaced table lookup using a variety of interpolation schemes.   

 Arguments: 
    NAME - name of the module. 
    L - size of the table. 
    MEMHEAP - specifies the memory heap to use to allocate the table 
         buffer. This is a string and follows the memory allocation 
         enumeration in Framework.h. Allowable values are: 
            'AWE_HEAP_FAST' - always use internal DM memory. 
            'AWE_HEAP_FASTB' - always use internal PM memory. 
            'AWE_HEAP_SLOW' - always use external memory (the default). 
            'AWE_HEAP_FAST2SLOW' - use internal memory. If this fails 
               then use external memory (the default). 

 The module performs lookup as Y=f(X) where X is the input to the module 
 and Y is the output. The module contains a table of values which are 
 assumed to be linearly spaced. The first value in the table corresponds 
 to the function value at .minX. The last value in the table corresponds 
 to the function value at .maxX. The field .interpolationType determines 
 how the interpolation occurs. 
   .interpolationType = 0, output the nearest value. 
   .interpolationType = 1, linear interpolation between the two nearest 
                           values. 

 Input values outside of the range [minX maxX] are clipped. 

Copyright (c) 2026 DSP Concepts, Inc.