Overview
FIR filter which works together with the DelayStateWriter module
Discussion
This module implements an FIR filter which works in conjunction with an upstream delay_state_writer_module.m. The delay_state_writer_module.m holds the state variables and can be shared by multiple FIRReader modules.
You need to make sure that the maximum number of coefficients does not exceed the allocated size of the upstream state buffer and that the number of channels match those from the state's buffer input pin. Checkings are made though at run-time and provided in the error code state: 0 = OK; -23 = channel count do not match; -67 = numTaps > (maxDelay-blockSize)); -79 = input ptr NULL; Output will be muted in case one of the above errors have occurred.
Type Definition
Code Block |
---|
typedef struct _ModuleFIRReader { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 numTaps; // Length of the filter. INT32 errorCode; // Captures errors that could arise at run-time and which appears on the inspector INT32 dswObjectID; // Object ID of the upstream DelayStateWriter module FLOAT32* coeffs; // Filter coefficient array in normal order void * dswObjectPtr; // Points to the upstream DelayStateWriter module void * hardware_specific_struct_pointer; // This is the internal TCB array used for ADI FIR accelerator } ModuleFIRReaderClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
numTaps | int | const | 0 | 20 | Unrestricted | |
errorCode | int | state | 0 | 0 | Unrestricted | |
dswObjectID | int | state | 1 | -1 | Unrestricted | |
coeffs | float* | parameter | 0 | [20 x 1] | Unrestricted | |
dswObjectPtr | void * | state | 1 | Unrestricted | ||
hardware_specific_struct_pointer | void * | state | 1 | Unrestricted |
Pins
Input Pins
Name: ID
Description: delayStateWriter instance input
...
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: float
MATLAB Usage
File Name: fir_reader_module.m
...