Skip to main content
Skip table of contents

SumDiff

Overview

Computes the sum and difference of two signals

Discussion

This module has 2 input pins and 2 output pins. Input pins must have same block size, number of channels, and sample rate. Output pins have same block size, number of channels, and sample rate as input pins.

Output1=(Input1+Input2)/2, Output2=(Input1-Input2)/2.

Note that if we cascade 2 of these modules then outputs of 2nd module are equal to inputs of first module scaled by 0.5

Type Definition

CODE
typedef struct _ModuleSumDiff
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
} ModuleSumDiffClass;

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: out1

Description: Audio output

Data type: float

Name: out2

Description: Audio output

Data type: float

MATLAB Usage

File Name: sum_diff_module.m

CODE
 M=sum_diff_module(NAME)
 Creates a sum/difference module for use with the Audio Weaver
 environment.
 
 Arguments:
    NAME - name of the module.

JavaScript errors detected

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

If this problem persists, please contact our support.