Hopsan
FirstOrderLowPassFilter Class Reference

The FirstOrderLowpassFilter utility is derived from the FirstOrderTransferFunction and extends it with functions useful when creating low-pass filters of the first order. More...

Inheritance diagram for FirstOrderLowPassFilter:
FirstOrderTransferFunction

Public Member Functions

void initialize (double timestep, double wc, double u0=0.0, double y0=0.0, double min=-1.5E+300, double max=1.5E+300)
 Initialize the filter utility.
 
double breakFrequency () const
 Return the break frequency for this filter.
 
- Public Member Functions inherited from FirstOrderTransferFunction
void initialize (double timestep, double num[2], double den[2], double u0=0.0, double y0=0.0, double min=-1.5E+300, double max=1.5E+300)
 
void initializeValues (double u0, double y0)
 
void setBackupLength (size_t nSteps)
 Setup the number of backup steps to remember (size of the backup buffer)
 
void setMinMax (double min, double max)
 
void setNum (double num[2])
 
void setDen (double den[2])
 
void setNumDen (double num[2], double den[2])
 
void restoreBackup (size_t nSteps=1)
 Restore the backup at the given step.
 
void backup ()
 Pushes a backup of transfer function states into the backup buffer.
 
double update (double u)
 Updates the transfer function.
 
double updateWithBackup (double u)
 Make a backup of states and then calls update.
 
double value () const
 Read current transfer function output value.
 
double delayedU () const
 
double delayedY () const
 
bool isSaturated () const
 Check if the transfer function is saturated (has reached the set limits)
 

Additional Inherited Members

- Protected Attributes inherited from FirstOrderTransferFunction
double mValue
 
double mDelayedU
 
double mDelayedY
 
double mCoeffU [2]
 
double mCoeffY [2]
 
double mMin
 
double mMax
 
double mTimeStep
 
bool mIsSaturated
 
Delay mBackupU
 
Delay mBackupY
 

Detailed Description

The FirstOrderLowpassFilter utility is derived from the FirstOrderTransferFunction and extends it with functions useful when creating low-pass filters of the first order.

Member Function Documentation

◆ initialize()

void initialize ( double timestep,
double wc,
double u0 = 0.0,
double y0 = 0.0,
double min = -1.5E+300,
double max = 1.5E+300 )

Initialize the filter utility.

Parameters
[in]timestepThe (fixed) simulation timestep used
[in]wcThe break frequency in rad/s
[in]timestepThe (fixed) simulation timestep used
[in]u0Initial input signal
[in]y0Initial output value
[in]minFilter minimum value (saturation)
[in]maxFilter maximum value (saturation)