summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/examples/pfb/channelize.py
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-04-13 18:36:53 -0400
committerTom Rondeau <trondeau@vt.edu>2012-04-13 18:36:53 -0400
commitf919f9dcbb54a08e6e26d6c229ce92fb784fa1b2 (patch)
tree7e846386b9eb1676f9a93fc4a1e55916b9accc97 /gnuradio-core/src/examples/pfb/channelize.py
parent6a1e9783fec6ed827f49db27c171591d30f32933 (diff)
Removed whitespace and added dtools/bin/remove-whitespace as a tool to do this in the future.
The sed script was provided by Moritz Fischer.
Diffstat (limited to 'gnuradio-core/src/examples/pfb/channelize.py')
-rwxr-xr-xgnuradio-core/src/examples/pfb/channelize.py40
1 files changed, 20 insertions, 20 deletions
diff --git a/gnuradio-core/src/examples/pfb/channelize.py b/gnuradio-core/src/examples/pfb/channelize.py
index 2fcb14a360..442f263f47 100755
--- a/gnuradio-core/src/examples/pfb/channelize.py
+++ b/gnuradio-core/src/examples/pfb/channelize.py
@@ -1,24 +1,24 @@
#!/usr/bin/env python
#
# Copyright 2009 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, blks2
import sys, time
@@ -46,7 +46,7 @@ class pfb_top_block(gr.top_block):
self._M = 9 # Number of channels to channelize
# Create a set of taps for the PFB channelizer
- self._taps = gr.firdes.low_pass_2(1, self._fs, 475.50, 50,
+ self._taps = gr.firdes.low_pass_2(1, self._fs, 475.50, 50,
attenuation_dB=100, window=gr.firdes.WIN_BLACKMAN_hARRIS)
# Calculate the number of taps per channel for our own information
@@ -54,9 +54,9 @@ class pfb_top_block(gr.top_block):
print "Number of taps: ", len(self._taps)
print "Number of channels: ", self._M
print "Taps per channel: ", tpc
-
+
# Create a set of signals at different frequencies
- # freqs lists the frequencies of the signals that get stored
+ # freqs lists the frequencies of the signals that get stored
# in the list "signals", which then get summed together
self.signals = list()
self.add = gr.add_cc()
@@ -79,17 +79,17 @@ class pfb_top_block(gr.top_block):
# Use this to play with the channel mapping
#self.pfb.set_channel_map([5,6,7,8,0,1,2,3,4])
-
+
# Create a vector 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.vector_sink_c())
self.connect((self.pfb, i), self.snks[i])
-
+
def main():
tstart = time.time()
-
+
tb = pfb_top_block()
tb.run()
@@ -100,7 +100,7 @@ def main():
fig_in = pylab.figure(1, figsize=(16,9), facecolor="w")
fig1 = pylab.figure(2, figsize=(16,9), facecolor="w")
fig2 = pylab.figure(3, figsize=(16,9), facecolor="w")
-
+
Ns = 1000
Ne = 10000
@@ -118,8 +118,8 @@ def main():
X_in = 10.0*scipy.log10(abs(X))
f_in = scipy.arange(-fs/2.0, fs/2.0, fs/float(X_in.size))
pin_f = spin_f.plot(f_in, X_in, "b")
- spin_f.set_xlim([min(f_in), max(f_in)+1])
- spin_f.set_ylim([-200.0, 50.0])
+ spin_f.set_xlim([min(f_in), max(f_in)+1])
+ spin_f.set_ylim([-200.0, 50.0])
spin_f.set_title("Input Signal", weight="bold")
spin_f.set_xlabel("Frequency (Hz)")
@@ -128,7 +128,7 @@ def main():
Ts = 1.0/fs
Tmax = len(d)*Ts
-
+
t_in = scipy.arange(0, Tmax, Ts)
x_in = scipy.array(d)
spin_t = fig_in.add_subplot(2, 1, 2)
@@ -161,8 +161,8 @@ def main():
X_o = 10.0*scipy.log10(abs(X))
f_o = scipy.arange(-fs_o/2.0, fs_o/2.0, fs_o/float(X_o.size))
p2_f = sp1_f.plot(f_o, X_o, "b")
- sp1_f.set_xlim([min(f_o), max(f_o)+1])
- sp1_f.set_ylim([-200.0, 50.0])
+ sp1_f.set_xlim([min(f_o), max(f_o)+1])
+ sp1_f.set_ylim([-200.0, 50.0])
sp1_f.set_title(("Channel %d" % i), weight="bold")
sp1_f.set_xlabel("Frequency (Hz)")
@@ -173,8 +173,8 @@ def main():
sp2_o = fig2.add_subplot(Nrows, Ncols, 1+i)
p2_o = sp2_o.plot(t_o, x_o.real, "b")
p2_o = sp2_o.plot(t_o, x_o.imag, "r")
- sp2_o.set_xlim([min(t_o), max(t_o)+1])
- sp2_o.set_ylim([-2, 2])
+ sp2_o.set_xlim([min(t_o), max(t_o)+1])
+ sp2_o.set_ylim([-2, 2])
sp2_o.set_title(("Channel %d" % i), weight="bold")
sp2_o.set_xlabel("Time (s)")
@@ -188,4 +188,4 @@ if __name__ == "__main__":
main()
except KeyboardInterrupt:
pass
-
+