Jump to content

Component: Running Average 16-bit (Calculation): Difference between revisions

From Flowcode Help
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable""
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(2 intermediate revisions by the same user not shown)
Line 28: Line 28:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Filter'''
| width="90%" class="mtx-class-macrohead" | '''Filter'''
|-
|-
| colspan="2" | Performs the filtering function, passing in the latest sampled value and outputting the latest filtered value. 
| colspan="2" | Performs the filtering function, passing in the latest sampled value and outputting the latest filtered value. 
Line 47: Line 47:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFilterRatio'''
| width="90%" class="mtx-class-macrohead" | '''SetFilterRatio'''
|-
|-
| colspan="2" | Sets the amount of input that makes it into each output. 8 would be 12.5% new and 87.5% old. Can be anything but recommended to use a power of 2 for efficiency. 
| colspan="2" | Sets the amount of input that makes it into each output. 8 would be 12.5% new and 87.5% old. Can be anything but recommended to use a power of 2 for efficiency. 
Line 66: Line 66:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFilterValue'''
| width="90%" class="mtx-class-macrohead" | '''SetFilterValue'''
|-
|-
| colspan="2" | Sets the absolute value of the filter value i.e. for setting the initial state. 
| colspan="2" | Sets the absolute value of the filter value i.e. for setting the initial state. 
Line 86: Line 86:
{| class="mtx-class-macrotable wikitable"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|}
|}

Latest revision as of 14:23, 13 July 2026

Author Matrix TSL
Version 1.0
Category Calculation


Running Average 16-bit component

Allows a value from a sensor to be averaged out filtering out high frequencies and removing noise. Running average means we have a variable that we maintain that on each pass will be 12.5% new value + 87.5% old value for example at a ratio of 8.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples

Macro reference

Filter

Filter
Performs the filtering function, passing in the latest sampled value and outputting the latest filtered value. 
- INT Value
 
- INT Return


SetFilterRatio

SetFilterRatio
Sets the amount of input that makes it into each output. 8 would be 12.5% new and 87.5% old. Can be anything but recommended to use a power of 2 for efficiency. 
- UINT Ratio
Number of samples to divide the new value down by, e.g. 8 = 12.5% 
- VOID Return


SetFilterValue

SetFilterValue
Sets the absolute value of the filter value i.e. for setting the initial state. 
- INT Val
 
- VOID Return


Property reference

Properties

Component Source Code

Please click here to download the component source project: FC_Comp_Source_RunningAverage.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_RunningAverage.fcfx