TableLookupLogX
Overview
Log/Anti-log and Linearly spaced table lookup
Discussion
Multichannel input / multichannel output table lookup module. The table lookup is Log, Anti-log or Linear 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 Log, Anti-log or 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.
Type Definition
typedef struct _ModuleTableLookupLogX
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 numPoints; // Number of entries in the table.
INT32 spacingType; // Selects the input spacig type: 0=Log, 1=Anti-log and 2=Linear.
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 log_minX; // Log value of the minX parameter.
FLOAT32 log_maxX; // Log value of the maxX parameter.
FLOAT32 logspace_delta; // Logspace delta for input.
FLOAT32 divisor; // Precomputed constant = (NUM_POINTS-1)/(log_maxX - log_minX) to eliminate division on the target.
FLOAT32* table; // Table of evenly spaced values.
} ModuleTableLookupLogXClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
numPoints | int | const | 0 | 10 | 2:1:5000 | |
spacingType | int | const | 0 | 0 | 0:2:1 | |
interpolationType | int | parameter | 0 | 1 | 0:1:1 | |
minX | float | parameter | 0 | 1 | -1000:1000 | |
maxX | float | parameter | 0 | 10 | -1000:1000 | |
log_minX | float | state | 0 | 0 | Unrestricted | |
log_maxX | float | state | 0 | 0 | Unrestricted | |
logspace_delta | float | state | 0 | 0 | Unrestricted | |
divisor | float | state | 0 | 0 | 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: 1
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: float
MATLAB Usage
File Name: table_lookup_logx_module.m
M=table_lookup_logx_module(NAME, NUM_POINTS, SPACING)
Creates a table lookup module for use in the Audio Weaver environment.
This module has 1 multichannel input and 1 multichannel output and performs
log/anti-log or liniear spaced table lookup using nearest or linear interpolation scheme.
Arguments:
NAME - name of the module.
NUM_POINTS - size of the table.
SPACING - Log/Anti-log or linear spacing on inputs. 0 - Log, 1 -
Anti-log and 2 - Linear
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 Log/Anti-log or 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.