summaryrefslogtreecommitdiff
path: root/gr-vocoder/python
diff options
context:
space:
mode:
Diffstat (limited to 'gr-vocoder/python')
-rw-r--r--gr-vocoder/python/.gitignore9
-rw-r--r--gr-vocoder/python/Makefile.am42
-rw-r--r--gr-vocoder/python/__init__.py28
-rw-r--r--gr-vocoder/python/cvsd.py86
-rwxr-xr-xgr-vocoder/python/qa_alaw_vocoder.py39
-rwxr-xr-xgr-vocoder/python/qa_codec2_vocoder.py39
-rwxr-xr-xgr-vocoder/python/qa_cvsd_vocoder.py123
-rwxr-xr-xgr-vocoder/python/qa_g721_vocoder.py39
-rwxr-xr-xgr-vocoder/python/qa_g723_24_vocoder.py39
-rwxr-xr-xgr-vocoder/python/qa_g723_40_vocoder.py39
-rwxr-xr-xgr-vocoder/python/qa_gsm_full_rate.py39
-rwxr-xr-xgr-vocoder/python/qa_ulaw_vocoder.py39
-rw-r--r--gr-vocoder/python/run_tests.in10
13 files changed, 571 insertions, 0 deletions
diff --git a/gr-vocoder/python/.gitignore b/gr-vocoder/python/.gitignore
new file mode 100644
index 000000000..bf03975bb
--- /dev/null
+++ b/gr-vocoder/python/.gitignore
@@ -0,0 +1,9 @@
+/Makefile
+/Makefile.in
+/.deps
+/.libs
+/*.la
+/*.lo
+/*.pyc
+/*.pyo
+/run_tests
diff --git a/gr-vocoder/python/Makefile.am b/gr-vocoder/python/Makefile.am
new file mode 100644
index 000000000..4b6146ca7
--- /dev/null
+++ b/gr-vocoder/python/Makefile.am
@@ -0,0 +1,42 @@
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+include $(top_srcdir)/Makefile.common
+
+vocoderdir = $(grpythondir)/vocoder
+
+TESTS = run_tests
+
+noinst_PYTHON = \
+ qa_alaw_vocoder.py \
+ qa_codec2_vocoder.py \
+ qa_cvsd_vocoder.py \
+ qa_g721_vocoder.py \
+ qa_g723_24_vocoder.py \
+ qa_g723_40_vocoder.py \
+ qa_gsm_full_rate.py \
+ qa_ulaw_vocoder.py
+
+vocoder_PYTHON = \
+ __init__.py \
+ cvsd.py
+
+EXTRA_DIST += run_tests.in
diff --git a/gr-vocoder/python/__init__.py b/gr-vocoder/python/__init__.py
new file mode 100644
index 000000000..c5477b2be
--- /dev/null
+++ b/gr-vocoder/python/__init__.py
@@ -0,0 +1,28 @@
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+'''
+This is the gr-vocoder package. This package includes the various
+vocoder blocks in GNU Radio.
+'''
+
+from vocoder_swig import *
+from cvsd import *
diff --git a/gr-vocoder/python/cvsd.py b/gr-vocoder/python/cvsd.py
new file mode 100644
index 000000000..27b06ddeb
--- /dev/null
+++ b/gr-vocoder/python/cvsd.py
@@ -0,0 +1,86 @@
+#!/usr/bin/env python
+#
+# Copyright 2007,2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr
+import vocoder_swig
+
+class cvsd_encode_fb(gr.hier_block2):
+ '''
+ This is a wrapper for the CVSD encoder that performs interpolation and filtering
+ necessary to work with the vocoding. It converts an incoming float (+-1) to a short, scales
+ it (to 32000; slightly below the maximum value), interpolates it, and then vocodes it.
+
+ The incoming sampling rate can be anything, though, of course, the higher the sampling rate and the
+ higher the interpolation rate are, the better the sound quality.
+ '''
+
+ def __init__(self, resample=8, bw=0.5):
+ '''
+ When using the CVSD vocoder, appropriate sampling rates are from 8k to 64k with resampling rates
+ from 1 to 8. A rate of 8k with a resampling rate of 8 provides a good quality signal.
+ '''
+
+ gr.hier_block2.__init__(self, "cvsd_encode",
+ gr.io_signature(1, 1, gr.sizeof_float), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
+
+ scale_factor = 32000.0
+ self.interp = resample
+
+ src_scale = gr.multiply_const_ff(scale_factor)
+ taps = gr.firdes.low_pass(self.interp, self.interp, bw, 2*bw)
+ interp = gr.interp_fir_filter_fff(self.interp, taps)
+ f2s = gr.float_to_short()
+ enc = vocoder_swig.cvsd_encode_sb()
+
+ self.connect(self, src_scale, interp, f2s, enc, self)
+
+
+class cvsd_decode_bf(gr.hier_block2):
+ '''
+ This is a wrapper for the CVSD decoder that performs decimation and filtering
+ necessary to work with the vocoding. It converts an incoming CVSD-encoded short to a float, decodes it
+ to a float, decimates it, and scales it (by 32000; slightly below the maximum value to avoid clipping).
+
+ The sampling rate can be anything, though, of course, the higher the sampling rate and the
+ higher the interpolation rate are, the better the sound quality.
+ '''
+
+ def __init__(self, resample=8, bw=0.5):
+ '''
+ When using the CVSD vocoder, appropriate sampling rates are from 8k to 64k with resampling rates
+ from 1 to 8. A rate of 8k with a resampling rate of 8 provides a good quality signal.
+ '''
+ gr.hier_block2.__init__(self, "cvsd_decode",
+ gr.io_signature(1, 1, gr.sizeof_char), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_float)) # Output signature
+
+ scale_factor = 32000.0
+ self.decim = resample
+
+ dec = vocoder_swig.cvsd_decode_bs()
+ s2f = gr.short_to_float()
+ taps = gr.firdes.low_pass(1, 1, bw, 2*bw)
+ decim = gr.fir_filter_fff(self.decim, taps)
+ sink_scale = gr.multiply_const_ff(1.0/scale_factor)
+
+ self.connect(self, dec, s2f, decim, sink_scale, self)
diff --git a/gr-vocoder/python/qa_alaw_vocoder.py b/gr-vocoder/python/qa_alaw_vocoder.py
new file mode 100755
index 000000000..b7b937138
--- /dev/null
+++ b/gr-vocoder/python/qa_alaw_vocoder.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+from vocoder_swig import *
+
+class test_alaw_vocoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test001_module_load (self):
+ enc = alaw_encode_sb();
+ dec = alaw_decode_bs();
+
+if __name__ == '__main__':
+ gr_unittest.run(test_alaw_vocoder, "test_alaw_vocoder.xml")
diff --git a/gr-vocoder/python/qa_codec2_vocoder.py b/gr-vocoder/python/qa_codec2_vocoder.py
new file mode 100755
index 000000000..699bb7dda
--- /dev/null
+++ b/gr-vocoder/python/qa_codec2_vocoder.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+from vocoder_swig import *
+
+class test_codec2_vocoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test001_module_load (self):
+ raw_enc = codec2_encode_sp();
+ raw_dec = codec2_decode_ps();
+
+if __name__ == '__main__':
+ gr_unittest.run(test_codec2_vocoder, "test_codec2_vocoder.xml")
diff --git a/gr-vocoder/python/qa_cvsd_vocoder.py b/gr-vocoder/python/qa_cvsd_vocoder.py
new file mode 100755
index 000000000..53045e4a9
--- /dev/null
+++ b/gr-vocoder/python/qa_cvsd_vocoder.py
@@ -0,0 +1,123 @@
+#!/usr/bin/env python
+#
+# Copyright 2007,2010,2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+from vocoder_swig import *
+from cvsd import *
+
+class test_cvsd_vocoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test001_module_load (self):
+ raw_enc = cvsd_encode_sb();
+ raw_dec = cvsd_decode_bs();
+ hb_enc = cvsd_encode_fb();
+ hb_dec = cvsd_decode_bf();
+
+
+ """ Disable for now
+ def test01(self):
+ sample_rate = 8000
+ scale_factor = 32000
+
+ expected_data = (6.9670547250243192e-21, -2.4088578356895596e-05,
+ -5.1261918997624889e-05, 7.2410854045301676e-05,
+ 8.444241393590346e-05, -1.2537107068055775e-05,
+ 0.00024186755763366818, -0.00060463894624263048,
+ 0.00064864184241741896, 0.010409165173768997,
+ 0.0087582804262638092, 0.017965050414204597,
+ 0.010722399689257145, 0.006602009292691946,
+ 0.02213001623749733, 0.0079685859382152557,
+ 0.033707316964864731, 0.027021972462534904,
+ 0.0086071854457259178, 0.0081678871065378189,
+ 0.039343506097793579, 0.030671956017613411,
+ 0.029626710340380669, 0.020126519724726677,
+ 0.023636780679225922, 0.0064640454947948456,
+ -0.0038861562497913837, 0.0021134600974619389,
+ -0.0088051930069923401, -0.00023228264763019979,
+ -0.033737499266862869, -0.033141419291496277,
+ -0.037145044654607773, -0.0080892946571111679,
+ -0.077117636799812317, -0.078382067382335663,
+ -0.055503919720649719, -0.019355267286300659,
+ -0.022441385313868523, -0.073706060647964478,
+ -0.054677654057741165, -0.047119375318288803,
+ -0.044418536126613617, -0.036084383726119995,
+ -0.0206278245896101, -0.031200021505355835,
+ -0.0004070434661116451, 0.0006594572332687676,
+ -0.016584658995270729, 0.07387717068195343,
+ -0.0063191778026521206, 0.051200628280639648,
+ -0.029480356723070145, 0.05176771804690361,
+ 0.038578659296035767, 0.026550088077783585,
+ 0.067103870213031769, 0.001888439292088151,
+ 0.28141644597053528, 0.49543789029121399,
+ 0.6626054048538208, 0.79180729389190674,
+ 0.89210402965545654, 0.96999943256378174,
+ 1.0261462926864624, 1.0267977714538574,
+ 1.0251555442810059, 1.0265737771987915,
+ 1.0278496742248535, 1.0208886861801147,
+ 1.0325057506561279, 0.91415292024612427,
+ 0.83941859006881714, 0.67373806238174438,
+ 0.51683622598648071, 0.38949671387672424,
+ 0.16016888618469238, 0.049505095928907394,
+ -0.16699212789535522, -0.26886492967605591,
+ -0.49256673455238342, -0.59178370237350464,
+ -0.73317724466323853, -0.78922677040100098,
+ -0.88782668113708496, -0.96708977222442627,
+ -0.96490746736526489, -0.94962418079376221,
+ -0.94716215133666992, -0.93755108118057251,
+ -0.84852480888366699, -0.80485564470291138,
+ -0.69762390851974487, -0.58398681879043579,
+ -0.45891636610031128, -0.29681697487831116,
+ -0.16035343706607819, 0.014823081903159618,
+ 0.16282452642917633, 0.33802291750907898)
+
+ src = gr.sig_source_f(sample_rate, gr.GR_SIN_WAVE, 200, 1, 0)
+ head = gr.head(gr.sizeof_float, 100)
+ src_scale = gr.multiply_const_ff(scale_factor)
+
+ interp = blks2.rational_resampler_fff(8, 1)
+ f2s = gr.float_to_short ()
+
+ enc = cvsd_vocoder.encode_sb()
+ dec = cvsd_vocoder.decode_bs()
+
+ s2f = gr.short_to_float ()
+ decim = blks2.rational_resampler_fff(1, 8)
+
+ sink_scale = gr.multiply_const_ff(1.0/scale_factor)
+ sink = gr.vector_sink_f()
+
+ self.tb.connect(src, src_scale, interp, f2s, enc)
+ self.tb.connect(enc, dec, s2f, decim, sink_scale, head, sink)
+ self.tb.run()
+ print sink.data()
+
+ self.assertFloatTuplesAlmostEqual (expected_data, sink.data(), 5)
+ """
+
+if __name__ == '__main__':
+ gr_unittest.run(test_cvsd_vocoder, "test_cvsd_vocoder.xml")
diff --git a/gr-vocoder/python/qa_g721_vocoder.py b/gr-vocoder/python/qa_g721_vocoder.py
new file mode 100755
index 000000000..79cc944f3
--- /dev/null
+++ b/gr-vocoder/python/qa_g721_vocoder.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+from vocoder_swig import *
+
+class test_g721_vocoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test001_module_load (self):
+ enc = g721_encode_sb();
+ dec = g721_decode_bs();
+
+if __name__ == '__main__':
+ gr_unittest.run(test_g721_vocoder, "test_g721_vocoder.xml")
diff --git a/gr-vocoder/python/qa_g723_24_vocoder.py b/gr-vocoder/python/qa_g723_24_vocoder.py
new file mode 100755
index 000000000..ccf215f46
--- /dev/null
+++ b/gr-vocoder/python/qa_g723_24_vocoder.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+from vocoder_swig import *
+
+class test_g723_24_vocoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test001_module_load (self):
+ enc = g723_24_encode_sb();
+ dec = g723_24_decode_bs();
+
+if __name__ == '__main__':
+ gr_unittest.run(test_g723_24_vocoder, "test_g723_24_vocoder.xml")
diff --git a/gr-vocoder/python/qa_g723_40_vocoder.py b/gr-vocoder/python/qa_g723_40_vocoder.py
new file mode 100755
index 000000000..9e6a52339
--- /dev/null
+++ b/gr-vocoder/python/qa_g723_40_vocoder.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+from vocoder_swig import *
+
+class test_g723_40_vocoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test001_module_load (self):
+ enc = g723_40_encode_sb();
+ dec = g723_40_decode_bs();
+
+if __name__ == '__main__':
+ gr_unittest.run(test_g723_40_vocoder, "test_g723_40_vocoder.xml")
diff --git a/gr-vocoder/python/qa_gsm_full_rate.py b/gr-vocoder/python/qa_gsm_full_rate.py
new file mode 100755
index 000000000..f9125905c
--- /dev/null
+++ b/gr-vocoder/python/qa_gsm_full_rate.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# Copyright 2004,2007,2010 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+import vocoder_swig
+
+class test_gsm_vocoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test001_module_load (self):
+ enc = vocoder_swig.gsm_fr_encode_sp();
+ dec = vocoder_swig.gsm_fr_decode_ps();
+
+if __name__ == '__main__':
+ gr_unittest.run(test_gsm_vocoder, "test_gsm_vocoder.xml")
diff --git a/gr-vocoder/python/qa_ulaw_vocoder.py b/gr-vocoder/python/qa_ulaw_vocoder.py
new file mode 100755
index 000000000..0e201638c
--- /dev/null
+++ b/gr-vocoder/python/qa_ulaw_vocoder.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+from vocoder_swig import *
+
+class test_ulaw_vocoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test001_module_load (self):
+ enc = ulaw_encode_sb();
+ dec = ulaw_decode_bs();
+
+if __name__ == '__main__':
+ gr_unittest.run(test_ulaw_vocoder, "test_ulaw_vocoder.xml")
diff --git a/gr-vocoder/python/run_tests.in b/gr-vocoder/python/run_tests.in
new file mode 100644
index 000000000..e0c61a6b4
--- /dev/null
+++ b/gr-vocoder/python/run_tests.in
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# 1st parameter is absolute path to component source directory
+# 2nd parameter is absolute path to component build directory
+# 3rd parameter is path to Python QA directory
+
+@top_builddir@/run_tests.sh \
+ @abs_top_srcdir@/gr-vocoder \
+ @abs_top_builddir@/gr-vocoder \
+ @srcdir@