[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r6366 - gnuradio/branches/developers/jcorgan/t162/gnur
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r6366 - gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl |
Date: |
Sat, 8 Sep 2007 12:15:55 -0600 (MDT) |
Author: jcorgan
Date: 2007-09-08 12:15:54 -0600 (Sat, 08 Sep 2007)
New Revision: 6366
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/cpm.py
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/d8psk.py
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk.py
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/dqpsk.py
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/gmsk.py
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/pkt.py
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam16.py
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam256.py
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam64.py
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam8.py
Log:
Completed conversion of digital modulators in blks2 to hier_block2
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/cpm.py
===================================================================
---
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/cpm.py
2007-09-08 17:40:00 UTC (rev 6365)
+++
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/cpm.py
2007-09-08 18:15:54 UTC (rev 6366)
@@ -48,8 +48,8 @@
# CPM modulator
# /////////////////////////////////////////////////////////////////////////////
-class cpm_mod(gr.hier_block):
- def __init__(self, fg,
+class cpm_mod(gr.hier_block2):
+ def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
bits_per_symbol=_def_bits_per_symbol,
h_numerator=_def_h_numerator,
@@ -74,8 +74,6 @@
f(t)=sum_k a_k g(t-kT)
(normalizing assumption: int_0^infty g(t) dt = 1/2)
- @param fg: flow graph
- @type fg: flow graph
@param samples_per_symbol: samples per baud >= 2
@type samples_per_symbol: integer
@param bits_per_symbol: bits per symbol
@@ -99,7 +97,10 @@
@type debug: bool
"""
- self._fg = fg
+ gr.hier_block2.__init__("cpm_mod",
+ gr.io_signature(1, 1, gr.sizeof_char), #
Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) #
Output signature
+
self._samples_per_symbol = samples_per_symbol
self._bits_per_symbol = bits_per_symbol
self._h_numerator = h_numerator
@@ -163,16 +164,15 @@
if log:
self._setup_logging()
- # Connect & Initialize base class
- self._fg.connect(self.B2s, self.pam, self.filter, self.fmmod)
- gr.hier_block.__init__(self, self._fg, self.B2s, self.fmmod)
+ # Connect
+ self.connect(self, self.B2s, self.pam, self.filter, self.fmmod, self)
#def samples_per_symbol(self):
#return self._samples_per_symbol
-
+
#def bits_per_symbol(self):
#return self._bits_per_symbol
-
+
#def h_numerator(self):
#return self._h_numerator
@@ -204,14 +204,14 @@
def _setup_logging(self):
print "Modulation logging turned on."
- self._fg.connect(self.B2s,
- gr.file_sink(gr.sizeof_float, "symbols.dat"))
- self._fg.connect(self.pam,
- gr.file_sink(gr.sizeof_float, "pam.dat"))
- self._fg.connect(self.filter,
- gr.file_sink(gr.sizeof_float, "filter.dat"))
- self._fg.connect(self.fmmod,
- gr.file_sink(gr.sizeof_gr_complex, "fmmod.dat"))
+ self.connect(self.B2s,
+ gr.file_sink(gr.sizeof_float, "symbols.dat"))
+ self.connect(self.pam,
+ gr.file_sink(gr.sizeof_float, "pam.dat"))
+ self.connect(self.filter,
+ gr.file_sink(gr.sizeof_float, "filter.dat"))
+ self.connect(self.fmmod,
+ gr.file_sink(gr.sizeof_gr_complex, "fmmod.dat"))
def add_options(parser):
@@ -228,7 +228,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return modulation_utils.extract_kwargs_from_options(cpm_mod.__init__,
- ('self', 'fg'),
options)
+ ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/d8psk.py
===================================================================
---
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/d8psk.py
2007-09-08 17:40:00 UTC (rev 6365)
+++
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/d8psk.py
2007-09-08 18:15:54 UTC (rev 6366)
@@ -48,9 +48,9 @@
# D8PSK modulator
# /////////////////////////////////////////////////////////////////////////////
-class d8psk_mod(gr.hier_block):
+class d8psk_mod(gr.hier_block2):
- def __init__(self, fg,
+ def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
excess_bw=_def_excess_bw,
gray_code=_def_gray_code,
@@ -62,8 +62,6 @@
The input is a byte stream (unsigned char) and the
output is the complex modulated signal at baseband.
- @param fg: flow graph
- @type fg: flow graph
@param samples_per_symbol: samples per symbol >= 2
@type samples_per_symbol: integer
@param excess_bw: Root-raised cosine filter excess bandwidth
@@ -76,7 +74,10 @@
@type debug: bool
"""
- self._fg = fg
+ gr.hier_block2.__init__(self, "d8psk_mod",
+ gr.io_signature(1, 1, gr.sizeof_char), #
Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) #
Output signature
+
self._samples_per_symbol = samples_per_symbol
self._excess_bw = excess_bw
self._gray_code = gray_code
@@ -120,9 +121,8 @@
self._setup_logging()
# Connect & Initialize base class
- self._fg.connect(self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter)
- gr.hier_block.__init__(self, self._fg, self.bytes2chunks,
self.rrc_filter)
+ self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
+ self.chunks2symbols, self.rrc_filter, self)
def samples_per_symbol(self):
return self._samples_per_symbol
@@ -138,16 +138,16 @@
def _setup_logging(self):
print "Modulation logging turned on."
- self._fg.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "tx_bytes2chunks.dat"))
- self._fg.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "tx_graycoder.dat"))
- self._fg.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "tx_diffenc.dat"))
- self._fg.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex,
"tx_chunks2symbols.dat"))
- self._fg.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex,
"tx_rrc_filter.dat"))
+ self.connect(self.bytes2chunks,
+ gr.file_sink(gr.sizeof_char, "tx_bytes2chunks.dat"))
+ self.connect(self.symbol_mapper,
+ gr.file_sink(gr.sizeof_char, "tx_graycoder.dat"))
+ self.connect(self.diffenc,
+ gr.file_sink(gr.sizeof_char, "tx_diffenc.dat"))
+ self.connect(self.chunks2symbols,
+ gr.file_sink(gr.sizeof_gr_complex,
"tx_chunks2symbols.dat"))
+ self.connect(self.rrc_filter,
+ gr.file_sink(gr.sizeof_gr_complex, "tx_rrc_filter.dat"))
def add_options(parser):
"""
@@ -166,7 +166,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return modulation_utils.extract_kwargs_from_options(d8psk_mod.__init__,
- ('self', 'fg'),
options)
+ ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
@@ -176,9 +176,9 @@
# Differentially coherent detection of differentially encoded 8psk
# /////////////////////////////////////////////////////////////////////////////
-class d8psk_demod(gr.hier_block):
+class d8psk_demod(gr.hier_block2):
- def __init__(self, fg,
+ def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
excess_bw=_def_excess_bw,
costas_alpha=_def_costas_alpha,
@@ -194,8 +194,6 @@
The input is the complex modulated signal at baseband.
The output is a stream of bits packed 1 bit per byte (LSB)
- @param fg: flow graph
- @type fg: flow graph
@param samples_per_symbol: samples per symbol >= 2
@type samples_per_symbol: float
@param excess_bw: Root-raised cosine filter excess bandwidth
@@ -215,8 +213,11 @@
@param debug: Print modualtion data to files?
@type debug: bool
"""
+
+ gr.hier_block2.__init__(self, "d8psk_demod",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), #
Input signature
+ gr.io_signature(1, 1, gr.sizeof_char)) #
Output signature
- self._fg = fg
self._samples_per_symbol = samples_per_symbol
self._excess_bw = excess_bw
self._costas_alpha = costas_alpha
@@ -284,10 +285,9 @@
if log:
self._setup_logging()
- # Connect & Initialize base class
- self._fg.connect(self.pre_scaler, self.agc, self.rrc_filter,
self.receiver,
- self.diffdec, self.slicer, self.symbol_mapper,
self.unpack)
- gr.hier_block.__init__(self, self._fg, self.pre_scaler, self.unpack)
+ # Connect
+ self.connect(self, self.pre_scaler, self.agc, self.rrc_filter,
self.receiver,
+ self.diffdec, self.slicer, self.symbol_mapper,
self.unpack, self)
def samples_per_symbol(self):
return self._samples_per_symbol
@@ -312,22 +312,22 @@
def _setup_logging(self):
print "Modulation logging turned on."
- self._fg.connect(self.pre_scaler,
- gr.file_sink(gr.sizeof_gr_complex,
"rx_prescaler.dat"))
- self._fg.connect(self.agc,
- gr.file_sink(gr.sizeof_gr_complex, "rx_agc.dat"))
- self._fg.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex,
"rx_rrc_filter.dat"))
- self._fg.connect(self.receiver,
- gr.file_sink(gr.sizeof_gr_complex, "rx_receiver.dat"))
- self._fg.connect(self.diffdec,
- gr.file_sink(gr.sizeof_gr_complex, "rx_diffdec.dat"))
- self._fg.connect(self.slicer,
- gr.file_sink(gr.sizeof_char, "rx_slicer.dat"))
- self._fg.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "rx_gray_decoder.dat"))
- self._fg.connect(self.unpack,
- gr.file_sink(gr.sizeof_char, "rx_unpack.dat"))
+ self.connect(self.pre_scaler,
+ gr.file_sink(gr.sizeof_gr_complex, "rx_prescaler.dat"))
+ self.connect(self.agc,
+ gr.file_sink(gr.sizeof_gr_complex, "rx_agc.dat"))
+ self.connect(self.rrc_filter,
+ gr.file_sink(gr.sizeof_gr_complex, "rx_rrc_filter.dat"))
+ self.connect(self.receiver,
+ gr.file_sink(gr.sizeof_gr_complex, "rx_receiver.dat"))
+ self.connect(self.diffdec,
+ gr.file_sink(gr.sizeof_gr_complex, "rx_diffdec.dat"))
+ self.connect(self.slicer,
+ gr.file_sink(gr.sizeof_char, "rx_slicer.dat"))
+ self.connect(self.symbol_mapper,
+ gr.file_sink(gr.sizeof_char, "rx_gray_decoder.dat"))
+ self.connect(self.unpack,
+ gr.file_sink(gr.sizeof_char, "rx_unpack.dat"))
def add_options(parser):
"""
@@ -351,7 +351,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return modulation_utils.extract_kwargs_from_options(
- d8psk_demod.__init__, ('self', 'fg'), options)
+ d8psk_demod.__init__, ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
@@ -359,5 +359,5 @@
# Add these to the mod/demod registry
#
# NOT READY TO BE USED YET -- ENABLE AT YOUR OWN RISK
-#modulation_utils.add_type_1_mod('d8psk', d8psk_mod)
-#modulation_utils.add_type_1_demod('d8psk', d8psk_demod)
+modulation_utils.add_type_1_mod('d8psk', d8psk_mod)
+modulation_utils.add_type_1_demod('d8psk', d8psk_demod)
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk.py
===================================================================
---
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk.py
2007-09-08 17:40:00 UTC (rev 6365)
+++
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk.py
2007-09-08 18:15:54 UTC (rev 6366)
@@ -147,7 +147,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return modulation_utils.extract_kwargs_from_options(dbpsk_mod.__init__,
- ('self', 'fg'),
options)
+ ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
@@ -354,7 +354,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return modulation_utils.extract_kwargs_from_options(
- dbpsk_demod.__init__, ('self', 'fg'), options)
+ dbpsk_demod.__init__, ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
#
# Add these to the mod/demod registry
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/dqpsk.py
===================================================================
---
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/dqpsk.py
2007-09-08 17:40:00 UTC (rev 6365)
+++
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/dqpsk.py
2007-09-08 18:15:54 UTC (rev 6366)
@@ -62,8 +62,6 @@
The input is a byte stream (unsigned char) and the
output is the complex modulated signal at baseband.
- @param fg: flow graph
- @type fg: flow graph
@param samples_per_symbol: samples per symbol >= 2
@type samples_per_symbol: integer
@param excess_bw: Root-raised cosine filter excess bandwidth
@@ -169,7 +167,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return modulation_utils.extract_kwargs_from_options(dqpsk_mod.__init__,
- ('self', 'fg'),
options)
+ ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
@@ -197,8 +195,6 @@
The input is the complex modulated signal at baseband.
The output is a stream of bits packed 1 bit per byte (LSB)
- @param fg: flow graph
- @type fg: flow graph
@param samples_per_symbol: samples per symbol >= 2
@type samples_per_symbol: float
@param excess_bw: Root-raised cosine filter excess bandwidth
@@ -356,7 +352,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return modulation_utils.extract_kwargs_from_options(
- dqpsk_demod.__init__, ('self', 'fg'), options)
+ dqpsk_demod.__init__, ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/gmsk.py
===================================================================
---
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/gmsk.py
2007-09-08 17:40:00 UTC (rev 6365)
+++
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/gmsk.py
2007-09-08 18:15:54 UTC (rev 6366)
@@ -2,7 +2,7 @@
# GMSK modulation and demodulation.
#
#
-# Copyright 2005,2006 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -149,7 +149,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return modulation_utils.extract_kwargs_from_options(gmsk_mod.__init__,
- ('self', 'fg'),
options)
+ ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
@@ -281,7 +281,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return
modulation_utils.extract_kwargs_from_options(gmsk_demod.__init__,
- ('self', 'fg'),
options)
+ ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/pkt.py
===================================================================
---
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/pkt.py
2007-09-08 17:40:00 UTC (rev 6365)
+++
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/pkt.py
2007-09-08 18:15:54 UTC (rev 6366)
@@ -113,8 +113,6 @@
The input is the complex modulated signal at baseband.
Demodulated packets are sent to the handler.
- @param fg: flow graph
- @type fg: flow graph
@param demodulator: instance of demodulator class (gr_block or
hier_block)
@type demodulator: complex baseband in
@param access_code: AKA sync vector
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam16.py
===================================================================
---
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam16.py
2007-09-08 17:40:00 UTC (rev 6365)
+++
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam16.py
2007-09-08 18:15:54 UTC (rev 6366)
@@ -1,5 +1,5 @@
#
-# Copyright 2005,2006 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -48,9 +48,9 @@
# QAM16 modulator
# /////////////////////////////////////////////////////////////////////////////
-class qam16_mod(gr.hier_block):
+class qam16_mod(gr.hier_block2):
- def __init__(self, fg,
+ def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
excess_bw=_def_excess_bw,
gray_code=_def_gray_code,
@@ -63,8 +63,6 @@
The input is a byte stream (unsigned char) and the
output is the complex modulated signal at baseband.
- @param fg: flow graph
- @type fg: flow graph
@param samples_per_symbol: samples per symbol >= 2
@type samples_per_symbol: integer
@param excess_bw: Root-raised cosine filter excess bandwidth
@@ -77,7 +75,10 @@
@type debug: bool
"""
- self._fg = fg
+ gr.hier_block2.__init__(self, "qam16_mod",
+ gr.io_signature(1, 1, gr.sizeof_char), #
Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) #
Output signature
+
self._samples_per_symbol = samples_per_symbol
self._excess_bw = excess_bw
self._gray_code = gray_code
@@ -121,10 +122,9 @@
if log:
self._setup_logging()
- # Connect & Initialize base class
- self._fg.connect(self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter)
- gr.hier_block.__init__(self, self._fg, self.bytes2chunks,
self.rrc_filter)
+ # Connect
+ self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
+ self.chunks2symbols, self.rrc_filter, self)
def samples_per_symbol(self):
return self._samples_per_symbol
@@ -140,16 +140,16 @@
def _setup_logging(self):
print "Modulation logging turned on."
- self._fg.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "bytes2chunks.dat"))
- self._fg.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "graycoder.dat"))
- self._fg.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "diffenc.dat"))
- self._fg.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex,
"chunks2symbols.dat"))
- self._fg.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
+ self.connect(self.bytes2chunks,
+ gr.file_sink(gr.sizeof_char, "bytes2chunks.dat"))
+ self.connect(self.symbol_mapper,
+ gr.file_sink(gr.sizeof_char, "graycoder.dat"))
+ self.connect(self.diffenc,
+ gr.file_sink(gr.sizeof_char, "diffenc.dat"))
+ self.connect(self.chunks2symbols,
+ gr.file_sink(gr.sizeof_gr_complex, "chunks2symbols.dat"))
+ self.connect(self.rrc_filter,
+ gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
def add_options(parser):
"""
@@ -168,7 +168,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return modulation_utils.extract_kwargs_from_options(qam16_mod.__init__,
- ('self', 'fg'),
options)
+ ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
@@ -177,9 +177,9 @@
#
# /////////////////////////////////////////////////////////////////////////////
-class qam16_demod(gr.hier_block):
+class qam16_demod(gr.hier_block2):
- def __init__(self, fg,
+ def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
excess_bw=_def_excess_bw,
costas_alpha=_def_costas_alpha,
@@ -190,6 +190,9 @@
verbose=_def_verbose,
log=_def_log):
+ gr.hier_block2.__init__(self, "qam16_demod",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), #
Input signature
+ gr.io_signature(1, 1, gr.sizeof_char)) #
Output signature
# do this
pass
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam256.py
===================================================================
---
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam256.py
2007-09-08 17:40:00 UTC (rev 6365)
+++
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam256.py
2007-09-08 18:15:54 UTC (rev 6366)
@@ -1,5 +1,5 @@
#
-# Copyright 2005,2006 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -48,9 +48,9 @@
# QAM256 modulator
# /////////////////////////////////////////////////////////////////////////////
-class qam256_mod(gr.hier_block):
+class qam256_mod(gr.hier_block2):
- def __init__(self, fg,
+ def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
excess_bw=_def_excess_bw,
gray_code=_def_gray_code,
@@ -63,8 +63,6 @@
The input is a byte stream (unsigned char) and the
output is the complex modulated signal at baseband.
- @param fg: flow graph
- @type fg: flow graph
@param samples_per_symbol: samples per symbol >= 2
@type samples_per_symbol: integer
@param excess_bw: Root-raised cosine filter excess bandwidth
@@ -77,7 +75,10 @@
@type debug: bool
"""
- self._fg = fg
+ gr.hier_block2.__init__(self, "qam256_mod",
+ gr.io_signature(1, 1, gr.sizeof_char), #
Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) #
Output signature
+
self._samples_per_symbol = samples_per_symbol
self._excess_bw = excess_bw
self._gray_code = gray_code
@@ -121,10 +122,9 @@
if log:
self._setup_logging()
- # Connect & Initialize base class
- self._fg.connect(self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter)
- gr.hier_block.__init__(self, self._fg, self.bytes2chunks,
self.rrc_filter)
+ # Connect
+ self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
+ self.chunks2symbols, self.rrc_filter, self)
def samples_per_symbol(self):
return self._samples_per_symbol
@@ -140,16 +140,16 @@
def _setup_logging(self):
print "Modulation logging turned on."
- self._fg.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "bytes2chunks.dat"))
- self._fg.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "graycoder.dat"))
- self._fg.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "diffenc.dat"))
- self._fg.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex,
"chunks2symbols.dat"))
- self._fg.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
+ self.connect(self.bytes2chunks,
+ gr.file_sink(gr.sizeof_char, "bytes2chunks.dat"))
+ self.connect(self.symbol_mapper,
+ gr.file_sink(gr.sizeof_char, "graycoder.dat"))
+ self.connect(self.diffenc,
+ gr.file_sink(gr.sizeof_char, "diffenc.dat"))
+ self.connect(self.chunks2symbols,
+ gr.file_sink(gr.sizeof_gr_complex, "chunks2symbols.dat"))
+ self.connect(self.rrc_filter,
+ gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
def add_options(parser):
"""
@@ -168,7 +168,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return
modulation_utils.extract_kwargs_from_options(qam256_mod.__init__,
- ('self', 'fg'),
options)
+ ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
@@ -177,9 +177,9 @@
#
# /////////////////////////////////////////////////////////////////////////////
-class qam256_demod(gr.hier_block):
+class qam256_demod(gr.hier_block2):
- def __init__(self, fg,
+ def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
excess_bw=_def_excess_bw,
costas_alpha=_def_costas_alpha,
@@ -190,6 +190,10 @@
verbose=_def_verbose,
log=_def_log):
+ gr.hier_block2.__init__(self, "qam256_demod",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), #
Input signature
+ gr.io_signature(1, 1, gr.sizeof_char)) #
Output signature
+
# do this
pass
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam64.py
===================================================================
---
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam64.py
2007-09-08 17:40:00 UTC (rev 6365)
+++
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam64.py
2007-09-08 18:15:54 UTC (rev 6366)
@@ -1,5 +1,5 @@
#
-# Copyright 2005,2006 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -48,9 +48,9 @@
# QAM64 modulator
# /////////////////////////////////////////////////////////////////////////////
-class qam64_mod(gr.hier_block):
+class qam64_mod(gr.hier_block2):
- def __init__(self, fg,
+ def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
excess_bw=_def_excess_bw,
gray_code=_def_gray_code,
@@ -63,8 +63,6 @@
The input is a byte stream (unsigned char) and the
output is the complex modulated signal at baseband.
- @param fg: flow graph
- @type fg: flow graph
@param samples_per_symbol: samples per symbol >= 2
@type samples_per_symbol: integer
@param excess_bw: Root-raised cosine filter excess bandwidth
@@ -77,7 +75,9 @@
@type debug: bool
"""
- self._fg = fg
+ gr.hier_block2.__init__(self, "qam64_mod",
+ gr.io_signature(1, 1, gr.sizeof_char), #
Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) #
Output signature
self._samples_per_symbol = samples_per_symbol
self._excess_bw = excess_bw
self._gray_code = gray_code
@@ -121,10 +121,9 @@
if log:
self._setup_logging()
- # Connect & Initialize base class
- self._fg.connect(self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter)
- gr.hier_block.__init__(self, self._fg, self.bytes2chunks,
self.rrc_filter)
+ # Connect
+ self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
+ self.chunks2symbols, self.rrc_filter, self)
def samples_per_symbol(self):
return self._samples_per_symbol
@@ -140,16 +139,16 @@
def _setup_logging(self):
print "Modulation logging turned on."
- self._fg.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "bytes2chunks.dat"))
- self._fg.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "graycoder.dat"))
- self._fg.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "diffenc.dat"))
- self._fg.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex,
"chunks2symbols.dat"))
- self._fg.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
+ self.connect(self.bytes2chunks,
+ gr.file_sink(gr.sizeof_char, "bytes2chunks.dat"))
+ self.connect(self.symbol_mapper,
+ gr.file_sink(gr.sizeof_char, "graycoder.dat"))
+ self.connect(self.diffenc,
+ gr.file_sink(gr.sizeof_char, "diffenc.dat"))
+ self.connect(self.chunks2symbols,
+ gr.file_sink(gr.sizeof_gr_complex, "chunks2symbols.dat"))
+ self.connect(self.rrc_filter,
+ gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
def add_options(parser):
"""
@@ -168,7 +167,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return modulation_utils.extract_kwargs_from_options(qam64_mod.__init__,
- ('self', 'fg'),
options)
+ ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
@@ -177,9 +176,9 @@
#
# /////////////////////////////////////////////////////////////////////////////
-class qam64_demod(gr.hier_block):
+class qam64_demod(gr.hier_block2):
- def __init__(self, fg,
+ def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
excess_bw=_def_excess_bw,
costas_alpha=_def_costas_alpha,
@@ -189,6 +188,10 @@
gray_code=_def_gray_code,
verbose=_def_verbose,
log=_def_log):
+
+ gr.hier_block2.__init__(self, "qam64_demod",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), #
Input signature
+ gr.io_signature(1, 1, gr.sizeof_char)) #
Output signature
# do this
pass
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam8.py
===================================================================
---
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam8.py
2007-09-08 17:40:00 UTC (rev 6365)
+++
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/qam8.py
2007-09-08 18:15:54 UTC (rev 6366)
@@ -1,5 +1,5 @@
#
-# Copyright 2005,2006 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -48,9 +48,9 @@
# QAM8 modulator
# /////////////////////////////////////////////////////////////////////////////
-class qam8_mod(gr.hier_block):
+class qam8_mod(gr.hier_block2):
- def __init__(self, fg,
+ def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
excess_bw=_def_excess_bw,
gray_code=_def_gray_code,
@@ -63,8 +63,6 @@
The input is a byte stream (unsigned char) and the
output is the complex modulated signal at baseband.
- @param fg: flow graph
- @type fg: flow graph
@param samples_per_symbol: samples per symbol >= 2
@type samples_per_symbol: integer
@param excess_bw: Root-raised cosine filter excess bandwidth
@@ -77,7 +75,10 @@
@type debug: bool
"""
- self._fg = fg
+ gr.hier_block2.__init__(self, "qam8_mod",
+ gr.io_signature(1, 1, gr.sizeof_char), #
Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) #
Output signature
+
self._samples_per_symbol = samples_per_symbol
self._excess_bw = excess_bw
self._gray_code = gray_code
@@ -121,10 +122,9 @@
if log:
self._setup_logging()
- # Connect & Initialize base class
- self._fg.connect(self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter)
- gr.hier_block.__init__(self, self._fg, self.bytes2chunks,
self.rrc_filter)
+ # Connect
+ self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
+ self.chunks2symbols, self.rrc_filter, self)
def samples_per_symbol(self):
return self._samples_per_symbol
@@ -140,16 +140,16 @@
def _setup_logging(self):
print "Modulation logging turned on."
- self._fg.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "bytes2chunks.dat"))
- self._fg.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "graycoder.dat"))
- self._fg.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "diffenc.dat"))
- self._fg.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex,
"chunks2symbols.dat"))
- self._fg.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
+ self.connect(self.bytes2chunks,
+ gr.file_sink(gr.sizeof_char, "bytes2chunks.dat"))
+ self.connect(self.symbol_mapper,
+ gr.file_sink(gr.sizeof_char, "graycoder.dat"))
+ self.connect(self.diffenc,
+ gr.file_sink(gr.sizeof_char, "diffenc.dat"))
+ self.connect(self.chunks2symbols,
+ gr.file_sink(gr.sizeof_gr_complex, "chunks2symbols.dat"))
+ self.connect(self.rrc_filter,
+ gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
def add_options(parser):
"""
@@ -168,7 +168,7 @@
Given command line options, create dictionary suitable for passing to
__init__
"""
return modulation_utils.extract_kwargs_from_options(qam8_mod.__init__,
- ('self', 'fg'),
options)
+ ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
@@ -177,9 +177,9 @@
#
# /////////////////////////////////////////////////////////////////////////////
-class qam8_demod(gr.hier_block):
+class qam8_demod(gr.hier_block2):
- def __init__(self, fg,
+ def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
excess_bw=_def_excess_bw,
costas_alpha=_def_costas_alpha,
@@ -190,6 +190,10 @@
verbose=_def_verbose,
log=_def_log):
+ gr.hier_block2.__init__(self, "qam8_demod",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), #
Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_char)) #
Output signature
+
# do this
pass
@@ -201,5 +205,5 @@
# Add these to the mod/demod registry
#
# NOT READY TO BE USED YET -- ENABLE AT YOUR OWN RISK
-#modulation_utils.add_type_1_mod('qam8', qam8_mod)
+modulation_utils.add_type_1_mod('qam8', qam8_mod)
#modulation_utils.add_type_1_demod('qam8', qam8_demod)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r6366 - gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl,
jcorgan <=