Public Member Functions | Protected Attributes | List of all members
filters::MultiChannelTransferFunctionFilter< T > Class Template Reference

One-dimensional digital filter class. More...

#include <transfer_function.hpp>

Inheritance diagram for filters::MultiChannelTransferFunctionFilter< T >:
Inheritance graph
[legend]

Public Member Functions

virtual bool configure ()
 Configure the filter with the correct number of channels and params. More...
 
 MultiChannelTransferFunctionFilter ()
 Construct the filter. More...
 
virtual bool update (const std::vector< T > &data_in, std::vector< T > &data_out)
 Update the filter and return the data seperately. More...
 
 ~MultiChannelTransferFunctionFilter ()
 Destructor to clean up. More...
 
- Public Member Functions inherited from filters::MultiChannelFilterBase< T >
bool configure (unsigned int number_of_channels, const std::string &param_name, ros::NodeHandle node_handle=ros::NodeHandle())
 Configure the filter from the parameter server. More...
 
bool configure (unsigned int number_of_channels, XmlRpc::XmlRpcValue &config)
 The public method to configure a filter from XML. More...
 
bool configure (XmlRpc::XmlRpcValue &config)
 A method to hide the base class method and warn if improperly called. More...
 
 MultiChannelFilterBase ()
 
virtual bool update (const T &, T &)
 Update the filter and return the data seperately This is an inefficient way to do this and can be overridden in the derived class. More...
 
- Public Member Functions inherited from filters::FilterBase< T >
bool configure (const std::string &param_name, ros::NodeHandle node_handle=ros::NodeHandle())
 Configure the filter from the parameter server. More...
 
bool configure (XmlRpc::XmlRpcValue &config)
 The public method to configure a filter from XML. More...
 
 FilterBase ()
 Default constructor used by Filter Factories. More...
 
const std::string & getName () const
 Get the name of the filter as a string. More...
 
std::string getType ()
 Get the type of the filter as a string. More...
 
virtual ~FilterBase ()
 Virtual Destructor. More...
 

Protected Attributes

std::vector< double > a_
 
std::vector< double > b_
 
std::unique_ptr< RealtimeCircularBuffer< std::vector< T > > > input_buffer_
 
std::unique_ptr< RealtimeCircularBuffer< std::vector< T > > > output_buffer_
 
std::vector< T > temp_
 
- Protected Attributes inherited from filters::MultiChannelFilterBase< T >
unsigned int number_of_channels_
 How many parallel inputs for which the filter is to be configured. More...
 
- Protected Attributes inherited from filters::FilterBase< T >
bool configured_
 Whether the filter has been configured.
More...
 
std::string filter_name_
 The name of the filter. More...
 
std::string filter_type_
 The type of the filter (Used by FilterChain for Factory construction) More...
 
string_map_t params_
 Storage of the parsed xml parameters. More...
 

Additional Inherited Members

- Protected Member Functions inherited from filters::FilterBase< T >
bool getParam (const std::string &name, bool &value) const
 Get a filter parameter as a boolean. More...
 
bool getParam (const std::string &name, double &value) const
 Get a filter parameter as a double. More...
 
bool getParam (const std::string &name, int &value) const
 Get a filter parameter as a int. More...
 
bool getParam (const std::string &name, std::string &value) const
 Get a filter parameter as a string. More...
 
bool getParam (const std::string &name, std::vector< double > &value) const
 Get a filter parameter as a std::vector<double> More...
 
bool getParam (const std::string &name, std::vector< std::string > &value) const
 Get a filter parameter as a std::vector<string> More...
 
bool getParam (const std::string &name, unsigned int &value) const
 Get a filter parameter as an unsigned int. More...
 
bool getParam (const std::string &name, XmlRpc::XmlRpcValue &value) const
 Get a filter parameter as a XmlRpcValue. More...
 
bool loadConfiguration (XmlRpc::XmlRpcValue &config)
 

Detailed Description

template<typename T>
class filters::MultiChannelTransferFunctionFilter< T >

One-dimensional digital filter class.

This class calculates the output for $N$ one-dimensional digital filters. Where the input, $x$, is a ( $N$ x 1) vector of inputs and the output, $y$, is a ( $N$ x 1) vector of outputs. The filter is described by vectors $a$ and $b$ and implemented using the standard difference equation:

\begin{eqnarray*} a[0]*y[n] = b[0]*x[n] &+& b[1]*x[n-1]+ ... + b[n_b]*x[n-n_b]\\ &-& a[1]*y[n-1]- ... - a[n_a]*y[n-n_a] \end{eqnarray*}


If $a[0]$ is not equal to 1, the coefficients are normalized by $a[0]$.

Example xml config:

<filter type="MultiChannelTransferFunctionFilter" name="filter_name">
<params a="1.0 0.5" b="0.2 0.2">
</filter>

Definition at line 224 of file transfer_function.hpp.

Constructor & Destructor Documentation

◆ MultiChannelTransferFunctionFilter()

Construct the filter.

Definition at line 263 of file transfer_function.hpp.

◆ ~MultiChannelTransferFunctionFilter()

Destructor to clean up.

Definition at line 268 of file transfer_function.hpp.

Member Function Documentation

◆ configure()

template<typename T >
bool filters::MultiChannelTransferFunctionFilter< T >::configure
virtual

Configure the filter with the correct number of channels and params.

Parameters
number_of_channelsThe number of inputs filtered.
configThe xml that is parsed to configure the filter.
Todo:
check length
Todo:
check length

Implements filters::MultiChannelFilterBase< T >.

Definition at line 273 of file transfer_function.hpp.

◆ update()

template<typename T >
bool filters::MultiChannelTransferFunctionFilter< T >::update ( const std::vector< T > &  data_in,
std::vector< T > &  data_out 
)
virtual

Update the filter and return the data seperately.

Parameters
data_invector<T> with number_of_channels elements
data_outvector<T> with number_of_channels elements

Implements filters::MultiChannelFilterBase< T >.

Definition at line 320 of file transfer_function.hpp.

Member Data Documentation

◆ a_

template<typename T >
std::vector<double> filters::MultiChannelTransferFunctionFilter< T >::a_
protected

Definition at line 257 of file transfer_function.hpp.

◆ b_

template<typename T >
std::vector<double> filters::MultiChannelTransferFunctionFilter< T >::b_
protected

Definition at line 258 of file transfer_function.hpp.

◆ input_buffer_

template<typename T >
std::unique_ptr<RealtimeCircularBuffer<std::vector<T> > > filters::MultiChannelTransferFunctionFilter< T >::input_buffer_
protected

Definition at line 252 of file transfer_function.hpp.

◆ output_buffer_

template<typename T >
std::unique_ptr<RealtimeCircularBuffer<std::vector<T> > > filters::MultiChannelTransferFunctionFilter< T >::output_buffer_
protected

Definition at line 253 of file transfer_function.hpp.

◆ temp_

template<typename T >
std::vector<T> filters::MultiChannelTransferFunctionFilter< T >::temp_
protected

Definition at line 255 of file transfer_function.hpp.


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


filters
Author(s):
autogenerated on Fri Nov 11 2022 03:09:05