[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r6447 - in gnuradio/branches/developers/jcorgan/t162:
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r6447 - in gnuradio/branches/developers/jcorgan/t162: gnuradio-core/src/python/gnuradio/blks2impl gr-pager/src |
Date: |
Sat, 15 Sep 2007 12:03:29 -0600 (MDT) |
Author: jcorgan
Date: 2007-09-15 12:03:29 -0600 (Sat, 15 Sep 2007)
New Revision: 6447
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/filterbank.py
gnuradio/branches/developers/jcorgan/t162/gr-pager/src/usrp_flex_band.py
Log:
Converted filterbank hier_block to hier_block2
Modified:
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/filterbank.py
===================================================================
---
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/filterbank.py
2007-09-15 14:08:39 UTC (rev 6446)
+++
gnuradio/branches/developers/jcorgan/t162/gnuradio-core/src/python/gnuradio/blks2impl/filterbank.py
2007-09-15 18:03:29 UTC (rev 6447)
@@ -1,5 +1,5 @@
#
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -34,13 +34,13 @@
return [tuple(x) for x in result]
-class synthesis_filterbank(gr.hier_block):
+class synthesis_filterbank(gr.hier_block2):
"""
Uniformly modulated polyphase DFT filter bank: synthesis
See http://cnx.rice.edu/content/m10424/latest
"""
- def __init__(self, fg, mpoints, taps=None):
+ def __init__(self, mpoints, taps=None):
"""
Takes M complex streams in, produces single complex stream out
that runs at M times the input sample rate
@@ -82,7 +82,11 @@
utility.
"""
item_size = gr.sizeof_gr_complex
+ gr.hier_block2.__init__(self, "synthesis_filterbank",
+ gr.io_signature(mpoints, mpoints, item_size),
# Input signature
+ gr.io_signature(1, 1, item_size))
# Output signature
+
if taps is None:
taps = _generate_synthesis_taps(mpoints)
@@ -100,36 +104,39 @@
# mpoints filters go in here...
self.ss2s = gr.streams_to_stream(item_size, mpoints)
- fg.connect(self.ss2v, self.ifft, self.v2ss)
+ for i in range(mpoints):
+ self.connect((self, i), (self.ss2v, i))
+
+ self.connect(self.ss2v, self.ifft, self.v2ss, self)
# build mpoints fir filters...
for i in range(mpoints):
f = gr.fft_filter_ccc(1, sub_taps[i])
- fg.connect((self.v2ss, i), f)
- fg.connect(f, (self.ss2s, i))
+ self.connect((self.v2ss, i), f)
+ self.connect(f, (self.ss2s, i))
- gr.hier_block.__init__(self, fg, self.ss2v, self.ss2s)
-
-class analysis_filterbank(gr.hier_block):
+class analysis_filterbank(gr.hier_block2):
"""
Uniformly modulated polyphase DFT filter bank: analysis
See http://cnx.rice.edu/content/m10424/latest
"""
- def __init__(self, fg, mpoints, taps=None):
+ def __init__(self, mpoints, taps=None):
"""
Takes 1 complex stream in, produces M complex streams out
that runs at 1/M times the input sample rate
- @param fg: flow_graph
@param mpoints: number of freq bins/interpolation factor/subbands
@param taps: filter taps for subband filter
Same channel to frequency mapping as described above.
"""
item_size = gr.sizeof_gr_complex
-
+ gr.hier_block2.__init__(self, "analysis_filterbank",
+ gr.io_signature(1, 1, item_size),
# Input signature
+ gr.io_signature(mpoints, mpoints, item_size))
# Output signature
+
if taps is None:
taps = _generate_synthesis_taps(mpoints)
@@ -149,11 +156,13 @@
self.fft = gr.fft_vcc(mpoints, True, [])
self.v2ss = gr.vector_to_streams(item_size, mpoints)
+ self.connect(self, self.s2ss)
+
# build mpoints fir filters...
for i in range(mpoints):
f = gr.fft_filter_ccc(1, sub_taps[mpoints-i-1])
- fg.connect((self.s2ss, i), f)
- fg.connect(f, (self.ss2v, i))
-
- fg.connect(self.ss2v, self.fft, self.v2ss)
- gr.hier_block.__init__(self, fg, self.s2ss, self.v2ss)
+ self.connect((self.s2ss, i), f)
+ self.connect(f, (self.ss2v, i))
+ self.connect((self.v2ss, i), (self, i))
+
+ self.connect(self.ss2v, self.fft, self.v2ss)
Modified:
gnuradio/branches/developers/jcorgan/t162/gr-pager/src/usrp_flex_band.py
===================================================================
--- gnuradio/branches/developers/jcorgan/t162/gr-pager/src/usrp_flex_band.py
2007-09-15 14:08:39 UTC (rev 6446)
+++ gnuradio/branches/developers/jcorgan/t162/gr-pager/src/usrp_flex_band.py
2007-09-15 18:03:29 UTC (rev 6447)
@@ -53,6 +53,10 @@
if options.log:
self.connect((bank, i), gr.file_sink(gr.sizeof_gr_complex,
'chan_'+'%3.3f'%(freq/1e6)+'.dat'))
+ def __del__(self):
+ # Avoid weak-ref error
+ del self.subdev
+
def main():
parser = OptionParser(option_class=eng_option)
parser.add_option("-f", "--frequency", type="eng_float", default=929.5e6,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r6447 - in gnuradio/branches/developers/jcorgan/t162: gnuradio-core/src/python/gnuradio/blks2impl gr-pager/src,
jcorgan <=