Overview
Sparse FIR filter in which most coefficients equal zero
Discussion
This module implements a sparse FIR filter in which most coefficients are equal to zero. The filter is implemented using a tap delay line rather than a traditional FIR filter. The number of output taps (NUMTAPS) is specified at instantiation time. For each tap, you specify the delay time (tapDelay array) and the weighting coefficient (tapCoeffs array). Delays are specified in units of samples.
...
The tapCoeffs and tapDelay array are always allocated in internal DM memory.
Type Definition
Code Block |
---|
typedef struct _ModuleFIRSparse { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 numTaps; // Number of non-zero coefficients (taps) in the filter INT32 maxDelay; // Maximum delay that can be realized, in samples INT32 stateHeap; // Heap in which to allocate memory INT32 stateIndex; // Index of the oldest state variable in the array of state variables INT32* tapDelay; // Current delay per channel FLOAT32* tapCoeffs; // Coefficient applied to each tap output FLOAT32* state; // State variable array } ModuleFIRSparseClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
numTaps | int | const | 0 | 5 | Unrestricted | |
maxDelay | int | const | 0 | 100 | 1:100000 | samples |
stateHeap | int | const | 1 | 2 | Unrestricted | |
stateIndex | int | state | 1 | 0 | Unrestricted | |
tapDelay | int* | parameter | 0 | [5 x 1] | 0:1:100 | samples |
tapCoeffs | float* | parameter | 0 | [5 x 1] | Unrestricted | |
state | float* | state | 1 | [132 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: float
Scratch Pins
Channel count: 1
Block size: 32
Sample rate: 48000
MATLAB Usage
File Name: fir_sparse_module.m
...