32 #ifndef FILTERS_TRANSFER_FUNCTION_H_ 33 #define FILTERS_TRANSFER_FUNCTION_H_ 40 #include <boost/scoped_ptr.hpp> 96 virtual bool update(
const T & data_in, T& data_out) ;
107 std::vector<double>
a_;
108 std::vector<double>
b_;
112 template <
typename T>
117 template <
typename T>
122 template <
typename T>
154 for(uint32_t i = 0; i <
b_.size(); i++)
158 for(uint32_t i = 1; i <
a_.size(); i++)
169 template <
typename T>
182 data_out +=
b_[row] * (*input_buffer_)[row-1];
186 data_out -=
a_[row] * (*output_buffer_)[row-1];
224 template <
typename T>
247 virtual bool update(
const std::vector<T> & data_in, std::vector<T>& data_out) ;
258 std::vector<double>
a_;
259 std::vector<double>
b_;
263 template <
typename T>
268 template <
typename T>
273 template <
typename T>
291 temp_.resize(this->number_of_channels_);
305 for(uint32_t i = 0; i <
b_.size(); i++)
309 for(uint32_t i = 1; i <
a_.size(); i++)
320 template <
typename T>
325 if (data_in.size() != this->number_of_channels_ || data_out.size() != this->number_of_channels_ )
327 ROS_ERROR(
"Number of channels is %d, but data_in.size() = %d and data_out.size() = %d. They must match", this->number_of_channels_, (
int)data_in.size(), (int)data_out.size());
333 for (uint32_t i = 0; i <
temp_.size(); i++)
353 #endif //#ifndef FILTERS_TRAjNSFER_FUNCTION_H_ boost::scoped_ptr< RealtimeCircularBuffer< T > > input_buffer_
~MultiChannelTransferFunctionFilter()
Destructor to clean up.
A Base filter class to provide a standard interface for all filters.
A realtime safe circular (ring) buffer.
virtual bool configure()
Configure the filter with the correct number of channels and params.
virtual bool update(const T &data_in, T &data_out)
Update the filter and return the data seperately.
One-dimensional digital filter class.
boost::scoped_ptr< RealtimeCircularBuffer< std::vector< T > > > input_buffer_
~SingleChannelTransferFunctionFilter()
Destructor to clean up.
MultiChannelTransferFunctionFilter()
Construct the filter.
One-dimensional digital filter class.
virtual bool update(const std::vector< T > &data_in, std::vector< T > &data_out)
Update the filter and return the data seperately.
SingleChannelTransferFunctionFilter()
Construct the filter.
boost::scoped_ptr< RealtimeCircularBuffer< std::vector< T > > > output_buffer_
virtual bool configure()
Configure the filter with the correct number of channels and params.
boost::scoped_ptr< RealtimeCircularBuffer< T > > output_buffer_