Imported Upstream version 3.2.2
[debian/gnuradio] / gr-cvsd-vocoder / src / lib / cvsd_vocoder.i
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2007,2009 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  * 
12  * GNU Radio 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
15  * GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING.  If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22
23 %include "gnuradio.i"
24
25 %{
26 #include "cvsd_encode_sb.h"
27 #include "cvsd_decode_bs.h"
28 %}
29
30 GR_SWIG_BLOCK_MAGIC(cvsd,encode_sb);
31
32 cvsd_encode_sb_sptr cvsd_make_encode_sb (short min_step=10,
33                                          short max_step=1280,
34                                          double step_decay=0.9990234375,
35                                          double accum_decay= 0.96875,
36                                          int K=32,
37                                          int J=4,
38                                          short pos_accum_max=32767,
39                                          short neg_accum_max=-32767);
40
41 class cvsd_encode_sb : public gr_sync_decimator
42 {
43 private:
44   cvsd_encode_sb (short min_step, short max_step, double step_decay,
45                   double accum_decay, int K, int J,
46                   short pos_accum_max, short neg_accum_max);
47   
48
49  public:
50   short min_step() { return d_min_step; }
51   short max_step() { return d_max_step; }
52   double step_decay() { return d_step_decay; }
53   double accum_decay() { return d_accum_decay; }
54   int K() { return d_K; }
55   int J() { return d_J; }
56   short pos_accum_max() { return d_pos_accum_max; }
57   short neg_accum_max() { return d_neg_accum_max; }
58 };
59
60 // ----------------------------------------------------------------
61
62 GR_SWIG_BLOCK_MAGIC(cvsd,decode_bs);
63
64 cvsd_decode_bs_sptr cvsd_make_decode_bs (short min_step=10,
65                                          short max_step=1280,
66                                          double step_decay=0.9990234375,
67                                          double accum_decay= 0.96875,
68                                          int K=32,
69                                          int J=4,
70                                          short pos_accum_max=32767,
71                                          short neg_accum_max=-32767);
72
73 class cvsd_decode_bs : public gr_sync_interpolator
74 {
75 private:
76   cvsd_decode_bs (short min_step, short max_step, double step_decay,
77                   double accum_decay, int K, int J,
78                   short pos_accum_max, short neg_accum_max);
79   
80  public:
81 };