Skip to content

TableInterpRuntimeMulti

Overview

Per-channel table driven interpolation with ping-pong coefficient update.

Discussion

This module performs table-driven interpolation with one independent XY lookup table per input channel. Each channel has its own X and Y value pairs, so different channels can follow completely different transfer curves.

Supported interpolation modes:

  • order = 1 — Linear interpolation (first-order polynomial per segment).
  • order = 3 — Cubic (DSPC) interpolation — shape-preserving, no overshoot.

The XY table is stored channel-major. Columns (ch-1)*maxPoints+1 through ch*maxPoints belong to channel ch. Within a channel, column i holds [X_i; Y_i].

MAXPOINTS sets the per-channel memory allocation at design time. At run time numPoints controls how many points are actively used (4 <= numPoints <= MAXPOINTS).

Coefficient update uses a double-buffered ping-pong scheme. The set function always writes to the inactive half-buffer then atomically flips activeBuffer, so the process function always reads a fully computed, consistent set of coefficients regardless of when the update occurs.

If the input x falls outside the range of values in the XY table then the input is clipped to the allowable range.

Module Pack

Advanced

ClassID

classID = 1462

Type Definition

typedef struct _ModuleTableInterpRuntimeMulti
{
ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
INT32 maxPoints;                              // Maximum number of values per channel in the lookup table
INT32 numPoints;                              // Current number of interpolation points in use (per channel)
INT32 order;                                  // Interpolation order: 1 = linear, 3 = cubic (DSPC)
INT32 activeBuffer;                           // Index of the currently active polyCoeffs half-buffer (0 or 1)
FLOAT32* XY;                                  // Lookup table samples.  Channel-major layout: columns (ch-1)*maxPoints+1..ch*maxPoints hold channel ch.  Within each channel column i is [X_i; Y_i].
FLOAT32* polyCoeffs;                          // Polynomial interpolation coefficients (double-buffered; ping-pong controlled by activeBuffer)
} ModuleTableInterpRuntimeMultiClass;

Variables

Properties

Name Type Usage isHidden Default Value Range Units
maxPoints int const 0 8 4:1:1000
numPoints int parameter 0 4 4:1:8
order int parameter 0 1 1:1:3
activeBuffer int state 1 1 Unrestricted
XY float* parameter 0 [2 x 8] Unrestricted
polyCoeffs float* state 0 [4 x 14] 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

Scratch Pins

Channel Count 1
Block size 32
Sample rate 48000
Channel Count 1
Block size 32
Sample rate 48000

Matlab Usage

File Name: table_interp_runtime_multi_module.m 
 M = table_interp_runtime_multi_module(NAME, MAXPOINTS) 
 Audio Weaver module that performs table-driven interpolation with one 
 independent lookup table per input channel. The module supports linear 
 and cubic interpolation modes. 

 Arguments: 
    NAME      - name of the module. 
    MAXPOINTS - maximum number of points allocated per channel lookup 
                table.  Set at design time; minimum value is 4. 
                At run time, the active number of points (.numPoints) can 
                be reduced to any value in [4, MAXPOINTS]. 

Copyright (c) 2026 DSP Concepts, Inc.