~ubuntu-branches/ubuntu/vivid/rtfilter/vivid

« back to all changes in this revision

Viewing changes to src/rtfilter.h

  • Committer: Package Import Robot
  • Author(s): Nicolas Bourdaud
  • Date: 2011-12-01 12:09:30 UTC
  • Revision ID: package-import@ubuntu.com-20111201120930-lmia8ytlwmif9yta
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C) 2008-2011 Nicolas Bourdaud <nicolas.bourdaud@epfl.ch>
 
3
 
 
4
    This file is part of the rtfilter library
 
5
 
 
6
    The rtfilter library is free software: you can redistribute it and/or
 
7
    modify it under the terms of the version 3 of the GNU Lesser General
 
8
    Public License as published by the Free Software Foundation.
 
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 Lesser General Public License for more details.
 
14
    
 
15
    You should have received a copy of the GNU Lesser General Public License
 
16
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
17
*/
 
18
#ifndef RTFILTER_H
 
19
#define RTFILTER_H
 
20
 
 
21
#include <stddef.h>
 
22
 
 
23
#ifdef __cplusplus
 
24
extern "C" {
 
25
#endif
 
26
 
 
27
/* Data type specifications */
 
28
#define RTF_FLOAT       0
 
29
#define RTF_DOUBLE      1
 
30
#define RTF_CFLOAT      2
 
31
#define RTF_CDOUBLE     3
 
32
#define RTF_PRECISION_MASK      1
 
33
#define RTF_COMPLEX_MASK        2
 
34
 
 
35
//! Handle to a filter. Used by all the functions to manipulate a filter.
 
36
typedef const struct rtf_filter* hfilter;
 
37
 
 
38
//! create a digital filter 
 
39
hfilter rtf_create_filter(unsigned int nchann, int proctype,
 
40
                      unsigned int num_len, const void *num,
 
41
                      unsigned int denum_len, const void *denum,
 
42
                      int type);
 
43
//! filter chunk of data
 
44
unsigned int rtf_filter(hfilter filt, const void* x, void* y,
 
45
                        unsigned int ns);
 
46
//! initialize a filter with particular data
 
47
void rtf_init_filter(hfilter filt, const void* data);
 
48
//! destroy a filter
 
49
void rtf_destroy_filter(hfilter filt);
 
50
//! Return the type of the input or output of a filter
 
51
int rtf_get_type(hfilter filt, int in);
 
52
 
 
53
// Creates a filter that downsample signals
 
54
hfilter rtf_create_downsampler(unsigned int nch, int type, unsigned int r);
 
55
 
 
56
//! Return the version of the library in a string
 
57
size_t rtf_get_version(char* string, size_t len, unsigned int line);
 
58
 
 
59
#ifdef __cplusplus
 
60
}
 
61
#endif
 
62
 
 
63
#endif //RTFILTER_H