Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
sot-core
Commits
7934eb78
Commit
7934eb78
authored
May 23, 2019
by
Olivier Stasse
Browse files
[filters] Add namespace for causal-filter.
Add protection against multiple inclusion.
parent
0bd08f1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/sot/core/causal-filter.hh
View file @
7934eb78
#ifndef _SOT_CORE_CAUSAL_FILTER_H_
#define _SOT_CORE_CAUSAL_FILTER_H_
/*
* Copyright 2017-, Rohan Budhirja, LAAS-CNRS
*
...
...
@@ -39,48 +41,54 @@
*/
class
CausalFilter
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
/** --- CONSTRUCTOR ----
\param[in] timestep
\param[in] xSize
\param[in] filter_numerator
\param[in] filter_denominator
namespace
dynamicgraph
{
namespace
sot
{
class
CausalFilter
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
xSize is
*/
CausalFilter
(
const
double
&
timestep
,
const
int
&
xSize
,
const
Eigen
::
VectorXd
&
filter_numerator
,
const
Eigen
::
VectorXd
&
filter_denominator
);
void
get_x_dx_ddx
(
const
Eigen
::
VectorXd
&
base_x
,
Eigen
::
VectorXd
&
x_output_dx_ddx
);
void
switch_filter
(
const
Eigen
::
VectorXd
&
filter_numerator
,
const
Eigen
::
VectorXd
&
filter_denominator
);
private:
/// sampling timestep of the input signal
double
m_dt
;
/// Size
int
m_x_size
;
/// Size of the numerator \f$m\f$
Eigen
::
Index
m_filter_order_m
;
/// Size of the denominator \f$n\f$
Eigen
::
Index
m_filter_order_n
;
/// Coefficients of the numerator \f$b\f$
Eigen
::
VectorXd
m_filter_numerator
;
/// Coefficients of the denominator \f$a\f$
Eigen
::
VectorXd
m_filter_denominator
;
bool
m_first_sample
;
///
int
m_pt_numerator
;
int
m_pt_denominator
;
Eigen
::
MatrixXd
m_input_buffer
;
Eigen
::
MatrixXd
m_output_buffer
;
};
// class CausalFilter
/** --- CONSTRUCTOR ----
\param[in] timestep
\param[in] xSize
\param[in] filter_numerator
\param[in] filter_denominator
xSize is
*/
CausalFilter
(
const
double
&
timestep
,
const
int
&
xSize
,
const
Eigen
::
VectorXd
&
filter_numerator
,
const
Eigen
::
VectorXd
&
filter_denominator
);
void
get_x_dx_ddx
(
const
Eigen
::
VectorXd
&
base_x
,
Eigen
::
VectorXd
&
x_output_dx_ddx
);
void
switch_filter
(
const
Eigen
::
VectorXd
&
filter_numerator
,
const
Eigen
::
VectorXd
&
filter_denominator
);
private:
/// sampling timestep of the input signal
double
m_dt
;
/// Size
int
m_x_size
;
/// Size of the numerator \f$m\f$
Eigen
::
Index
m_filter_order_m
;
/// Size of the denominator \f$n\f$
Eigen
::
Index
m_filter_order_n
;
/// Coefficients of the numerator \f$b\f$
Eigen
::
VectorXd
m_filter_numerator
;
/// Coefficients of the denominator \f$a\f$
Eigen
::
VectorXd
m_filter_denominator
;
bool
m_first_sample
;
///
int
m_pt_numerator
;
int
m_pt_denominator
;
Eigen
::
MatrixXd
m_input_buffer
;
Eigen
::
MatrixXd
m_output_buffer
;
};
// class CausalFilter
}
/// core
}
/// sot
#endif
/* _SOT_CORE_CAUSAL_FILTER_H_ */
src/filters/causal-filter.cpp
View file @
7934eb78
...
...
@@ -19,7 +19,7 @@
#include <sot/core/causal-filter.hh>
using
namespace
dynamicgraph
::
sot
;
/*
Filter data with an IIR or FIR filter.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment