kwave  18.07.70
Filter.h
Go to the documentation of this file.
1 /***************************************************************************
2  Filter.h - parameters of a digital IIR or FIR filter
3  -------------------
4  begin : Jan 21 2001
5  copyright : (C) 2001 by Thomas Eschenbacher
6  email : Thomas Eschenbacher <thomas.eschenbacher@gmx.de>
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef FILTER_H
19 #define FILTER_H
20 
21 #include "config.h"
22 #include <QVector>
23 
24 class QString;
25 
26 namespace Kwave
27 {
28 
36  class Filter
37  {
38  public:
43  explicit Filter(int rate);
44 
49  explicit Filter(const QString &command);
50 
52  virtual ~Filter();
53 
58  QString command();
59 
65  unsigned int resize(unsigned int newnum);
66 
68  inline bool isFIR() const { return m_fir; }
69 
71  inline int rate() const { return m_rate; }
72 
77  unsigned int count();
78 
83  double coeff(unsigned int index);
84 
90  void setCoeff(unsigned int index, double newval);
91 
96  unsigned int delay(unsigned int index);
97 
103  void setDelay(unsigned int index, unsigned int newval);
104 
106  void load(const QString &filename);
107 
109  void save(const QString &filename);
110 
111  private:
112 
114  bool m_fir;
115 
117  unsigned int m_rate;
118 
120  QVector<double> m_coeff;
121 
123  QVector<int> m_delay;
124 
125  };
126 
127 }
128 
129 #endif /* FILTER_H */
130 
131 //*****************************************************************************
132 //*****************************************************************************
Definition: App.h:33
QVector< double > m_coeff
Definition: Filter.h:120
double coeff(unsigned int index)
Definition: Filter.cpp:109
bool m_fir
Definition: Filter.h:114
int rate() const
Definition: Filter.h:71
unsigned int count()
Definition: Filter.cpp:102
unsigned int delay(unsigned int index)
Definition: Filter.cpp:123
bool isFIR() const
Definition: Filter.h:68
Filter(int rate)
Definition: Filter.cpp:47
void save(const QString &filename)
Definition: Filter.cpp:137
void setDelay(unsigned int index, unsigned int newval)
Definition: Filter.cpp:130
unsigned int m_rate
Definition: Filter.h:117
QVector< int > m_delay
Definition: Filter.h:123
void load(const QString &filename)
Definition: Filter.cpp:159
unsigned int resize(unsigned int newnum)
Definition: Filter.cpp:79
virtual ~Filter()
Definition: Filter.cpp:53
void setCoeff(unsigned int index, double newval)
Definition: Filter.cpp:116
QString command()
Definition: Filter.cpp:59