SatCat5
ptp_filters.h File Reference

Detailed Description

Chainable filters for use with ptp::TrackingController.

This file defines various "filter" objects that can be chained together to implement the ptp::TrackingController loop-filter. Filters can be applied before or after the primary PID loop defined in that class, which is usually "ptp::ControllerPI".

The optimal filter configuration depends on the quality and refresh rate of the upstream source. A median-filter of order 3-5 is recommend for most applications to remove outliers. Additional filtering can mitigate measurement noise, at the cost of a slower loop response. Excessive filter delays can cause tracking loops to become unstable.

At runtime, all filters in this file use fixed-point arithmetic. Floating-point is only used for one-time calculations during build.

Most filters are configurable at runtime, but certain upper limits must be set at build-time to avoid using excessive amounts of memory. Where practical, template parameters are used to make these limits adjustable, since filter requirements vary widely by application.

Definition in file ptp_filters.h.

#include <satcat5/list.h>
#include <satcat5/ptp_time.h>
#include <satcat5/wide_integer.h>
Include dependency graph for ptp_filters.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  satcat5::ptp::Filter
 Define the basic chain-of-filters API. More...
 
class  satcat5::ptp::DebugFilter
 DebugFilter remembers the last received call to update. More...
 
class  satcat5::ptp::SlidingWindow< T, MAX_WINDOW >
 A sliding-window circular buffer, retaining the last N samples. More...
 
class  satcat5::ptp::AmplitudeReject
 Amplitude-based outlier rejection. More...
 
class  satcat5::ptp::BoxcarFilter< MAX_ORDER >
 An FIR low-pass filter using "boxcar" averaging over 2^N samples. More...
 
class  satcat5::ptp::MedianFilter< MAX_ORDER >
 A median filter for an odd number of elements. More...
 
struct  satcat5::ptp::CoeffPI
 Loop-filter coefficients for use with the "ControllerPI" class. More...
 
class  satcat5::ptp::ControllerPI
 Loop-filter for a proportional-integral (PI) controller. More...
 
struct  satcat5::ptp::CoeffPII
 Loop-filter coefficients for use with the "ControllerPII" class. More...
 
class  satcat5::ptp::ControllerPII
 Loop-filter for a proportional-double-integral (PII) controller. More...
 
struct  satcat5::ptp::LinearRegression
 Stateless linear regression calculator. More...
 
struct  satcat5::ptp::CoeffLR
 Loop-filter coefficients for use with the "ControllerLR" class. More...
 
class  satcat5::ptp::ControllerLR_Inner
 Helper class for "ControllerLR" is never used directly. More...
 
class  satcat5::ptp::ControllerLR< MAX_WINDOW >
 Loop-filter for a linear-regression (LR) controller. More...
 
class  satcat5::ptp::LinearPrediction
 An inline filter that iteratively estimates linear trends. More...
 
class  satcat5::ptp::RateConversion
 Convert normalized frequency offset to ticks-per-clock. More...
 

Functions

s64 satcat5::ptp::boxcar_filter (const s64 *data, unsigned order)
 
s64 satcat5::ptp::median_filter (s64 *data, unsigned samps)