Document toolboxDocument toolbox

(8.D.1.2) PolynomialFract32

Overview

Sample-by-sample polynomial nonlinearity

Discussion

Polynomial nonlinearity, computed on a sample by sample basis. The module implements the following equation:

$y[n]=x[n]^{N-1}c[0]+x[n]^{N-2}c[1]+...+x[n]c[N-2] + c[N-1]$

where y is the output, x is the input, and c is the array of polynomial coefficients.

Type Definition

typedef struct _ModulePolynomialFract32 { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 numCoeffs; // Number of coefficients in the polynomial INT32 postShift; // Number of bits to shift FLOAT32* coeffs; // Coefficient array in descending order. X^(N-1)*C[0] + X^(N-2)*C[1]+ ... fract32* coeffsFract32; // Coefficient array in descending order. X^(N-1)*C[0] + X^(N-2)*C[1]+ ... } ModulePolynomialFract32Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

numCoeffs

int

const

0

3

Unrestricted

 

postShift

int

derived

1

1

Unrestricted

 

coeffs

float*

parameter

0

[3 x 1]

Unrestricted

 

coeffsFract32

fract32*

derived

0

[3 x 1]

Unrestricted

 

Pins

Input Pins

Name: in

Description: audio input

Data type: fract32

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: audio output

Data type: fract32

MATLAB Usage

File Name: polynomial_fract32_module.m

M=polynomial_fract32_module(NAME, NUMCOEFFS) Creates a sample-by-sample polynomial nonlinearity for us in the Audio Weaver environment. The module has a single multi-channel input pin. Arguments: NAME - name of the module. NUMCOEFFS - number of coefficients in the polynomial. The order of the polynomial (the highest power of x) is NUMCOEFFS-1. The polynomial coefficients use the same ordering as the MATLAB polyval function.

Â