Skip to main content
Skip table of contents

SquareAddFract32

Overview

Squares all inputs and then sums them together.

Discussion

Squares all input channels, and sums them together. The ONECHANNELOUTPUT parameter allows the user to select between a multichannel output (for multichannel input pins), or a mono output. If ONECHANNELOUTPUT=1, then all of the signals are summed to form a mono output channel. If ONECHANNELOUTPUT=0, all input pins must have the same number of channels, and the ith channel for each input pin is summed together, resulting in a multichannel output.

Type Definition

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

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

oneChannelOutput

int

const

0

1

0:1:1

Pins

Input Pins

Name: in1

Description: Input signal

Data type: fract32

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

Name: in2

Description: Input signal

Data type: fract32

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: Output signal

Data type: fract32

MATLAB Usage

File Name: square_add_fract32_module.m

CODE
 M=square_add_fract32_module(NAME, NUMIN, ONECHANNELOUTPUT)
 Creates a square add module which squares all input channels and sums
 them together.  Arguments:
    NAME - name of the module.
    NUMIN - number of input pins.
    ONECHANNELOUTPUT - a Boolean value.  If =1, then all of the signals
       are summed to form a mono output channel.  If =0, then all inputs
       pins must have the same number of channels, and the ith channel
       for each input pin is summed together.  The resulting output
       pin has the same number of channels as each of the inputs.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.