gst/filter/gstbpwsinc.*: Apply the same changes to the bandpass filter:
[platform/upstream/gst-plugins-good.git] / gst / audiofx / audiowsincband.h
1 /* -*- c-basic-offset: 2 -*-
2  * 
3  * GStreamer
4  * Copyright (C) 1999-2001 Erik Walthinsen <omega@cse.ogi.edu>
5  *               2006 Dreamlab Technologies Ltd. <mathis.hofer@dreamlab.net>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  * 
22  * 
23  * this windowed sinc filter is taken from the freely downloadable DSP book,
24  * "The Scientist and Engineer's Guide to Digital Signal Processing",
25  * chapter 16
26  * available at http://www.dspguide.com/
27  *
28  */
29
30 #ifndef __GST_BPWSINC_H__
31 #define __GST_BPWSINC_H__
32
33 #include "gstfilter.h"
34 #include <gst/gst.h>
35 #include <gst/audio/gstaudiofilter.h>
36
37 G_BEGIN_DECLS
38
39 #define GST_TYPE_BPWSINC \
40   (gst_bpwsinc_get_type())
41 #define GST_BPWSINC(obj) \
42   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BPWSINC,GstBPWSinc))
43 #define GST_BPWSINC_CLASS(klass) \
44   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BPWSINC,GstBPWSincClass))
45 #define GST_IS_BPWSINC(obj) \
46   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BPWSINC))
47 #define GST_IS_BPWSINC_CLASS(klass) \
48   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BPWSINC))
49
50 typedef struct _GstBPWSinc GstBPWSinc;
51 typedef struct _GstBPWSincClass GstBPWSincClass;
52
53 typedef void (*GstBPWSincProcessFunc) (GstBPWSinc *, guint8 *, guint8 *, guint);
54
55 /**
56  * GstBPWSinc:
57  *
58  * Opaque data structure.
59  */
60 struct _GstBPWSinc {
61   GstAudioFilter element;
62
63   GstBPWSincProcessFunc process;
64
65   gdouble frequency;
66   gdouble lower_frequency, upper_frequency;
67   gint kernel_length;           /* length of the filter kernel */
68
69   gdouble *residue;             /* buffer for left-over samples from previous buffer */
70   gdouble *kernel;
71   gboolean have_kernel;
72 };
73
74 struct _GstBPWSincClass {
75   GstAudioFilterClass parent_class;
76 };
77
78 G_END_DECLS
79
80 #endif /* __GST_BPWSINC_H__ */