SatCat5
satcat5::ptp::LinearPrediction Class Reference

Detailed Description

An inline filter that iteratively estimates linear trends.

The LinearPrediction filter allows use of "controller" blocks (e.g., ControllerPI, ControllerPII, etc.) for general-purpose iterative estimation of linear trends. This is often less compute-intensive than a sliding-window linear regression.

Definition at line 505 of file ptp_filters.h.

#include <ptp_filters.h>

Inheritance diagram for satcat5::ptp::LinearPrediction:
[legend]
Collaboration diagram for satcat5::ptp::LinearPrediction:
[legend]

Public Member Functions

constexpr LinearPrediction (satcat5::ptp::Filter *ctrl=0)
 Create this object, and optionally add the first filter. More...
 
void add_filter (satcat5::ptp::Filter *filter)
 Add to the chain of processing filters. More...
 
s64 predict (u32 elapsed_usec) const
 Extrapolate trendline relative to most recent update() event.
 
void reset () override
 Required API from ptp::Filter.
 
void rate (s64 delta, u32 elapsed_usec) override
 Required API from ptp::Filter.
 
s64 update (s64 next, u32 elapsed_usec) override
 Required API from ptp::Filter.
 

Protected Member Functions

satcat5::util::int128_t incr (u32 elapsed_usec) const
 

Protected Attributes

satcat5::util::List< satcat5::ptp::Filterm_filters
 
bool m_first
 
s64 m_rate
 
satcat5::util::int128_t m_accum
 

Static Protected Attributes

static constexpr unsigned SCALE = 32
 

Private Attributes

satcat5::ptp::Filterm_next
 

Constructor & Destructor Documentation

◆ LinearPrediction()

constexpr satcat5::ptp::LinearPrediction::LinearPrediction ( satcat5::ptp::Filter ctrl = 0)
inlineexplicitconstexpr

Create this object, and optionally add the first filter.

Additional filters can be chained with add_filter(...). One filter in the chain must be of the "controller" type.

Definition at line 510 of file ptp_filters.h.

Member Function Documentation

◆ add_filter()

void satcat5::ptp::LinearPrediction::add_filter ( satcat5::ptp::Filter filter)
inline

Add to the chain of processing filters.

Filters are applied in the order added.

Definition at line 516 of file ptp_filters.h.


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