libalmath  2.1.4.13
 All Classes Namespaces Functions Variables Typedefs Groups Pages
digitalfilter.h
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 <deque>
14 
15 namespace AL
16 {
17 namespace Math
18 {
19 namespace DSP
20 {
21 
23 {
24 public:
25  DigitalFilter(void);
26  ~DigitalFilter(void);
27 
39  void configureFilter(unsigned int pOrder,
40  const std::vector<float> & pWeightsIn,
41  const std::vector<float> & pWeightsOut,
42  float pDcGain);
43 
47  void resetFilter();
48 
53  float processFilter(float pInputData);
54 
55 private:
56  std::deque<float> fFilterBufferIn;
57  std::deque<float> fFilterBufferOut;
58 
59  unsigned int fFilterOrder;
60  float fFilterDcGain;
61 
62  std::vector<float> fFilterWeightsIn;
63  std::vector<float> fFilterWeightsOut;
64 
65 };
66 }
67 }
68 }
69 
70 
71 
72 
73 
74 #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(unsigned int pOrder, const std::vector< float > &pWeightsIn, const std::vector< float > &pWeightsOut, float pDcGain)
Configure the digital filter.