[4f4d892] | 1 | /* |
---|
| 2 | Copyright (C) 2003-2007 Paul Brossier |
---|
| 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 | |
---|
| 21 | #include "aubio_priv.h" |
---|
| 22 | #include "types.h" |
---|
| 23 | #include "fvec.h" |
---|
| 24 | #include "temporal/filter.h" |
---|
| 25 | #include "temporal/filter_priv.h" |
---|
| 26 | #include "temporal/adesign.h" |
---|
| 27 | |
---|
[a7667ce] | 28 | aubio_filter_t * new_aubio_cdsgn_filter(uint_t samplerate, uint_t channels) { |
---|
| 29 | aubio_filter_t * f = new_aubio_filter(samplerate, 5, channels); |
---|
| 30 | lsmp_t * a = f->a->data[0]; |
---|
| 31 | lsmp_t * b = f->b->data[0]; |
---|
[4f4d892] | 32 | /* uint_t l; */ |
---|
| 33 | /* for now, 44100, cdsgn */ |
---|
| 34 | a[0] = 1.000000000000000000000000000000000000000000000000000000000000; |
---|
| 35 | a[1] = -2.134674963687040794013682898366823792457580566406250000000000; |
---|
| 36 | a[2] = 1.279333533236063358273781886964570730924606323242187500000000; |
---|
| 37 | a[3] = -0.149559846089396208945743182994192466139793395996093750000000; |
---|
| 38 | a[4] = 0.004908700174624848651394604104325480875559151172637939453125; |
---|
| 39 | b[0] = 0.217008561949218803377448239189106971025466918945312500000000; |
---|
| 40 | b[1] = -0.000000000000000222044604925031308084726333618164062500000000; |
---|
| 41 | b[2] = -0.434017123898438272888711253472138196229934692382812500000000; |
---|
| 42 | b[3] = 0.000000000000000402455846426619245903566479682922363281250000; |
---|
| 43 | b[4] = 0.217008561949218969910901932962588034570217132568359375000000; |
---|
| 44 | /* DBG: filter coeffs at creation time */ |
---|
| 45 | /* |
---|
| 46 | for (l=0; l<f->order; l++){ |
---|
| 47 | AUBIO_DBG("a[%d]=\t%1.16f\tb[%d]=\t%1.16f\n",l,a[l],l,b[l]); |
---|
| 48 | } |
---|
| 49 | */ |
---|
[a7667ce] | 50 | f->a->data[0] = a; |
---|
| 51 | f->b->data[0] = b; |
---|
[4f4d892] | 52 | return f; |
---|
| 53 | } |
---|
| 54 | |
---|