Ardour  8.7-14-g57a6773833
Filter.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  QM DSP Library
5 
6  Centre for Digital Music, Queen Mary, University of London.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version. See the file
12  COPYING included with this distribution for more information.
13 */
14 
15 #ifndef FILTER_H
16 #define FILTER_H
17 
18 #include <vector>
19 
20 class Filter
21 {
22 public:
23  struct Parameters {
24  std::vector<double> a;
25  std::vector<double> b;
26  };
27 
34  Filter(Parameters params);
35 
37 
38  void reset();
39 
45  void process(const double *const __restrict in,
46  double *const __restrict out,
47  const int n);
48 
49  int getOrder() const { return m_order; }
50 
51 private:
52  int m_order;
53  int m_sz;
54  std::vector<double> m_a;
55  std::vector<double> m_b;
56  std::vector<double> m_bufa;
57  std::vector<double> m_bufb;
58  int m_offa;
59  int m_offb;
60  int m_offmax;
61  bool m_fir;
62 
63  Filter(const Filter &); // not supplied
64  Filter &operator=(const Filter &); // not supplied
65 };
66 
67 #endif
Definition: Filter.h:21
int m_offb
Definition: Filter.h:59
int m_sz
Definition: Filter.h:53
int m_order
Definition: Filter.h:52
Filter(Parameters params)
std::vector< double > m_b
Definition: Filter.h:55
Filter & operator=(const Filter &)
std::vector< double > m_bufa
Definition: Filter.h:56
int m_offmax
Definition: Filter.h:60
bool m_fir
Definition: Filter.h:61
int m_offa
Definition: Filter.h:58
int getOrder() const
Definition: Filter.h:49
std::vector< double > m_a
Definition: Filter.h:54
std::vector< double > m_bufb
Definition: Filter.h:57
void reset()
void process(const double *const __restrict in, double *const __restrict out, const int n)
Filter(const Filter &)
std::vector< double > b
Definition: Filter.h:25
std::vector< double > a
Definition: Filter.h:24