1 |
/* $Id$ */ |
---|
2 |
|
---|
3 |
/* |
---|
4 |
* FreeBob Streaming API |
---|
5 |
* FreeBob = Firewire (pro-)audio for linux |
---|
6 |
* |
---|
7 |
* http://freebob.sf.net |
---|
8 |
* |
---|
9 |
* Copyright (C) 2005,2006 Pieter Palmers <pieterpalmers@users.sourceforge.net> |
---|
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 |
* This program is distributed in the hope that it will be useful, |
---|
17 |
* but WITHOUT ANY WARRANTY {} without even the implied warranty of |
---|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
19 |
* GNU General Public License for more details. |
---|
20 |
* |
---|
21 |
* You should have received a copy of the GNU General Public License |
---|
22 |
* along with this program {} if not, write to the Free Software |
---|
23 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
24 |
* |
---|
25 |
* |
---|
26 |
* |
---|
27 |
*/ |
---|
28 |
#ifndef __FREEBOB_DELAYLOCKEDLOOP__ |
---|
29 |
#define __FREEBOB_DELAYLOCKEDLOOP__ |
---|
30 |
|
---|
31 |
namespace Util { |
---|
32 |
|
---|
33 |
class DelayLockedLoop { |
---|
34 |
|
---|
35 |
public: |
---|
36 |
|
---|
37 |
DelayLockedLoop(unsigned int order, float *coeffs); |
---|
38 |
DelayLockedLoop(unsigned int order); |
---|
39 |
DelayLockedLoop(); |
---|
40 |
|
---|
41 |
virtual ~DelayLockedLoop(); |
---|
42 |
|
---|
43 |
float getCoefficient(unsigned int i); |
---|
44 |
void setCoefficient(unsigned int i, float c); |
---|
45 |
|
---|
46 |
void setIntegrator(unsigned int i, float c); |
---|
47 |
|
---|
48 |
void reset(); |
---|
49 |
|
---|
50 |
unsigned int getOrder(); |
---|
51 |
void setOrder(unsigned int i); |
---|
52 |
void setOrder(unsigned int order, float* coeffs); |
---|
53 |
|
---|
54 |
void put(float v); |
---|
55 |
float get(); |
---|
56 |
float getError(); |
---|
57 |
|
---|
58 |
protected: |
---|
59 |
|
---|
60 |
unsigned int m_order; |
---|
61 |
|
---|
62 |
float *m_coeffs; |
---|
63 |
float *m_nodes; |
---|
64 |
float m_error; |
---|
65 |
}; |
---|
66 |
|
---|
67 |
} // end of namespace FreeBobUtil |
---|
68 |
|
---|
69 |
#endif /* __FREEBOB_DELAYLOCKEDLOOP__ */ |
---|
70 |
|
---|
71 |
|
---|