Document toolboxDocument toolbox

(8.D.2.2) DelayNTap

Overview

Time delay with multiple output taps

Discussion

This time delay has a single mono input and multiple output channels. The delay of each output channel can be independently set by the currentDelay array. The number of output channels (NUMTAPS) is specified at construction time and this also equals the length of the currentDelay array. Delays are specified in samples and are in the range of [0 MAXDELAY].

At construction time, you specify the maximum delay (maxDelay) of the module. The variable, maxDelay determines the size of the internal state buffer. The size of the internal state buffer equals maxDelay+blockSize samples. The delay time per channel is specified by the currentDelay array. Delays can be adjusted at run-time. However, the module is not smoothly updating and you may get audible clicks when adjusting the currentDelay at run-time.

Type Definition

typedef struct _ModuleDelayNTap { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 maxDelay; // Maximum delay, in samples. INT32 stateIndex; // Index of the oldest state variable in the array of state variables. INT32 stateHeap; // Heap in which to allocate memory. INT32* currentDelay; // Current delay. FLOAT32* state; // State variable array. } ModuleDelayNTapClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

maxDelay

int

const

0

100

1:100000

samples

stateIndex

int

state

1

0

Unrestricted

 

stateHeap

int

const

1

561

Unrestricted

 

currentDelay

int*

parameter

0

[5 x 1]

0:1:100

samples

state

float*

state

1

[132 x 1]

Unrestricted

 

Pins

Input Pins

Name: in

Description: audio input

Data type: {float, int, fract32}

Channel range: 1

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: audio output

Data type: {float, int, fract32}

MATLAB Usage

File Name: delayntap_module.m

M=delayntap_module(NAME, NUMTAPS, MAXDELAY, MEMHEAP) Creates a multi-tap time delay. The module has a single mono input pin and an N-channel interleaved output. Each output channel is a delayed version of the input with different delay times per channel. Arguments: NAME - name of the module. NUMTAPS - number of taps. 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.

Â