Document toolboxDocument toolbox

(8.D.1.2) TableInterp2d

Overview

Table driven 2d interpolation module. Currently supports only bilinear interpolation

Discussion

This module performs an interpolated 2-dimensional table lookup using a grid of values evenly spaced from -1 to 1. The module currently supports only bilinear interpolation. The input pins specify the X and Y values at which to perform the interpolation. 4 points in the table are used and bilinear interpolation is applied. The X values interpolate along a row and Y values interpolate along a column.

The range of X and Y are always [-1 +1]. Values outside of this range are clipped to +/- 1.

At instantiation, specify the total number of points (NPOINTS) in each dimension of the table. The amount of memory allocated to the table equals (NPOINTS * NPOINTS).

Type Definition

typedef struct _ModuleTableInterp2d { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 nPoints; // Number of points in each dimension of the active interpolation table. FLOAT32* table; // 2d Interpolation Lookup table } ModuleTableInterp2dClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

nPoints

int

const

0

5

Unrestricted

 

table

float*

parameter

0

[5 x 5]

Unrestricted

 

Pins

Input Pins

Name: inx

Description: index x

Data type: float

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

 

Name: iny

Description: index y

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_interp2d_module.m

M=table_interp2d_module(NAME, NPOINTS) This Audio Weaver process performs bilinear interpolation between values defined on a lattice with NPTS evenly spaced points from [-1,1] in x and y. For input coordinates between the lattice points, interpolate linearly for x and then for y. Arguments: NAME - name of the module. NPOINTS - number of points in each dimension. This is set at design time and has a minimum value of 2. The internal variable .table holds the underlying table of values. .table has a size of NPOINTS x NPOINTS.

Â