Versions Compared

Key

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

Overview

Interpolator combining an upsampler and an FIR filter

Discussion

The FIR interpolator module implements an upsampler (zero stuffer) followed by an FIR filter. An efficient polyphase algorithm is used which reduces the processing load. The module operates on multiple channels with all channels sharing the same set of filter coefficients. The filter coefficients are stored in the array coeffs in normal order. Each channel uses a circular buffer of length N/L, where N is the filter length and L is the interpolation factor.

The output block size equals the input block size multiplied by L. The output sample rate equals the input sample rate multiplied by L.

Type Definition

Code Block
typedef struct _ModuleFIRInterpolatorFract32
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 L;                                      // Upsampling factor
    INT32 N;                                      // Length of the filter
    INT32 postShift;                              // Number of bits to shift
    INT32 polyphaseLen;                           // Length of each polyphase filter component
    INT32 stateIndex;                             // Index of the oldest state variable in the array of state variables
    INT32 stateLen;                               // Length of the circular state buffer
    FLOAT32* coeffs;                              // Filter coefficient array in normal order
    fract32* coeffsFract32;                       // Filter coefficient fract32 array in normal order
    fract32* state;                               // State variable array. The size of the array equals stateLen * numChannels
} ModuleFIRInterpolatorFract32Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

L

int

const

0

2

1:1:512

N

int

const

0

32

1:1:5000

samples

postShift

int

derived

1

0

Unrestricted

polyphaseLen

int

const

1

16

Unrestricted

stateIndex

int

state

1

0

Unrestricted

stateLen

int

const

1

16

Unrestricted

coeffs

float*

parameter

0

[32 x 1]

Unrestricted

coeffsFract32

fract32*

derived

0

[34 x 1]

Unrestricted

state

fract32*

state

1

[16 x 1]

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: fir_interpolator_fract32_module.m

...