[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] gr-error-correcting-codes/src/python qa_test_co...
From: |
Michael Dickens |
Subject: |
[Commit-gnuradio] gr-error-correcting-codes/src/python qa_test_co... |
Date: |
Fri, 14 Jul 2006 15:52:45 +0000 |
CVSROOT: /sources/gnuradio
Module name: gr-error-correcting-codes
Changes by: Michael Dickens <michaelld> 06/07/14 15:52:45
Modified files:
src/python : qa_test_coding_1.py
qa_test_encoder_convolutional_1.py
Added files:
src/python : qa_test_encoder_convolutional_2.py
Log message:
Updated QA tests.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/python/qa_test_coding_1.py?cvsroot=gnuradio&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/python/qa_test_encoder_convolutional_1.py?cvsroot=gnuradio&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gr-error-correcting-codes/src/python/qa_test_encoder_convolutional_2.py?cvsroot=gnuradio&rev=1.1
Patches:
Index: qa_test_coding_1.py
===================================================================
RCS file:
/sources/gnuradio/gr-error-correcting-codes/src/python/qa_test_coding_1.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- qa_test_coding_1.py 3 Jul 2006 02:11:59 -0000 1.1
+++ qa_test_coding_1.py 14 Jul 2006 15:52:45 -0000 1.2
@@ -20,11 +20,9 @@
# Boston, MA 02111-1307, USA.
#
-from gnuradio import gr
-from gnuradio import audio
+from gnuradio import gr, audio, ecc
from gnuradio.eng_option import eng_option
from optparse import OptionParser
-from und import error-correcting-codes
class my_graph(gr.flow_graph):
@@ -60,13 +58,11 @@
else:
enc_dec_chan = enc_code_out_chan
- ss_enc = error-correcting-codes.streams_encode_convolutional
(audio_el_size,
- frame_size,
- do_termination,
- do_mux_outputs,
+ ss_enc = ecc.streams_encode_convolutional (frame_size,
enc_code_in_chan,
enc_code_out_chan,
- code_generators)
+ code_generators,
+ do_termination)
# for now
ss2s = gr.streams_to_stream (1, enc_dec_chan);
ns = gr.null_sink (1);
Index: qa_test_encoder_convolutional_1.py
===================================================================
RCS file:
/sources/gnuradio/gr-error-correcting-codes/src/python/qa_test_encoder_convolutional_1.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- qa_test_encoder_convolutional_1.py 12 Jul 2006 23:43:38 -0000 1.2
+++ qa_test_encoder_convolutional_1.py 14 Jul 2006 15:52:45 -0000 1.3
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2004,2005 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,15 +20,52 @@
# Boston, MA 02111-1307, USA.
#
-from gnuradio import ecc, gr
+from gnuradio import gr, audio, ecc
from gnuradio.eng_option import eng_option
+from optparse import OptionParser
-def main ():
- e1 = ecc.streams_encode_convolutional (100, 3, 2, [1, 0, 5, 0, 1, 6])
+class my_graph(gr.flow_graph):
- e2 = ecc.streams_encode_convolutional (100, 2, 3, [1, 0, 0, 1, 5, 6])
+ def __init__(self):
+ gr.flow_graph.__init__(self)
- e3 = ecc.streams_encode_convolutional_feedback (100, 2, 3, [1, 7, 0, 1,
5, 6], [1, 1, 1, 1, 017, 017])
+ parser = OptionParser(option_class=eng_option)
+ parser.add_option("-O", "--audio-output", type="string", default="",
+ help="pcm output device name. E.g., hw:0,0 or
/dev/dsp")
+ parser.add_option("-r", "--sample-rate", type="eng_float",
default=48000,
+ help="set sample rate to RATE (48000)")
+ (options, args) = parser.parse_args ()
+ if len(args) != 0:
+ parser.print_help()
+ raise SystemExit, 1
+
+ sample_rate = 4410 # int(options.sample_rate)
+ audio_option = "2" # options.audio_output
+ src = audio.source (sample_rate, audio_option)
+ src_out_chan = src.output_signature().max_streams()
+ dst = audio.sink (sample_rate, str(src_out_chan))
+ dst_in_chan = dst.input_signature().max_streams()
+ audio_el_size = src.output_signature().sizeof_stream_item(1)
+ frame_size = 10
+ enc_code_in_chan = src_out_chan
+ code_generators = [05, 06] #, 03, 04] # , 0, 07]
+ enc_code_out_chan = len (code_generators) / enc_code_in_chan
+ do_termination = 1
+
+ ss_enc = ecc.streams_encode_convolutional (frame_size,
+ enc_code_in_chan,
+ enc_code_out_chan,
+ code_generators,
+ do_termination)
+ for i in range (enc_code_in_chan):
+ self.connect ((src, i), (ss_enc, i))
+
+ for i in range (enc_code_out_chan):
+ ns = gr.null_sink (1)
+ self.connect ((ss_enc, i), ns)
if __name__ == '__main__':
- main ()
+ try:
+ my_graph().run()
+ except KeyboardInterrupt:
+ pass
Index: qa_test_encoder_convolutional_2.py
===================================================================
RCS file: qa_test_encoder_convolutional_2.py
diff -N qa_test_encoder_convolutional_2.py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ qa_test_encoder_convolutional_2.py 14 Jul 2006 15:52:45 -0000 1.1
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+#
+# Copyright 2006 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 2, 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., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+#
+
+from gnuradio import ecc, gr
+from gnuradio.eng_option import eng_option
+
+def main ():
+ e1 = ecc.streams_encode_convolutional (100, 3, 2, [1, 0, 5, 0, 1, 6])
+
+ e2 = ecc.streams_encode_convolutional (100, 2, 3, [1, 0, 0, 1, 5, 6])
+
+ e3 = ecc.streams_encode_convolutional_feedback (100, 2, 3, [1, 7, 0, 1,
5, 6], [1, 1, 1, 1, 017, 017])
+
+if __name__ == '__main__':
+ main ()
- [Commit-gnuradio] gr-error-correcting-codes/src/python qa_test_co...,
Michael Dickens <=