Skip to content

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.

Module Pack

Standard

ClassID

classID = 200

Type Definition

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 
 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. 

Copyright (c) 2026 DSP Concepts, Inc.