Filter Moving Average Demo
Overview
There is an example implementation of the Filter Moving Average Demo application available in the apps folder. In this implementation, it contains all the API functions and demos for how to use them.
Features
This application The structure is initialised, input is added, calculation and averages get retrieved from the structure, data is obtained from the structure, and all filter structure elements are flushed.
In every API for this driver, the Structure input argument is provided by the user.
The sample application includes Test Suite APIs. The test suite API was used to test the filter moving average driver API functions in a single shot with custom input.
Example Usecase
Initialise the moving average module. To find the average, get input data and window size from the user. The average value will be calculated by adding the input values to the window size. Below is the use case for finding the average of the data using a moving average filter.
Example input data:
****** MENU ******
1. Moving Average Init --(Must)
2.To add input
3.To get average
4.To get data
5.To Flush all the elements(Flush)
6.Validate Filter
7.Quit
Enter the window size : 4
Enter the number of elements : 6
Enter integer values
2
3
4
5
1
6
Successfully got the average value 3.80
The Output data is
Sample average Data output:
Average value is 3.80
Filter Moving Average Module Driver
Please refer below section,