1 /*
2     Copyright (C) 2010 Fons Adriaensen <fons@kokkinizita.net>
3 
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8 
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13 
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18 
19 
20 #ifndef __ALLPASS22_H
21 #define __ALLPASS22_H
22 
23 
24 // Two second order allpass sections in series.
25 //
26 class Allpass22
27 {
28 public:
29 
Allpass22(void)30     Allpass22 (void) { reset (); }
reset(void)31     void reset (void) { _z1 = _z2 = _z3 = _z4 = 0; }
32     void prepare (float f1, float b1, float f2, float b2);
33     void process (int n, float *inp, float *out);
34 
35     static int initquad (Allpass22 *A, Allpass22 *B, float fsam);
36 
37 private:
38 
39     float _c1, _c2, _c3, _c4;
40     float _z1, _z2, _z3, _z4;
41 
42     static float quad44real [4];
43     static float quad44imag [4];
44     static float quad48real [4];
45     static float quad48imag [4];
46     static float quad96real [4];
47     static float quad96imag [4];
48 };
49 
50 
51 #endif
52