Skip to main content
Skip table of contents

FIRSparseReaderFract16

Overview

16-bit version of Sparse FIR filter which works together with the DelayStateWriter16 module

Discussion

This module implements a 16-bit version of sparse FIR filter which is also known as a tapped delay line. This module stores only the coefficients and delay times and works in conjunction with an upstram delay_state_writer16_module.m. The delay_state_writer16_module.m holds the state variables and can be shared by multiple FIRSpareReaderModules.

You need to make sure that the maximum tapped delay time does not exceed the allocated size of the upstream state buffer. No checking is made at run-time that this is the case.

The module only outputs a mono channel of data.

Type Definition

CODE
typedef struct _ModuleFIRSparseReaderFract16
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 numTaps;                                // Number of non-zero coefficients (taps) in the filter
    INT32 postShift;                              // Number of bits to shift
    INT32 dswObjectID;                            // Object ID of the upstream DelayStateWriter module
    INT32* tapDelay;                              // Current delay per tap
    INT32* tapDelayTarget;                        // Current delay per tap
    FLOAT32* tapCoeffs;                           // Coefficient applied to each tap output
    fract32* tapCoeffsFract16;                    // Fract16 coefficient applied to each tap output
    void * dswObjectPtr;                          // Points to the upstream DelayStateWriter module
} ModuleFIRSparseReaderFract16Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

numTaps

int

const

0

20

Unrestricted

postShift

int

derived

1

1

Unrestricted

dswObjectID

int

state

1

-1

Unrestricted

tapDelay

int*

parameter

0

[20 x 1]

Unrestricted

samples

tapDelayTarget

int*

state

0

[21 x 1]

Unrestricted

samples

tapCoeffs

float*

parameter

0

[20 x 1]

Unrestricted

tapCoeffsFract16

fract32*

derived

0

[20 x 1]

Unrestricted

dswObjectPtr

void *

state

1

Unrestricted

Pins

Input Pins

Name: ptr

Description: Pointer to the DelayStateWriter16 instance structure

Data type: int

Channel range: 1

Block size range: 1

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: audio output

Data type: fract32

MATLAB Usage

File Name: fir_sparse_reader_fract16_module.m

CODE
 M = fir_sparse_reader_fract16_module(NAME, NUMTAPS, BLOCKSIZE, SAMPLERATE)
 Creates a fract16 sparse FIR filter which is equivalent to a multi-tap time
 delay in which the outputs are weighted and summed.  This module works
 in conjunction with the delay_state_writer16_module.m.  The "writer"
 module stores the circular state buffer while this "reader" module
 does the actual processing.  The "writer" module output is a pointer
 to its instance structure.  The "reader" module uses the instance
 pointer to read data out of the state buffer.
 This module can only process a single mono channel of data.
 Arguments:
    NAME - name of the module.
    NUMTAPS - number of taps
    BLOCKSIZE - output block size (number of samples to generate).
        If this is empty then we use the blockSize from the system
        input.  By default, BLOCKSIZE = [].
    SAMPLERATE - sample rate of the output data.  If this is empty
        then we use the sample rate of the first input pin of the
        containing system.  By default, SAMPLERATE = [].

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.