Difference between revisions of "Component: Modified Moving Average 16-bit (Calculation)"

From Flowcode Help
Jump to navigationJump to search
(Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray...")
 
 
Line 37: Line 37:
 
| width="90%" | Value
 
| width="90%" | Value
 
|-
 
|-
| colspan="2" |  
+
| colspan="2" | Latest sample to add to the filter 
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-f32-icon.png]] - FLOAT
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
Line 56: Line 56:
 
| width="90%" | FilterValue
 
| width="90%" | FilterValue
 
|-
 
|-
| colspan="2" |  
+
| colspan="2" | Initial value to load into the filter, e.g. 0 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
Line 79: Line 79:
 
==Component Source Code==
 
==Component Source Code==
  
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_ModifiedMovingAverage.fcfx FC_Comp_Source_ModifiedMovingAverage.fcfx]
+
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_ModifiedMovingAverage16.fcfx FC_Comp_Source_ModifiedMovingAverage16.fcfx]
  
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ModifiedMovingAverage.fcfx FC_Comp_Source_ModifiedMovingAverage.fcfx]
+
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_ModifiedMovingAverage16.fcfx FC_Comp_Source_ModifiedMovingAverage16.fcfx]

Latest revision as of 11:01, 25 February 2026

Author Matrix TSL
Version 1.0
Category Calculation


Modified Moving Average 16-bit component

Allows a value from a sensor to be averaged out filtering out high frequencies and removing noise. Modified moving average means we maintain a sum of the last n number of samples. On each new sample we subtract the previous result and then add in the latest raw sample.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples

Macro reference

Filter

Fc9-comp-macro.png Filter
Performs the filtering function, passing in the latest sampled value and outputting the latest filtered value. 
Fc9-s16-icon.png - INT Value
Latest sample to add to the filter 
Fc9-s16-icon.png - INT Return


InitialiseFilter

Fc9-comp-macro.png InitialiseFilter
Preload the filter with the specified value and sets the number of samples to average over. Must be called before calling the filter macro. 
Fc9-s16-icon.png - INT FilterValue
Initial value to load into the filter, e.g. 0 
Fc9-u16-icon.png - UINT NumSamples
Specifies the number of samples to average over. 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties

Component Source Code

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

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