Cheetah Software  1.0
ff02_filter< T > Class Template Reference

#include <filters.h>

+ Inheritance diagram for ff02_filter< T >:
+ Collaboration diagram for ff02_filter< T >:

Public Member Functions

 ff02_filter (float t_s, float w_c)
 
virtual ~ff02_filter (void)
 
virtual void input (T input_value)
 
virtual T output (void)
 
virtual void clear (void)
 
- Public Member Functions inherited from filter< T >
 filter (void)
 
virtual ~filter (void)
 

Private Attributes

Lpf_in_prev [2]
 
Lpf_out_prev [2]
 
Lpf_in1
 
Lpf_in2
 
Lpf_in3
 
Lpf_out1
 
Lpf_out2
 
lpf_out
 

Detailed Description

template<typename T>
class ff02_filter< T >

Definition at line 97 of file filters.h.

Constructor & Destructor Documentation

template<typename T >
ff02_filter< T >::ff02_filter ( float  t_s,
float  w_c 
)

Definition at line 267 of file filters.cpp.

References moving_average_filter< T >::clear().

267  {
268  T J = 0.003216;
269 
270  Lpf_in_prev[0] = Lpf_in_prev[1] = 0;
271  Lpf_out_prev[0] = Lpf_out_prev[1] = 0;
272  Lpf_in1 = 0, Lpf_in2 = 0, Lpf_in3 = 0, Lpf_out1 = 0, Lpf_out2 = 0;
273 
274  T a = 1.4142;
275  T den = 4 + 2 * a * w_c * t_s + t_s * t_s * w_c * w_c;
276 
277  Lpf_in1 = J * 2 * t_s * w_c * w_c / den;
278  Lpf_in2 = 0;
279  Lpf_in3 = -2. * J * t_s * w_c * w_c / den;
280  Lpf_out1 = -1. * (-8 + t_s * t_s * w_c * w_c * 2) / den;
281  Lpf_out2 = -1. * (4 - 2 * a * w_c * t_s + t_s * t_s * w_c * w_c) / den;
282 
283  clear();
284 }
T Lpf_out_prev[2]
Definition: filters.h:107
virtual void clear(void)
Definition: filters.cpp:307
T Lpf_in_prev[2]
Definition: filters.h:106

+ Here is the call graph for this function:

template<typename T >
ff02_filter< T >::~ff02_filter ( void  )
virtual

Definition at line 287 of file filters.cpp.

287 {}

Member Function Documentation

template<typename T >
void ff02_filter< T >::clear ( void  )
virtual

Implements filter< T >.

Definition at line 307 of file filters.cpp.

307  {
308  Lpf_in_prev[1] = 0;
309  Lpf_in_prev[0] = 0;
310  Lpf_out_prev[1] = 0;
311  Lpf_out_prev[0] = 0;
312 }
T Lpf_out_prev[2]
Definition: filters.h:107
T Lpf_in_prev[2]
Definition: filters.h:106
template<typename T >
void ff02_filter< T >::input ( input_value)
virtual

Implements filter< T >.

Definition at line 290 of file filters.cpp.

290  {
291  lpf_out = Lpf_in1 * lpf_in + Lpf_in2 * Lpf_in_prev[0] +
292  Lpf_in3 * Lpf_in_prev[1] + // input component
293  Lpf_out1 * Lpf_out_prev[0] +
294  Lpf_out2 * Lpf_out_prev[1]; // output component
295  Lpf_in_prev[0] = lpf_in;
296  Lpf_in_prev[1] = Lpf_in_prev[0];
297  Lpf_out_prev[0] = lpf_out;
298  Lpf_out_prev[1] = Lpf_out_prev[0];
299 }
T Lpf_out_prev[2]
Definition: filters.h:107
T Lpf_in_prev[2]
Definition: filters.h:106
template<typename T >
T ff02_filter< T >::output ( void  )
virtual

Implements filter< T >.

Definition at line 302 of file filters.cpp.

302  {
303  return lpf_out;
304 }

Member Data Documentation

template<typename T >
T ff02_filter< T >::Lpf_in1
private

Definition at line 108 of file filters.h.

template<typename T >
T ff02_filter< T >::Lpf_in2
private

Definition at line 108 of file filters.h.

template<typename T >
T ff02_filter< T >::Lpf_in3
private

Definition at line 108 of file filters.h.

template<typename T >
T ff02_filter< T >::Lpf_in_prev[2]
private

Definition at line 106 of file filters.h.

template<typename T >
T ff02_filter< T >::lpf_out
private

Definition at line 109 of file filters.h.

template<typename T >
T ff02_filter< T >::Lpf_out1
private

Definition at line 108 of file filters.h.

template<typename T >
T ff02_filter< T >::Lpf_out2
private

Definition at line 108 of file filters.h.

template<typename T >
T ff02_filter< T >::Lpf_out_prev[2]
private

Definition at line 107 of file filters.h.


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