Overview
Writes data into an internal circular state buffer
Discussion
This module writes data to an internal circular state buffer and outputs a pointer to its instance structure. The module is used inconjunction with downstream "reader" modules which pull data out of the circular state buffer. For example, you can use it with the fir_sparse_reader_module.m to create tapped delay lines which share a common state buffer.
...
The construct argument MAXDELAY specifies the number of samples of delay, per channel. The size of the internal state buffer is (MAXDELAY + inBlockSize) * numInChannels samples where inBlockSize is the blockSize of the input pin. The internal state buffer size is doubled if the input is complex. This buffer is large enough so that a new block of data can first be written into the buffer and then data as old as MAXDELAY samples can be read out.
Type Definition
Code Block |
---|
typedef struct _ModuleDelayStateWriter { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 maxDelay; // Maximum delay, per channel. INT32 stateLen; // Size of the internal state buffer. INT32 stateIndex; // Index of the oldest state variable in the array of state variables. INT32 stateHeap; // Heap in which to allocate memory. FLOAT32* state; // State variable array. } ModuleDelayStateWriterClass; |
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
maxDelay | int | const | 0 | 100 | Unrestricted | samples |
stateLen | int | derived | 0 | 132 | Unrestricted | samples |
stateIndex | int | state | 1 | 0 | Unrestricted | |
stateHeap | int | const | 1 | 561 | Unrestricted | |
state | float* | state | 1 | [132 x 1] | Unrestricted |
Pins
Input Pins
Name: in
Description: audio input
...
Complex support: Real and Complex
Output Pins
Name: ID
Description: Module objectID
Data type: int
MATLAB Usage
File Name: delay_state_writer_module.m
...