commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r11276 - gnuradio/branches/developers/trondeau/pfb/gnu


From: trondeau
Subject: [Commit-gnuradio] r11276 - gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter
Date: Tue, 23 Jun 2009 21:02:34 -0600 (MDT)

Author: trondeau
Date: 2009-06-23 21:02:33 -0600 (Tue, 23 Jun 2009)
New Revision: 11276

Added:
   
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/channelize.py
Log:
test program for the pfb_filter.

Added: 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/channelize.py
===================================================================
--- 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/channelize.py
                                (rev 0)
+++ 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/channelize.py
        2009-06-24 03:02:33 UTC (rev 11276)
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+
+from gnuradio import gr
+import math
+import os
+
+print os.getpid()
+raw_input()
+
+class pfb_top_block(gr.top_block):
+    def __init__(self):
+        gr.top_block.__init__(self)
+
+        self._N = 200000
+        self._fs = 10000
+        self._M = 10
+        self._taps = gr.firdes.low_pass(1, self._fs, 100, 10)
+        fc = 200
+
+        tpc = math.ceil(float(len(self._taps)) /  float(self._M))
+
+        print "Number of taps:     ", len(self._taps)
+        print "Number of channels: ", self._M
+        print "Taps per channel:   ", tpc
+        
+        self.signals = list()
+        self.add = gr.add_cc()
+        freqs = [10, 80]
+        for i in xrange(len(freqs)):
+            self.signals.append(gr.sig_source_c(self._fs, gr.GR_SIN_WAVE, 
freqs[i], 1))
+            self.connect(self.signals[i], (self.add,i))
+
+        self.head = gr.head(gr.sizeof_gr_complex, self._N)
+
+        self.pfb = gr.pfb_filter_ccf(self._M, self._taps)
+
+        self.v2s = gr.vector_to_streams(gr.sizeof_gr_complex, self._M)
+
+        self.snk_i = gr.file_sink(gr.sizeof_gr_complex, "input.32c")
+        self.snk_o = gr.file_sink(gr.sizeof_gr_complex*self._M, "output.32c")
+
+        # Create a file sink for each of M output channels of the filter and 
connect it
+        self.snks = list()
+        for i in xrange(self._M):
+            self.snks.append(gr.file_sink(gr.sizeof_gr_complex, 
("output%d.32c" % i)))
+            self.connect((self.v2s, i), self.snks[i])
+                             
+        # Connect the rest
+        self.connect(self.add, self.head, self.pfb)
+        self.connect(self.pfb, self.v2s)
+        self.connect(self.add, self.snk_i)
+        self.connect(self.pfb, self.snk_o)
+
+def main():
+    tb = pfb_top_block()
+    tb.run()
+
+if __name__ == "__main__":
+    try:
+        main()
+    except KeyboardInterrupt:
+        pass
+    


Property changes on: 
gnuradio/branches/developers/trondeau/pfb/gnuradio-core/src/lib/filter/channelize.py
___________________________________________________________________
Added: svn:executable
   + *





reply via email to

[Prev in Thread] Current Thread [Next in Thread]