Updated license from GPL version 2 or later to GPL version 3 or later.
[debian/gnuradio] / gr-cvsd-vocoder / src / lib / cvsd_vocoder.i
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2007 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 %feature("autodoc","1");
24 %include "exception.i"
25 %import "gnuradio.i"
26
27 %{
28 #include "gnuradio_swig_bug_workaround.h"       // mandatory bug fix
29 #include "cvsd_encode_sb.h"
30 #include "cvsd_decode_bs.h"
31 #include <stdexcept>
32 %}
33
34 GR_SWIG_BLOCK_MAGIC(cvsd,encode_sb);
35
36 cvsd_encode_sb_sptr cvsd_make_encode_sb (short min_step=10,
37                                          short max_step=1280,
38                                          double step_decay=0.9990234375,
39                                          double accum_decay= 0.96875,
40                                          int K=32,
41                                          int J=4,
42                                          short pos_accum_max=32767,
43                                          short neg_accum_max=-32767);
44
45 class cvsd_encode_sb : public gr_sync_decimator
46 {
47 private:
48   cvsd_encode_sb (short min_step, short max_step, double step_decay,
49                   double accum_decay, int K, int J,
50                   short pos_accum_max, short neg_accum_max);
51   
52
53  public:
54   short min_step() { return d_min_step; }
55   short max_step() { return d_max_step; }
56   double step_decay() { return d_step_decay; }
57   double accum_decay() { return d_accum_decay; }
58   int K() { return d_K; }
59   int J() { return d_J; }
60   short pos_accum_max() { return d_pos_accum_max; }
61   short neg_accum_max() { return d_neg_accum_max; }
62 };
63
64 // ----------------------------------------------------------------
65
66 GR_SWIG_BLOCK_MAGIC(cvsd,decode_bs);
67
68 cvsd_decode_bs_sptr cvsd_make_decode_bs (short min_step=10,
69                                          short max_step=1280,
70                                          double step_decay=0.9990234375,
71                                          double accum_decay= 0.96875,
72                                          int K=32,
73                                          int J=4,
74                                          short pos_accum_max=32767,
75                                          short neg_accum_max=-32767);
76
77 class cvsd_decode_bs : public gr_sync_interpolator
78 {
79 private:
80   cvsd_decode_bs (short min_step, short max_step, double step_decay,
81                   double accum_decay, int K, int J,
82                   short pos_accum_max, short neg_accum_max);
83   
84  public:
85 };