The VisAO Camera
fir_filter.h
Go to the documentation of this file.
1 /************************************************************
2  * fir_filter.h
3  *
4  * Author: Jared R. Males (jrmales@as.arizona.edu)
5  *
6  * FIR digital filter class declarations.
7  *
8  ************************************************************/
9 
10 /** \file fir_filter.h
11  * \author Jared R. Males
12  * \brief FIR digital filter class declarations.
13  *
14  */
15 
16 #ifndef __fir_filter_h__
17 #define __fir_filter_h__
18 
19 #include <string>
20 #include <iostream>
21 #include <fstream>
22 
23 namespace VisAO
24 {
25 
26 /** \todo fir_filter: need error checking in read_coef_file
27  */
29 {
30  public:
31  fir_filter();
32  ~fir_filter();
33 
34  protected:
35 
36  int order;
37  float *coef;
38  float gain;
39 
40  public:
41 
42  void set_coef(int ord, float *nc, float gain);
43 
44  int read_coef_file(std::string fname);
45 
46  int get_order(){ return order;}
47 
48  void print_filter();
49 
50  ///Apply the filter to the data fector of length len.
51  /** The newest point should be data[len-1]. Applies at most order coefficients.
52  */
53  float apply_filter(float *data, int len);
54 };
55 
56 } //namespace VisAO
57 
58 #endif
59 
float apply_filter(float *data, int len)
Apply the filter to the data fector of length len.
Definition: fir_filter.cpp:75
The namespace of VisAO software.