Hummingbird Flight Software
Flight software for the Hummingbird FCU quadcopter flight controller. Designed to run on the Teensy 4.1. Developed with VSCode+PlatformIO.
Public Member Functions | Public Attributes | Private Attributes | List of all members
LowPassFilter Class Reference

This is a simple implementation of a discrete low pass filter to filter noisy signals. More...

#include <low_pass_filter.h>

Public Member Functions

 LowPassFilter ()
 This is a simple implementation of a discrete low pass filter to filter noisy signals. More...
 
 ~LowPassFilter ()
 
void SetSmoothingFactor (float newSF=1.0f)
 Set the filter's smoothing factor (alpha) between [0, 1]. More...
 
float Filter (float rawPoint)
 Apply the LFP (defined by the smoothing factor) to a new point and output the filtered value. More...
 

Public Attributes

float dt
 

Private Attributes

bool _setsf
 
float _outPoint
 
float _a
 

Detailed Description

This is a simple implementation of a discrete low pass filter to filter noisy signals.

A low pass filter will let low-frequency signals through and attenuate high-frequency signals (-3dB cutoff).

Constructor & Destructor Documentation

◆ LowPassFilter()

LowPassFilter::LowPassFilter ( )

This is a simple implementation of a discrete low pass filter to filter noisy signals.

A low pass filter will let low-frequency signals through and attenuate high-frequency signals (-3dB cutoff). Constructor for the low pass filter library. Be sure to specify the smoothing factor!

◆ ~LowPassFilter()

LowPassFilter::~LowPassFilter ( )

Member Function Documentation

◆ Filter()

float LowPassFilter::Filter ( float  rawPoint)

Apply the LFP (defined by the smoothing factor) to a new point and output the filtered value.

Parameters
rawPointRaw data point to filter
Returns
Filtered measurement

◆ SetSmoothingFactor()

void LowPassFilter::SetSmoothingFactor ( float  newSF = 1.0f)

Set the filter's smoothing factor (alpha) between [0, 1].

Parameters
newSFFilter smoothing factor, [0, 1]

Member Data Documentation

◆ _a

float LowPassFilter::_a
private

◆ _outPoint

float LowPassFilter::_outPoint
private

◆ _setsf

bool LowPassFilter::_setsf
private

◆ dt

float LowPassFilter::dt

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