SoftFilters  0.1.0
Arduino framework and library of software data filters.
MovingVarianceFilter< IN_T, OUT_T, INTERNAL_T > Class Template Reference

A moving variance filter. More...

#include <SoftFilters.h>

Inheritance diagram for MovingVarianceFilter< IN_T, OUT_T, INTERNAL_T >:
Collaboration diagram for MovingVarianceFilter< IN_T, OUT_T, INTERNAL_T >:

Public Member Functions

 MovingVarianceFilter (size_t w_sz)
 
- Public Member Functions inherited from MovingAverageFilter< IN_T, OUT_T, INTERNAL_T >
 MovingAverageFilter (size_t w_sz)
 Create a moving average filter with the specified window size. More...
 
- Public Member Functions inherited from CachedFilter< IN_T, OUT_T >
 CachedFilter (size_t cap)
 
- Public Member Functions inherited from Filter
bool push (void const *const input, void *const output)
 Push a new data through the filter. More...
 

Protected Member Functions

INTERNAL_T get_squared_sum ()
 
virtual bool refresh (IN_T const *const new_val, IN_T const *const old_val, OUT_T &output) override
 Refresh the output value given the new value added to the cache and the old value removed from the cache. More...
 
- Protected Member Functions inherited from MovingAverageFilter< IN_T, OUT_T, INTERNAL_T >
INTERNAL_T get_sum ()
 
- Protected Member Functions inherited from CachedFilter< IN_T, OUT_T >
virtual bool update (void const *const input) override
 Internally update the filter output based on the given input. More...
 
size_t get_capacity ()
 
size_t get_size ()
 
- Protected Member Functions inherited from BaseFilter< IN_T, OUT_T >
virtual void const *const get_output_val_ptr () final
 Push a new data through the filter. More...
 
virtual void copy_to_client (void *const output) final
 Copy the output to client memory.
 

Private Attributes

INTERNAL_T new_val_2
 square of the new data
 
INTERNAL_T old_val_2
 square of the old data
 
INTERNAL_T squared_sum
 squared sum
 

Additional Inherited Members

- Protected Attributes inherited from MovingAverageFilter< IN_T, OUT_T, INTERNAL_T >
INTERNAL_T internal_result
 representing the result in internal type in case the output type does not have the required precision
 
- Protected Attributes inherited from BaseFilter< IN_T, OUT_T >
OUT_T out_val
 Internally managed storage of the output value.
 

Detailed Description

template<typename IN_T, typename OUT_T, typename INTERNAL_T = double>
class MovingVarianceFilter< IN_T, OUT_T, INTERNAL_T >

A moving variance filter.

Member Function Documentation

◆ refresh()

template<typename IN_T , typename OUT_T , typename INTERNAL_T = double>
virtual bool MovingVarianceFilter< IN_T, OUT_T, INTERNAL_T >::refresh ( IN_T const *const  new_val,
IN_T const *const  old_val,
OUT_T &  output 
)
inlineoverrideprotectedvirtual

Refresh the output value given the new value added to the cache and the old value removed from the cache.

Note
To be differentiated from the CachedFilter::update member function which overrides the BaseFilter::update member function.

Reimplemented from MovingAverageFilter< IN_T, OUT_T, INTERNAL_T >.


The documentation for this class was generated from the following file: