| 1 |
// ---------------------------------------------------------------------------- |
| 2 |
// |
| 3 |
// Copyright (C) 2003-2013 Fons Adriaensen <[email protected]> |
| 4 |
// |
| 5 |
// This program is free software; you can redistribute it and/or modify |
| 6 |
// it under the terms of the GNU General Public License as published by |
| 7 |
// the Free Software Foundation; either version 3 of the License, or |
| 8 |
// (at your option) any later version. |
| 9 |
// |
| 10 |
// This program is distributed in the hope that it will be useful, |
| 11 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
// GNU General Public License for more details. |
| 14 |
// |
| 15 |
// You should have received a copy of the GNU General Public License |
| 16 |
// along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
// |
| 18 |
// ---------------------------------------------------------------------------- |
| 19 |
|
| 20 |
|
| 21 |
#ifndef __INVFILT_H |
| 22 |
#define __INVFILT_H |
| 23 |
|
| 24 |
|
| 25 |
#include <fftw3.h> |
| 26 |
|
| 27 |
|
| 28 |
class Invfilt |
| 29 |
{ |
| 30 |
public: |
| 31 |
|
| 32 |
Invfilt (void); |
| 33 |
~Invfilt (void); |
| 34 |
|
| 35 |
void fini (void); |
| 36 |
void init (float rate, float tmax); |
| 37 |
|
| 38 |
void setwin (float tneg, float thif, float tlof); |
| 39 |
void setinp (float *x, int dlen, int offs); |
| 40 |
void settarg_log (float *v, int n, float f0, float f1); |
| 41 |
void setbias_log (float *v, int n, float f0, float f1); |
| 42 |
|
| 43 |
private: |
| 44 |
|
| 45 |
float rcoswin (float x, float p); |
| 46 |
|
| 47 |
float _rate; |
| 48 |
float _tmax; |
| 49 |
int _lfft; |
| 50 |
float _tneg; |
| 51 |
float _thif; |
| 52 |
float _tlof; |
| 53 |
float *_td1; |
| 54 |
float *_td2; |
| 55 |
float *_targ; |
| 56 |
float *_bias; |
| 57 |
fftwf_complex *_fd1; |
| 58 |
fftwf_complex *_fd2; |
| 59 |
fftwf_plan _fwd_plan; |
| 60 |
fftwf_plan _rev_plan; |
| 61 |
}; |
| 62 |
|
| 63 |
|
| 64 |
#endif |