Mercurial > hg > audiostuff
comparison spandsp-0.0.6pre17/src/spandsp/complex_filters.h @ 4:26cd8f1ef0b1
import spandsp-0.0.6pre17
author | Peter Meerwald <pmeerw@cosy.sbg.ac.at> |
---|---|
date | Fri, 25 Jun 2010 15:50:58 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3:c6c5a16ce2f2 | 4:26cd8f1ef0b1 |
---|---|
1 /* | |
2 * SpanDSP - a series of DSP components for telephony | |
3 * | |
4 * complex_filters.h | |
5 * | |
6 * Written by Steve Underwood <steveu@coppice.org> | |
7 * | |
8 * Copyright (C) 2003 Steve Underwood | |
9 * | |
10 * All rights reserved. | |
11 * | |
12 * This program is free software; you can redistribute it and/or modify | |
13 * it under the terms of the GNU Lesser General Public License version 2.1, | |
14 * as published by the Free Software Foundation. | |
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 Lesser General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU Lesser General Public | |
22 * License along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
24 * | |
25 * $Id: complex_filters.h,v 1.14 2009/02/03 16:28:41 steveu Exp $ | |
26 */ | |
27 | |
28 #if !defined(_SPANDSP_COMPLEX_FILTERS_H_) | |
29 #define _SPANDSP_COMPLEX_FILTERS_H_ | |
30 | |
31 typedef struct filter_s filter_t; | |
32 | |
33 typedef float (*filter_step_func_t)(filter_t *fi, float x); | |
34 | |
35 /*! Filter state */ | |
36 typedef struct | |
37 { | |
38 int nz; | |
39 int np; | |
40 filter_step_func_t fsf; | |
41 } fspec_t; | |
42 | |
43 struct filter_s | |
44 { | |
45 fspec_t *fs; | |
46 float sum; | |
47 int ptr; /* Only for moving average filters */ | |
48 float v[]; | |
49 }; | |
50 | |
51 typedef struct | |
52 { | |
53 filter_t *ref; | |
54 filter_t *imf; | |
55 } cfilter_t; | |
56 | |
57 #if defined(__cplusplus) | |
58 extern "C" | |
59 { | |
60 #endif | |
61 | |
62 SPAN_DECLARE(filter_t *) filter_create(fspec_t *fs); | |
63 SPAN_DECLARE(void) filter_delete(filter_t *fi); | |
64 SPAN_DECLARE(float) filter_step(filter_t *fi, float x); | |
65 | |
66 SPAN_DECLARE(cfilter_t *) cfilter_create(fspec_t *fs); | |
67 SPAN_DECLARE(void) cfilter_delete(cfilter_t *cfi); | |
68 SPAN_DECLARE(complexf_t) cfilter_step(cfilter_t *cfi, const complexf_t *z); | |
69 | |
70 #if defined(__cplusplus) | |
71 } | |
72 #endif | |
73 | |
74 #endif | |
75 /*- End of file ------------------------------------------------------------*/ |