Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

Overview

Fract32 Table driven interpolation module. Supports linear and spline modes

Discussion

This module performs table lookup using defined X and Y points. The module supports linear and pchip interpolation. Internally the interpolation is performed using a piece wise polynomial approximation. With linear interpolation a first order polynomial is used; for pchip a 4th order polynomial is used. PChip is similar to a spline interpolation but it avoids the overshoot and undershoot that plagues splines.

...

The X values in the table have to monotonically increasing. That is, x0 < x1 < x2 < ... < xN. If this condition is not obeyed, then the module's prebuild function will generate an error.

Type Definition

Code Block
typedef struct _ModuleTableInterpFract32
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 maxPoints;                              // Maximum number of values in the lookup table. The total table size is [maxPoints 2].
    INT32 numPoints;                              // Current number of interpolation values in use.
    INT32 outRange;                               // Indicates if coefficients are out of fractional range.
    INT32 alerts;                                 // Indicates if coefficients are out of fractional range.
    INT32 order;                                  // Order of the interpolation. This can be either 2 (for linear) or 4 (for pchip).
    fract32* XY;                                  // Lookup table. The first row is the X values and the second row is the Y values.
    fract32* polyCoeffs;                          // Interpolation coefficients returned by the grid control.
} ModuleTableInterpFract32Class;
Variables

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

maxPoints

int

const

0

8

4:1:1000

numPoints

int

parameter

0

7

4:1:8

outRange

int

derived

0

0

0:1:1

alerts

int

derived

0

0

0:1:1

order

int

parameter

0

2

2:2:4

XY

fract32*

parameter

0

[2 x 8]

Unrestricted

polyCoeffs

fract32*

state

0

[4 x 7]

Unrestricted

Pins

Input Pins

Name: in

Description: audio input

...

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: audio output

Data type: fract32

MATLAB Usage

File Name: table_interp_fract32_module.m

...