Difference between revisions of "Component: Sum (DSP)"
(9 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
|- | |- | ||
| width="20%" style="color: gray;" | Author | | width="20%" style="color: gray;" | Author | ||
− | | | + | | Matrix Ltd |
|- | |- | ||
| width="20%" style="color: gray;" | Version | | width="20%" style="color: gray;" | Version | ||
− | | 1.1 | + | | 1.1 (Release) |
|- | |- | ||
| width="20%" style="color: gray;" | Category | | width="20%" style="color: gray;" | Category | ||
Line 20: | Line 20: | ||
==Examples== | ==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. | 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. | ||
− | + | {{Fcfile|DSPSum.fcfx|DSPSum}} | |
− | Here is the kind of waveform you can expect to see using the scope window. | + | Here is the kind of waveform you can expect to see using the scope window when adding the two signals together. |
[[File:DSPSum.jpg]] | [[File:DSPSum.jpg]] | ||
+ | |||
+ | |||
+ | Here is the kind of waveform you can expect to see using the scope window when subtracting the two readings. | ||
+ | |||
+ | [[File: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. | ||
+ | |||
+ | [[File: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. | ||
+ | |||
+ | [[File: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. | ||
+ | |||
+ | [[File: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. | ||
+ | |||
+ | [[File:DSPSum6.jpg]] | ||
==Downloadable macro reference== | ==Downloadable macro reference== |
Latest revision as of 11:13, 28 July 2016
Author | Matrix Ltd |
Version | 1.1 (Release) |
Category | DSP |
Contents
Sum component
Component to combine together two buffers into one a 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.
Here is the kind of waveform you can expect to see using the scope window when adding the two signals together.
Here is the kind of waveform you can expect to see using the scope window when subtracting the two readings.
Here is the kind of waveform you can expect to see using the scope window when taking the maximum of the two signals.
Here is the kind of waveform you can expect to see using the scope window when taking the minimum of the two signals.
Here is the kind of waveform you can expect to see using the scope window when taking the average between the two signals.
Here is the kind of waveform you can expect to see using the scope window when taking the difference between the two signals.
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