Skip to content

Adder

Overview

Multi-input adder

Discussion

The adder has a variable number of input pins and a single output pin. In all cases, all inputs must have the same block size and this equals the block size of the output pin.

The module operates in two fundamentally different modes depending upon the value of the variable oneChannelOutput. If oneChannelOutput==0, then all of the input pins must have the same number of channels. The output pin will then have the same number of channels as the input pins and be formed as the sum of all inputs. If oneChannelOutput==1, then the input pins can each have a different number of channels. The output is then a one channel signal that is formed as the sum over all input channels.

NOTE Enabling oneChannelOutput may reduce performance.

Module Pack

Standard

ClassID

classID = 44

Type Definition

typedef struct _ModuleAdder
{
ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
INT32 oneChannelOutput;                       // Boolean value that determines whether all channels are summed to form a single output.
} ModuleAdderClass;

Variables

Properties

Name Type Usage isHidden Default Value Range Units
oneChannelOutput int const 0 0 0:1:1

Pins

Input Pins

Name in1
Description Audio input
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real and Complex
Name in2
Description Audio input
Data type float
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real and Complex

Output Pins

Name out
Description Audio output
Data Type float

Matlab Usage

File Name: adder_module.m 
 M=adder_module(NAME, NUMIN, ONECHANNELOUTPUT) 
 Creates a multi-input adder module for use with Audio Weaver. 

 Arguments: 
    NAME - name of the module. 
    NUMIN - number of input pins. 
    ONECHANNELOUTPUT - boolean value which determines if multi-channel 
         input signals are collapsed to a single output channel. 

Copyright (c) 2026 DSP Concepts, Inc.