Skip to content

Source

Overview

Source buffer holding 1 wire of data

Discussion

The source module has an internal buffer holding 1 output wire's worth of data. The module continuously copies the data from the internal value buffer to the output wire. Since this is a source module, you must specify the number of channels, blockSize, and sample rate of the output pin.

The module also supports real and complex data. The internal data buffer is deinterleaved, and the module output is interleaved. For complex data data, set the .value field to complex data in MATLAB. On the target, complex data is stored in interleaved fashion: real, imag, real, etc.

Module Pack

Standard

ClassID

classID = 111

Type Definition

typedef struct _ModuleSource
{
ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
FLOAT32* value;                               // Array of deinterleaved audio data.
} ModuleSourceClass;

Variables

Properties

Name Type Usage isHidden Default Value Range Units
value float* parameter 0 [48 x 2] Unrestricted

Pins

Output Pins

Name out
Description output data
Data Type float

Matlab Usage

File Name: source_module.m 
 M=source_module(NAME, NUMCHANNELS, BLOCKSIZE, SAMPLERATE, ISCOMPLEX) 
 Creates a source module that allows you to inject test data into 
 the audio processing layout.   

 Arguments: 
    NAME - name of the module. 
    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. 
    ISCOMPLEX - Boolean indicating whether the output holds complex data. 
         By default, ISCOMPLEX=0. 

Copyright (c) 2026 DSP Concepts, Inc.