(8.D.2.2 ) DelayInterpFract32
Overview
Modulated time delay using linear or cubic interpolation
Discussion
An interpolated (Linear or Cubic) Fractional delay module, where the delay is specified as a fractional number of samples. The delay is implemented such that delays as short as 0 samples can be realized. The module has one multichannel input and one multichannel output. The module can operate on multiple channels and applies the same delay to each channel.
At construction time, you specify the interpolation type. 0 selects Linear interpolation and 1 selects Cubic interpolation. Also at construction time, you specify the maximum delay (maxDelay) of the module. maxDelay determines the size of the internal state buffer. To be precise, the size of the internal state buffer equals (maxDelay+1)*numChannels. In addition, you specify the instantaneous delay through the interface variable .currentDelay. currentDelay is in the range [0 maxDelay] and can be changed at run-time. currentDelay can be specified as a fractional delay value. 4nd order cubic interpolation is used. Note that the module is not smoothly updating and you may get audible clicks when adjusting the currentDelay at run-time.
Type Definition
typedef struct _ModuleDelayInterpFract32
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 maxDelay; // Maximum delay that can be realized, in samples. The size of the delay buffer (maxDelay+1)*numChannels
INT32 interpType; // Interpolation type. 0 - Linear, 1 - Cubic
FLOAT32 currentDelay; // Current delay
fract32 currentDelayFract32; // Current delay in Fract32 format
FLOAT32 modDepth; // Maximum depth, in samples, of the modulation signal
fract32 modDepthFract32; // Maximum depth, in samples, of the modulation signal
INT32 postShift; // Number of bits to shift
INT32 stateIndex; // Index of the oldest state variable in the array of state variables
INT32 stateHeap; // Heap in which to allocate memory
fract32* state; // State variable array
} ModuleDelayInterpFract32Class;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
maxDelay | int | const | 0 | 100 | 1:100000 | samples |
interpType | int | const | 0 | 0 | 0:1 | Â |
currentDelay | float | parameter | 0 | 0 | 0:0.1:100 | samples |
currentDelayFract32 | fract32 | derived | 0 | 0 | Unrestricted | Â |
modDepth | float | parameter | 0 | 0 | 0:0.1:100 | samples |
modDepthFract32 | fract32 | derived | 0 | 0 | Unrestricted | Â |
postShift | int | derived | 1 | 16 | Unrestricted | Â |
stateIndex | int | state | 1 | 0 | Unrestricted | Â |
stateHeap | int | const | 1 | 561 | Unrestricted | Â |
state | fract32* | state | 1 | [1 x 101] | Unrestricted | Â |
Pins
Input Pins
Name: mod
Description: modulation input
Data type: fract32
Channel range: 1
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Â
Name: in
Description: audio input
Data type: fract32
Channel range: Unrestricted
Block size range: Unrestricted
Sample rate range: Unrestricted
Complex support: Real
Output Pins
Name: out
Description: audio output
Data type: fract32
MATLAB Usage
File Name: delay_interp_fract32_module.m
M=delay_interp_fract32_module(NAME, MAXDELAY, MEMHEAP, INTERP_TYPE)
Creates a fractional sample time delay for use in the Audio Weaver. Arguments:
Arguments:
NAME - name of the module.
MAXDELAY - Maximum delay, in samples.
MEMHEAP - specifies the memory heap to use to allocate the main
state buffer. This is a string and follows the memory
allocation enumeration in Framework.h. Allowable values
are:
'AWE_HEAP_FAST' - always use internal DM memory.
'AWE_HEAP_FASTB' - always use internal PM memory.
'AWE_HEAP_SLOW' - always use external memory.
'AWE_HEAP_FAST2SLOW' - use internal memory. If this fails
then use external memory (the default).
'AWE_HEAP_FASTB2SLOW' - use internal memory. If this fails
then use external memory.
INTERP_TYPE - Interpolation type. Linear=0 (default) or Cubic=1.
Â