diff options
author | jcorgan | 2008-04-15 21:31:29 +0000 |
---|---|---|
committer | jcorgan | 2008-04-15 21:31:29 +0000 |
commit | a52f9a19581901beabc9111917965b9817231014 (patch) | |
tree | 5e12980ed7d22dbc8c0f963579e3855b88df5897 /gnuradio-core/src/python | |
parent | 42b48770e756f1c082f5dfc9e757fafe69263496 (diff) | |
download | gnuradio-a52f9a19581901beabc9111917965b9817231014.tar.gz gnuradio-a52f9a19581901beabc9111917965b9817231014.tar.bz2 gnuradio-a52f9a19581901beabc9111917965b9817231014.zip |
Merged r8195:8205 from jcorgan/ecc into trunk. Adds convolutional encoder
and decoder corresponding to the R=1/2, K=7 CCSDS standard ("Voyager").
This code is a GNU Radio wrapper around a 1995-era KA9Q portable-C
implementation, and is designed for continuous streaming data, not packets.
The encoder takes MSB packed bytes and outputs channel symbols 0 or 1.
The decoder uses soft-decision Viterbi decoding on a floating point stream of
(possibly noise corrupted) [1.0, 1.0] symbols, and outputs MSB packed
decoded bytes.
Benchmarking on a 2.16 GHz Intel Core 2 Duo shows 4.7 Mbps decoding rate at
100% CPU usage (single core). (There is a newer KA9Q library that implements
SIMD speed ups with correspondingly faster performance.)
The KA9Q library is placed into src/lib/viterbi. It could use some cleanup,
file/function renaming, and refactoring, or even replacement with the newer
libfec code that is available.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@8206 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/python')
-rw-r--r-- | gnuradio-core/src/python/gnuradio/gr/Makefile.am | 1 | ||||
-rwxr-xr-x | gnuradio-core/src/python/gnuradio/gr/qa_ecc_ccsds_27.py | 50 |
2 files changed, 51 insertions, 0 deletions
diff --git a/gnuradio-core/src/python/gnuradio/gr/Makefile.am b/gnuradio-core/src/python/gnuradio/gr/Makefile.am index 5aaef2540..7a317a1a3 100644 --- a/gnuradio-core/src/python/gnuradio/gr/Makefile.am +++ b/gnuradio-core/src/python/gnuradio/gr/Makefile.am @@ -49,6 +49,7 @@ noinst_PYTHON = \ qa_agc.py \ qa_argmax.py \ qa_bin_statistics.py \ + qa_ecc_ccsds27.py \ qa_cma_equalizer.py \ qa_complex_to_xxx.py \ qa_constellation_decoder_cb.py \ diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_ecc_ccsds_27.py b/gnuradio-core/src/python/gnuradio/gr/qa_ecc_ccsds_27.py new file mode 100755 index 000000000..f02c1a323 --- /dev/null +++ b/gnuradio-core/src/python/gnuradio/gr/qa_ecc_ccsds_27.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# +# Copyright 2004,2007 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 + +class test_ccsds_27 (gr_unittest.TestCase): + + def setUp (self): + self.tb = gr.top_block () + + def tearDown (self): + self.tb = None + + def test_ccsds_27 (self): + src_data = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) + expected = (0, 0, 0, 0, 1, 2, 3, 4, 5, 6) + src = gr.vector_source_b(src_data) + enc = gr.encode_ccsds_27_bb() + b2f = gr.char_to_float() + add = gr.add_const_ff(-0.5) + mul = gr.multiply_const_ff(2.0) + dec = gr.decode_ccsds_27_fb() + dst = gr.vector_sink_b() + self.tb.connect(src, enc, b2f, add, mul, dec, dst) + self.tb.run() + dst_data = dst.data() + self.assertEqual(expected, dst_data) + + +if __name__ == '__main__': + gr_unittest.main () |