Versions Compared

Key

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

Overview

Decimator combining an FIR filter and a downsampler

Discussion

The FIR decimator module implements an FIR filter followed by a downsampler. 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+D-1, where D is the decimation factor.

...

The latency through the module in samples is displayed in the Audio Weaver Designer GUI. The underlying FIR processing occurs at the input sampling rate and the latency is the delay in samples at the higher sampling rate.orate downsampling.

Type Definition

Code Block
typedef struct _ModuleFIRDecimator
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 D;                                      // Downsampling factor.
    INT32 N;                                      // Length of the filter.
    INT32 stateIndex;                             // Index of the oldest state variable in the array of state variables.
    INT32 stateLen;                               // Length of the circular buffer used by each channel.
    FLOAT32* coeffs;                              // Filter coefficient array in normal order.
    FLOAT32* state;                               // State variable array. The size of the array equals stateLen*numChannels.
    void * hardware_specific_struct_pointer;      // Usually NULL, but for optimizations that use 3rd party optimizations (like ne10), this may point to the required instance structure
} ModuleFIRDecimatorClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

D

int

const

0

2

2:1:512

N

int

const

0

32

1:1:5000

samples

stateIndex

int

state

1

0

Unrestricted

stateLen

int

const

1

33

Unrestricted

coeffs

float*

parameter

0

[32 x 1]

Unrestricted

state

float*

state

1

[33 x 1]

Unrestricted

hardware_specific_struct_pointer

void *

state

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: float

MATLAB Usage

File Name: fir_decimator_module.m

...