libalmath  2.4.3.28-r2
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
digitalfilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2014 Aldebaran Robotics. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the COPYING file.
5  */
6 
7 #pragma once
8 
9 #ifndef _LIB_ALMATH_ALMATH_DSP_DIGITALFILTER_H_
10 #define _LIB_ALMATH_ALMATH_DSP_DIGITALFILTER_H_
11 
12 #include <vector>
13 #include <boost/circular_buffer.hpp>
14 
15 namespace AL
16 {
17 namespace Math
18 {
19 namespace DSP
20 {
21 
23 {
24 public:
25  DigitalFilter(void);
26  ~DigitalFilter(void);
27 
37  void configureFilter(const std::vector<float> & pWeightsIn,
38  const std::vector<float> & pWeightsOut,
39  float pDcGain);
40 
44  void resetFilter();
45 
50  float processFilter(float pInputData);
51 
52 private:
53  boost::circular_buffer<float> fFilterBufferIn;
54  boost::circular_buffer<float> fFilterBufferOut;
55 
56  float fFilterDcGain;
57 
58  std::vector<float> fFilterWeightsIn;
59  std::vector<float> fFilterWeightsOut;
60 
61 };
62 }
63 }
64 }
65 
66 
67 
68 
69 
70 #endif // _LIB_ALMATH_ALMATH_DSP_DIGITALFILTER_H_
float processFilter(float pInputData)
Process a step of the filter.
void resetFilter()
Reset the processing of the filter.
void configureFilter(const std::vector< float > &pWeightsIn, const std::vector< float > &pWeightsOut, float pDcGain)
Configure the digital filter.