Document toolboxDocument toolbox

PeriodicSourceFract32

Overview

Continuously outputs a buffer of fract32 data

Discussion

This module continuously outputs a stored buffer of fract32 data. The module starts with the first sample and continues to the end of the array. Once the end of the array is reached, the module wraps to the beginning of the buffer. Thus, the data values are circularly addressed. The modules supports an internal buffer size which can be different from the block size of the module. The module also supports an arbitrary number of output channels.

Type Definition

typedef struct _ModulePeriodicSourceFract32 { ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure INT32 L; // Number of (multi-channel) samples in the internal buffer. INT32 numChannels; // Number of channels in the output. This is only needed for the MATLAB simulation. INT32 blockSize; // Output blockSize. This is only needed for the MATLAB simulation. INT32 stateIndex; // Index of the next data sample to output. This circularly wraps fract32* value; // Output data array } ModulePeriodicSourceFract32Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

L

int

const

0

32

Unrestricted

 

numChannels

int

const

1

1

Unrestricted

 

blockSize

int

const

1

16

Unrestricted

 

stateIndex

int

state

1

0

Unrestricted

 

value

fract32*

parameter

0

[32 x 1]

Unrestricted

 

Pins

Output Pins

Name: out

Description: audio output

Data type: fract32

MATLAB Usage

File Name: periodic_source_fract32_module.m

M=periodic_source_fract32_module(NAME, L, NUMCHANNELS, BLOCKSIZE, SAMPLERATE) Create a module which generates a periodic signal by repetitively outputing a buffer of data. This version works with fract32 data. Arguments: NAME - name of the module. L - length of the repetition which equals the number of samples in the buffer. NUMCHANNELS - number of interleaved channels in each output pin. By default, NUMCHANNELS = 1; BLOCKSIZE - number of samples per output channel. By default, BLOCKSIZE = 32. SAMPLERATE - sample rate of the output signal, in Hz. By default, SAMPLERATE = 48000.

Â