Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

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

Code Block
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

...

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

...