Component: Sum (DSP)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd
Version 1.2 (Release)
Category DSP


Image Sum component

Component to combine together two DSP buffers into one an index at a time. Functions include: Add, Average, Difference, Max, Min, Subtract

Examples

Here is a example file which generates a sine wave and a triangle wave and then uses the DSP sum component to merge together the two signals. FC6 Icon.png DSPSum Here is the kind of waveform you can expect to see using the scope window when adding the two signals together.

DSPSum.jpg


Here is the kind of waveform you can expect to see using the scope window when subtracting the two readings.

DSPSum3.jpg


Here is the kind of waveform you can expect to see using the scope window when taking the maximum of the two signals.

DSPSum2.jpg


Here is the kind of waveform you can expect to see using the scope window when taking the minimum of the two signals.

DSPSum4.jpg


Here is the kind of waveform you can expect to see using the scope window when taking the average between the two signals.

DSPSum5.jpg


Here is the kind of waveform you can expect to see using the scope window when taking the difference between the two signals.

DSPSum6.jpg

Downloadable macro reference

AddTick

Combines two single buffer values into one by adding input A to input B and storing the result in output.

Parameters

BYTE Rollover
0=Don't allow rollover, 1=Rollover is allowed


Return value

This call does not return a value


DiffTick

Takes the difference between two single buffer values by comparing input A to input B and storing the difference in the output.

Parameters

This macro has no parameters


Return value

This call does not return a value


SubTick

Combines two single buffer values into one by subtracting input B from input A and storing the result in output.

Parameters

BYTE Rollover


Return value

This call does not return a value


Max

Takes the max value between two entire buffers by comparing input A to input B and storing the max in the output.

Parameters

This macro has no parameters


Return value

This call does not return a value


Add

Combines two entire buffers into one by adding input A to input B and storing the result in output.

Parameters

BYTE Rollover
0=Don't allow rollover, 1=Rollover is allowed


Return value

This call does not return a value


MinTick

Takes the min value between two single buffer values by comparing input A to input B and storing the max in the output.

Parameters

This macro has no parameters


Return value

This call does not return a value


Sub

Combines two entire buffers into one by subtracting input B from input A and storing the result in output.

Parameters

BYTE Rollover


Return value

This call does not return a value


AverageTick

Takes the average between two single buffer values by comparing input A to input B and storing the average in the output.

Parameters

This macro has no parameters


Return value

This call does not return a value


Min

Takes the min value between two entire buffers by comparing input A to input B and storing the min in the output.

Parameters

This macro has no parameters


Return value

This call does not return a value


Diff

Takes the difference between two entire buffers by comparing input A to input B and storing the difference in the output.

Parameters

This macro has no parameters


Return value

This call does not return a value


MaxTick

Takes the max value between two single buffer values by comparing input A to input B and storing the max in the output.

Parameters

This macro has no parameters


Return value

This call does not return a value


Average

Takes the average between two entire buffers by comparing input A to input B and storing the average in the output.

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Buffer Manager

This property is of type Fixed list of ints and can be referenced with the variable name buffer_manager.

Reference to DSP system buffer manager component.

Input A

This property is of type Fixed list of ints and can be referenced with the variable name input_a.

Buffer assigned to input channel A

Input B

This property is of type Fixed list of ints and can be referenced with the variable name input_b.

Buffer assigned to input channel B

Output

This property is of type Fixed list of ints and can be referenced with the variable name output_c.

Buffer assigned to output channel