diff options
Diffstat (limited to 'gnuradio-core/src/python')
131 files changed, 1192 insertions, 1800 deletions
diff --git a/gnuradio-core/src/python/.gitignore b/gnuradio-core/src/python/.gitignore deleted file mode 100644 index f9c5da0db..000000000 --- a/gnuradio-core/src/python/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/Makefile -/Makefile.in -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo diff --git a/gnuradio-core/src/python/Makefile.am b/gnuradio-core/src/python/Makefile.am deleted file mode 100644 index a90aaba5c..000000000 --- a/gnuradio-core/src/python/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright 2004 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. -# - -include $(top_srcdir)/Makefile.common - -if PYTHON -SUBDIRS = gnuradio bin - -noinst_PYTHON = \ - build_utils.py \ - build_utils_codes.py -endif diff --git a/gnuradio-core/src/python/bin/.gitignore b/gnuradio-core/src/python/bin/.gitignore deleted file mode 100644 index f9c5da0db..000000000 --- a/gnuradio-core/src/python/bin/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/Makefile -/Makefile.in -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo diff --git a/gnuradio-core/src/python/bin/Makefile.am b/gnuradio-core/src/python/bin/Makefile.am deleted file mode 100644 index 6f9f162f1..000000000 --- a/gnuradio-core/src/python/bin/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright 2005,2009,2010 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. -# - -include $(top_srcdir)/Makefile.common - - -EXTRA_DIST += microtune.py - -noinst_SCRIPTS = \ - microtune.py diff --git a/gnuradio-core/src/python/bin/microtune.py b/gnuradio-core/src/python/bin/microtune.py index 0e799c93d..fbe743f39 100755 --- a/gnuradio-core/src/python/bin/microtune.py +++ b/gnuradio-core/src/python/bin/microtune.py @@ -36,7 +36,7 @@ def main (): actual = front_end.set_RF_freq (options.freq) print "microtune: actual freq = %s" % (eng_notation.num_to_str (actual),) - + if __name__ == '__main__': main () diff --git a/gnuradio-core/src/python/build_utils.py b/gnuradio-core/src/python/build_utils.py index 90c7978f2..0660941d5 100644 --- a/gnuradio-core/src/python/build_utils.py +++ b/gnuradio-core/src/python/build_utils.py @@ -1,23 +1,23 @@ # # Copyright 2004,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. -# +# """Misc utilities used at build time """ @@ -56,10 +56,10 @@ name_dict = {} def log_output_name (name): (base, ext) = os.path.splitext (name) ext = ext[1:] # drop the leading '.' - + entry = name_dict.setdefault (ext, []) entry.append (name) - + def open_and_log_name (name, dir): global do_sources if do_sources: @@ -139,29 +139,29 @@ def do_substitution (d, in_file, out_file): key = match_obj.group (1) # print key return d[key] - + inp = in_file.read () out = re.sub (r"@([a-zA-Z0-9_]+)@", repl, inp) out_file.write (out) - + copyright = '''/* -*- c++ -*- */ /* * Copyright 2003,2004 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, diff --git a/gnuradio-core/src/python/build_utils_codes.py b/gnuradio-core/src/python/build_utils_codes.py index 49ded78a6..9ea96baae 100644 --- a/gnuradio-core/src/python/build_utils_codes.py +++ b/gnuradio-core/src/python/build_utils_codes.py @@ -1,23 +1,23 @@ # # Copyright 2004 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. -# +# def i_code (code3): return code3[0] diff --git a/gnuradio-core/src/python/gnuradio/.gitignore b/gnuradio-core/src/python/gnuradio/.gitignore deleted file mode 100644 index f9c5da0db..000000000 --- a/gnuradio-core/src/python/gnuradio/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/Makefile -/Makefile.in -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo diff --git a/gnuradio-core/src/python/gnuradio/Makefile.am b/gnuradio-core/src/python/gnuradio/Makefile.am deleted file mode 100644 index ffc171b2d..000000000 --- a/gnuradio-core/src/python/gnuradio/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright 2004-2011 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. -# - -include $(top_srcdir)/Makefile.common - -if PYTHON -SUBDIRS = gr gru gruimpl blks2 blks2impl - -grpython_PYTHON = \ - __init__.py \ - eng_notation.py \ - eng_option.py \ - gr_unittest.py \ - gr_xmlrunner.py \ - optfir.py \ - window.py -endif diff --git a/gnuradio-core/src/python/gnuradio/blks2/.gitignore b/gnuradio-core/src/python/gnuradio/blks2/.gitignore deleted file mode 100644 index b6950912c..000000000 --- a/gnuradio-core/src/python/gnuradio/blks2/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/Makefile -/Makefile.in -/*.pyc diff --git a/gnuradio-core/src/python/gnuradio/blks2/Makefile.am b/gnuradio-core/src/python/gnuradio/blks2/Makefile.am deleted file mode 100644 index 04b7c6500..000000000 --- a/gnuradio-core/src/python/gnuradio/blks2/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright 2005,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. -# - -include $(top_srcdir)/Makefile.common - -# EXTRA_DIST = run_tests.in -# TESTS = run_tests - -grblks2pythondir = $(grpythondir)/blks2 - -grblks2python_PYTHON = \ - __init__.py diff --git a/gnuradio-core/src/python/gnuradio/blks2/__init__.py b/gnuradio-core/src/python/gnuradio/blks2/__init__.py index 89ebb9229..2dfdc77f4 100644 --- a/gnuradio-core/src/python/gnuradio/blks2/__init__.py +++ b/gnuradio-core/src/python/gnuradio/blks2/__init__.py @@ -1,29 +1,29 @@ # # Copyright 2005 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. -# +# import glob import os.path # Semi-hideous kludge to import everything in the blksimpl2 directory -# into the gnuradio.blks2 namespace. This keeps us from having to remember +# into the gnuradio.blks2 namespace. This keeps us from having to remember # to manually update this file. for p in __path__: diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/.gitignore b/gnuradio-core/src/python/gnuradio/blks2impl/.gitignore deleted file mode 100644 index f9c5da0db..000000000 --- a/gnuradio-core/src/python/gnuradio/blks2impl/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/Makefile -/Makefile.in -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am b/gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am deleted file mode 100644 index eb031cd20..000000000 --- a/gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -# -# Copyright 2005,2007,2009,2010 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. -# - -include $(top_srcdir)/Makefile.common - -# EXTRA_DIST = run_tests.in -# TESTS = run_tests - -grblkspythondir = $(grpythondir)/blks2impl - -grblkspython_PYTHON = \ - __init__.py \ - am_demod.py \ - channel_model.py \ - filterbank.py \ - fm_demod.py \ - fm_emph.py \ - logpwrfft.py \ - nbfm_rx.py \ - nbfm_tx.py \ - pfb_arb_resampler.py \ - pfb_channelizer.py \ - pfb_decimator.py \ - pfb_interpolator.py \ - rational_resampler.py \ - standard_squelch.py \ - stream_to_vector_decimator.py \ - wfm_rcv.py \ - wfm_rcv_fmdet.py \ - wfm_rcv_pll.py \ - wfm_tx.py diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/am_demod.py b/gnuradio-core/src/python/gnuradio/blks2impl/am_demod.py index b454f0942..68d024565 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/am_demod.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/am_demod.py @@ -1,23 +1,23 @@ # # Copyright 2006,2007 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, optfir @@ -25,8 +25,8 @@ class am_demod_cf(gr.hier_block2): """ Generalized AM demodulation block with audio filtering. - This block demodulates a band-limited, complex down-converted AM - channel into the the original baseband signal, applying low pass + This block demodulates a band-limited, complex down-converted AM + channel into the the original baseband signal, applying low pass filtering to the audio output. It produces a float stream in the range [-1.0, +1.0]. @@ -34,11 +34,11 @@ class am_demod_cf(gr.hier_block2): @type sample_rate: integer @param audio_decim: input to output decimation rate @type audio_decim: integer - @param audio_pass: audio low pass filter passband frequency + @param audio_pass: audio low pass filter passband frequency @type audio_pass: float @param audio_stop: audio low pass filter stop frequency @type audio_stop: float - """ + """ def __init__(self, channel_rate, audio_decim, audio_pass, audio_stop): gr.hier_block2.__init__(self, "am_demod_cf", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature @@ -60,7 +60,7 @@ class am_demod_cf(gr.hier_block2): class demod_10k0a3e_cf(am_demod_cf): """ AM demodulation block, 10 KHz channel. - + This block demodulates an AM channel conformant to 10K0A3E emission standards, such as broadcast band AM transmissions. @@ -70,7 +70,6 @@ class demod_10k0a3e_cf(am_demod_cf): @type audio_decim: integer """ def __init__(self, channel_rate, audio_decim): - am_demod_cf.__init__(self, channel_rate, audio_decim, + am_demod_cf.__init__(self, channel_rate, audio_decim, 5000, # Audio passband 5500) # Audio stopband -
\ No newline at end of file diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py b/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py index 57487dff2..e5cd471df 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/channel_model.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 diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/filterbank.py b/gnuradio-core/src/python/gnuradio/blks2impl/filterbank.py index f214da4a9..08f1d450b 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/filterbank.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/filterbank.py @@ -1,23 +1,23 @@ # # Copyright 2005,2007 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. -# +# import sys from gnuradio import gr, gru @@ -53,11 +53,11 @@ class synthesis_filterbank(gr.hier_block2): sample rate * nchannels. Output stream to frequency mapping: - + channel zero is at zero frequency. if mpoints is odd: - + Channels with increasing positive frequencies come from channels 1 through (N-1)/2. @@ -106,7 +106,7 @@ class synthesis_filterbank(gr.hier_block2): for i in range(mpoints): self.connect((self, i), (self.ss2v, i)) - + self.connect(self.ss2v, self.ifft, self.v2ss) # build mpoints fir filters... @@ -116,7 +116,7 @@ class synthesis_filterbank(gr.hier_block2): self.connect(f, (self.ss2s, i)) self.connect(self.ss2s, self) - + class analysis_filterbank(gr.hier_block2): """ Uniformly modulated polyphase DFT filter bank: analysis @@ -137,7 +137,7 @@ class analysis_filterbank(gr.hier_block2): 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) @@ -145,12 +145,12 @@ class analysis_filterbank(gr.hier_block2): r = len(taps) % mpoints if r != 0: taps = taps + (mpoints - r) * (0,) - + # split in mpoints separate set of taps sub_taps = _split_taps(taps, mpoints) - # print >> sys.stderr, "mpoints =", mpoints, "len(sub_taps) =", len(sub_taps) - + # print >> sys.stderr, "mpoints =", mpoints, "len(sub_taps) =", len(sub_taps) + self.s2ss = gr.stream_to_streams(item_size, mpoints) # filters here self.ss2v = gr.streams_to_vector(item_size, mpoints) @@ -158,12 +158,12 @@ class analysis_filterbank(gr.hier_block2): 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]) 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) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py b/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py index 55870513a..6bc0d7ed0 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py @@ -1,23 +1,23 @@ # # Copyright 2006,2007 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, optfir from gnuradio.blks2impl.fm_emph import fm_deemph @@ -25,10 +25,10 @@ from math import pi class fm_demod_cf(gr.hier_block2): """ - Generalized FM demodulation block with deemphasis and audio + Generalized FM demodulation block with deemphasis and audio filtering. - This block demodulates a band-limited, complex down-converted FM + This block demodulates a band-limited, complex down-converted FM channel into the the original baseband signal, optionally applying deemphasis. Low pass filtering is done on the resultant signal. It produces an output float strem in the range of [-1.0, +1.0]. @@ -39,7 +39,7 @@ class fm_demod_cf(gr.hier_block2): @type deviation: float @param audio_decim: input to output decimation rate @type audio_decim: integer - @param audio_pass: audio low pass filter passband frequency + @param audio_pass: audio low pass filter passband frequency @type audio_pass: float @param audio_stop: audio low pass filter stop frequency @type audio_stop: float @@ -47,13 +47,13 @@ class fm_demod_cf(gr.hier_block2): @type gain: float @param tau: deemphasis time constant (default = 75e-6), specify 'None' to prevent deemphasis - """ - def __init__(self, channel_rate, audio_decim, deviation, + """ + def __init__(self, channel_rate, audio_decim, deviation, audio_pass, audio_stop, gain=1.0, tau=75e-6): gr.hier_block2.__init__(self, "fm_demod_cf", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature gr.io_signature(1, 1, gr.sizeof_float)) # Output signature - + k = channel_rate/(2*pi*deviation) QUAD = gr.quadrature_demod_cf(k) @@ -75,15 +75,15 @@ class demod_20k0f3e_cf(fm_demod_cf): """ NBFM demodulation block, 20 KHz channels - This block demodulates a complex, downconverted, narrowband FM + This block demodulates a complex, downconverted, narrowband FM channel conforming to 20K0F3E emission standards, outputting floats in the range [-1.0, +1.0]. - + @param sample_rate: incoming sample rate of the FM baseband @type sample_rate: integer @param audio_decim: input to output decimation rate @type audio_decim: integer - """ + """ def __init__(self, channel_rate, audio_decim): fm_demod_cf.__init__(self, channel_rate, audio_decim, 5000, # Deviation @@ -93,9 +93,9 @@ class demod_20k0f3e_cf(fm_demod_cf): class demod_200kf3e_cf(fm_demod_cf): """ WFM demodulation block, mono. - - This block demodulates a complex, downconverted, wideband FM - channel conforming to 200KF3E emission standards, outputting + + This block demodulates a complex, downconverted, wideband FM + channel conforming to 200KF3E emission standards, outputting floats in the range [-1.0, +1.0]. @param sample_rate: incoming sample rate of the FM baseband @@ -103,7 +103,7 @@ class demod_200kf3e_cf(fm_demod_cf): @param audio_decim: input to output decimation rate @type audio_decim: integer """ - def __init__(self, channel_rate, audio_decim): + def __init__(self, channel_rate, audio_decim): fm_demod_cf.__init__(self, channel_rate, audio_decim, 75000, # Deviation 15000, # Audio passband diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/fm_emph.py b/gnuradio-core/src/python/gnuradio/blks2impl/fm_emph.py index fd19f5fd9..fc3f2d60d 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/fm_emph.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/fm_emph.py @@ -1,23 +1,23 @@ # # Copyright 2005,2007 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 import math @@ -39,8 +39,8 @@ class fm_deemph(gr.hier_block2): """ FM Deemphasis IIR filter. """ - - + + def __init__(self, fs, tau=75e-6): """ @param fs: sampling frequency in Hz @@ -51,7 +51,7 @@ class fm_deemph(gr.hier_block2): gr.hier_block2.__init__(self, "fm_deemph", gr.io_signature(1, 1, gr.sizeof_float), # Input signature gr.io_signature(1, 1, gr.sizeof_float)) # Output signature - + w_p = 1/tau w_pp = math.tan (w_p / (fs * 2)) # prewarped analog freq @@ -135,9 +135,9 @@ class fm_preemph(gr.hier_block2): gr.hier_block2.__init__(self, "fm_deemph", gr.io_signature(1, 1, gr.sizeof_float), # Input signature gr.io_signature(1, 1, gr.sizeof_float)) # Output signature - + # FIXME make this compute the right answer - + btaps = [1] ataps = [1] diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_rx.py b/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_rx.py index dcdd460b5..8bcb47ae1 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_rx.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_rx.py @@ -1,23 +1,23 @@ # # Copyright 2005 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. -# +# import math from gnuradio import gr, optfir diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_tx.py b/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_tx.py index 15818c204..839cf6784 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_tx.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_tx.py @@ -1,23 +1,23 @@ # # Copyright 2005 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. -# +# import math from gnuradio import gr, optfir @@ -48,7 +48,7 @@ class nbfm_tx(gr.hier_block2): gr.hier_block2.__init__(self, "nbfm_tx", gr.io_signature(1, 1, gr.sizeof_float), # Input signature gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature - + # FIXME audio_rate and quad_rate ought to be exact rationals audio_rate = int(audio_rate) quad_rate = int(quad_rate) @@ -56,9 +56,9 @@ class nbfm_tx(gr.hier_block2): if quad_rate % audio_rate != 0: raise ValueError, "quad_rate is not an integer multiple of audio_rate" - + do_interp = audio_rate != quad_rate - + if do_interp: interp_factor = quad_rate / audio_rate interp_taps = optfir.low_pass (interp_factor, # gain @@ -72,7 +72,7 @@ class nbfm_tx(gr.hier_block2): self.interpolator = gr.interp_fir_filter_fff (interp_factor, interp_taps) self.preemph = fm_preemph (quad_rate, tau=tau) - + k = 2 * math.pi * max_dev / quad_rate self.modulator = gr.frequency_modulator_fc (k) @@ -80,8 +80,8 @@ class nbfm_tx(gr.hier_block2): self.connect (self, self.interpolator, self.preemph, self.modulator, self) else: self.connect(self, self.preemph, self.modulator, self) - - + + class ctcss_gen_f(gr.hier_block2): def __init__(self, sample_rate, tone_freq): gr.hier_block2.__init__(self, "ctcss_gen_f", @@ -89,4 +89,4 @@ class ctcss_gen_f(gr.hier_block2): gr.io_signature(1, 1, gr.sizeof_float)) # Output signature self.plgen = gr.sig_source_f(sample_rate, gr.GR_SIN_WAVE, tone_freq, 0.1, 0.0) - self.connect(self.plgen, self) + self.connect(self.plgen, self) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py index 3aadf700b..e83c327fc 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.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, optfir @@ -35,7 +35,7 @@ class pfb_arb_resampler_ccf(gr.hier_block2): gr.hier_block2.__init__(self, "pfb_arb_resampler_ccf", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature - + self._rate = rate self._size = flt_size @@ -63,7 +63,7 @@ class pfb_arb_resampler_ccf(gr.hier_block2): self.pfb = gr.pfb_arb_resampler_ccf(self._rate, self._taps, self._size) #print "PFB has %d taps\n" % (len(self._taps),) - + self.connect(self, self.pfb) self.connect(self.pfb, self) @@ -88,7 +88,7 @@ class pfb_arb_resampler_fff(gr.hier_block2): gr.hier_block2.__init__(self, "pfb_arb_resampler_fff", gr.io_signature(1, 1, gr.sizeof_float), # Input signature gr.io_signature(1, 1, gr.sizeof_float)) # Output signature - + self._rate = rate self._size = flt_size @@ -116,7 +116,7 @@ class pfb_arb_resampler_fff(gr.hier_block2): self.pfb = gr.pfb_arb_resampler_fff(self._rate, self._taps, self._size) #print "PFB has %d taps\n" % (len(self._taps),) - + self.connect(self, self.pfb) self.connect(self.pfb, self) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py index 3ddc1749a..4bbe1bec6 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2009,2010 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, optfir @@ -34,7 +34,7 @@ class pfb_channelizer_ccf(gr.hier_block2): gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature gr.io_signature(numchans, numchans, gr.sizeof_gr_complex)) # Output signature - self._numchans = numchans + self._nchans = numchans self._oversample_rate = oversample_rate if taps is not None: @@ -47,7 +47,7 @@ class pfb_channelizer_ccf(gr.hier_block2): made = False while not made: try: - self._taps = optfir.low_pass(1, self._numchans, bw, bw+tb, ripple, atten) + self._taps = optfir.low_pass(1, self._nchans, bw, bw+tb, ripple, atten) made = True except RuntimeError: ripple += 0.01 @@ -58,22 +58,16 @@ class pfb_channelizer_ccf(gr.hier_block2): if(ripple >= 1.0): raise RuntimeError("optfir could not generate an appropriate filter.") - self.s2ss = gr.stream_to_streams(gr.sizeof_gr_complex, self._numchans) - self.pfb = gr.pfb_channelizer_ccf(self._numchans, self._taps, + self.s2ss = gr.stream_to_streams(gr.sizeof_gr_complex, self._nchans) + self.pfb = gr.pfb_channelizer_ccf(self._nchans, self._taps, self._oversample_rate) - self.v2s = gr.vector_to_streams(gr.sizeof_gr_complex, self._numchans) - self.connect(self, self.s2ss) - for i in xrange(self._numchans): + for i in xrange(self._nchans): self.connect((self.s2ss,i), (self.pfb,i)) + self.connect((self.pfb,i), (self,i)) - # Get independent streams from the filterbank and send them out - self.connect(self.pfb, self.v2s) + def set_channel_map(self, newmap): + self.pfb.set_channel_map(newmap) - for i in xrange(self._numchans): - self.connect((self.v2s,i), (self,i)) - - - diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py index 2e36e7bc1..adcdfe9ba 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.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, optfir diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py index a6094f7f4..5492dfcac 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.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, optfir @@ -64,7 +64,7 @@ class pfb_interpolator_ccf(gr.hier_block2): self.connect(self, self.pfb) self.connect(self.pfb, self) - - - - + + + + diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/rational_resampler.py b/gnuradio-core/src/python/gnuradio/blks2impl/rational_resampler.py index b7de0de7c..eea12af95 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/rational_resampler.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/rational_resampler.py @@ -1,23 +1,23 @@ # # Copyright 2005,2007 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, gru @@ -91,7 +91,7 @@ class _rational_resampler_base(gr.hier_block2): d = gru.gcd(interpolation, decimation) interpolation = interpolation // d decimation = decimation // d - + if taps is None: taps = design_filter(interpolation, decimation, fractional_bw) @@ -118,7 +118,7 @@ class rational_resampler_ccf(_rational_resampler_base): Rational resampling polyphase FIR filter with complex input, complex output and float taps. """ - _rational_resampler_base.__init__(self, gr.rational_resampler_base_ccf, + _rational_resampler_base.__init__(self, gr.rational_resampler_base_ccf, interpolation, decimation, taps, fractional_bw) class rational_resampler_ccc(_rational_resampler_base): @@ -127,5 +127,5 @@ class rational_resampler_ccc(_rational_resampler_base): Rational resampling polyphase FIR filter with complex input, complex output and complex taps. """ - _rational_resampler_base.__init__(self, gr.rational_resampler_base_ccc, + _rational_resampler_base.__init__(self, gr.rational_resampler_base_ccc, interpolation, decimation, taps, fractional_bw) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/standard_squelch.py b/gnuradio-core/src/python/gnuradio/blks2impl/standard_squelch.py index c5fdc01db..bd7fb535a 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/standard_squelch.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/standard_squelch.py @@ -1,23 +1,23 @@ # # Copyright 2005,2007 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. -# +# import math from gnuradio import gr, optfir @@ -27,9 +27,9 @@ class standard_squelch(gr.hier_block2): gr.hier_block2.__init__(self, "standard_squelch", gr.io_signature(1, 1, gr.sizeof_float), # Input signature gr.io_signature(1, 1, gr.sizeof_float)) # Output signature - + self.input_node = gr.add_const_ff(0) # FIXME kludge - + self.low_iir = gr.iir_filter_ffd((0.0193,0,-0.0193),(1,1.9524,-0.9615)) self.low_square = gr.multiply_ff() self.low_smooth = gr.single_pole_iir_filter_ff(1/(0.01*audio_rate)) # 100ms time constant @@ -71,6 +71,6 @@ class standard_squelch(gr.hier_block2): def threshold(self): return self.gate.hi() - + def squelch_range(self): return (0.0, 1.0, 1.0/100) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv.py b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv.py index 3bdb22cce..d1cbcf912 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv.py @@ -1,23 +1,23 @@ # # Copyright 2005,2007 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 from gnuradio.blks2impl.fm_emph import fm_deemph @@ -27,10 +27,10 @@ class wfm_rcv(gr.hier_block2): def __init__ (self, quad_rate, audio_decimation): """ Hierarchical block for demodulating a broadcast FM signal. - + The input is the downconverted complex baseband signal (gr_complex). The output is the demodulated audio (float). - + @param quad_rate: input sample rate of complex baseband input. @type quad_rate: float @param audio_decimation: how much to decimate quad_rate to get to audio. @@ -45,9 +45,9 @@ class wfm_rcv(gr.hier_block2): max_dev = 75e3 fm_demod_gain = quad_rate/(2*math.pi*max_dev) audio_rate = quad_rate / audio_decimation - - # We assign to self so that outsiders can grab the demodulator + + # We assign to self so that outsiders can grab the demodulator # if they need to. E.g., to plot its output. # # input: complex; output: float @@ -55,7 +55,7 @@ class wfm_rcv(gr.hier_block2): # input: float; output: float self.deemph = fm_deemph (audio_rate) - + # compute FIR filter taps for audio filter width_of_transition_band = audio_rate / 32 audio_coeffs = gr.firdes.low_pass (1.0, # gain diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py index 14eaa1606..e229bcc2e 100755 --- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py @@ -1,23 +1,23 @@ # # Copyright 2005,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 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 from gnuradio.blks2impl.fm_emph import fm_deemph @@ -27,11 +27,11 @@ class wfm_rcv_fmdet(gr.hier_block2): def __init__ (self, demod_rate, audio_decimation): """ Hierarchical block for demodulating a broadcast FM signal. - + The input is the downconverted complex baseband signal (gr_complex). The output is two streams of the demodulated audio (float) 0=Left, 1=Right. - + @param demod_rate: input sample rate of complex baseband input. @type demod_rate: float @param audio_decimation: how much to decimate demod_rate to get to audio. @@ -48,13 +48,13 @@ class wfm_rcv_fmdet(gr.hier_block2): # if they need to. E.g., to plot its output. # # input: complex; output: float - + self.fm_demod = gr.fmdet_cf (demod_rate, lowfreq, highfreq, 0.05) # input: float; output: float self.deemph_Left = fm_deemph (audio_rate) self.deemph_Right = fm_deemph (audio_rate) - + # compute FIR filter taps for audio filter width_of_transition_band = audio_rate / 32 audio_coeffs = gr.firdes.low_pass (1.0 , # gain @@ -79,7 +79,7 @@ class wfm_rcv_fmdet(gr.hier_block2): -18980, width_of_transition_band, gr.firdes.WIN_HAMMING) - + #print "len stereo carrier filter = ",len(stereo_carrier_filter_coeffs) #print "stereo carrier filter ", stereo_carrier_filter_coeffs #print "width of transition band = ",width_of_transition_band, " audio rate = ", audio_rate @@ -125,7 +125,7 @@ class wfm_rcv_fmdet(gr.hier_block2): loop_bw = 2*math.pi/100.0 max_freq = -2.0*math.pi*18990/audio_rate; - min_freq = -2.0*math.pi*19010/audio_rate; + min_freq = -2.0*math.pi*19010/audio_rate; self.stereo_carrier_pll_recovery = gr.pll_refout_cc(loop_bw, max_freq, min_freq); @@ -133,7 +133,7 @@ class wfm_rcv_fmdet(gr.hier_block2): #self.stereo_carrier_pll_recovery.squelch_enable(False) ##pll_refout does not have squelch yet, so disabled for #now - + # set up mixer (multiplier) to get the L-R signal at # baseband @@ -145,7 +145,7 @@ class wfm_rcv_fmdet(gr.hier_block2): self.LmR_real = gr.complex_to_real(); self.Make_Left = gr.add_ff(); self.Make_Right = gr.sub_ff(); - + self.stereo_dsbsc_filter = gr.fir_filter_fcc(audio_decimation, stereo_dsbsc_filter_coeffs) @@ -155,7 +155,7 @@ class wfm_rcv_fmdet(gr.hier_block2): # send the real signal to complex filter to pick off the # carrier and then to one side of a multiplier self.connect (self, self.fm_demod, self.stereo_carrier_filter, - self.stereo_carrier_pll_recovery, + self.stereo_carrier_pll_recovery, (self.stereo_carrier_generator,0)) # send the already filtered carrier to the otherside of the carrier @@ -182,7 +182,7 @@ class wfm_rcv_fmdet(gr.hier_block2): # Make rds carrier by taking the squared pilot tone and # multiplying by pilot tone self.connect (self.stereo_basebander,(self.rds_carrier_generator,0)) - self.connect (self.stereo_carrier_pll_recovery,(self.rds_carrier_generator,1)) + self.connect (self.stereo_carrier_pll_recovery,(self.rds_carrier_generator,1)) # take signal, filter off rds, send into mixer 0 channel self.connect (self.fm_demod,self.rds_signal_filter,(self.rds_signal_generator,0)) @@ -194,7 +194,7 @@ class wfm_rcv_fmdet(gr.hier_block2): # send basebanded rds signal and send into "processor" # which for now is a null sink self.connect (self.rds_signal_generator,self_rds_signal_processor) - + if 1: # pick off the audio, L+R that is what we used to have and diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_pll.py b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_pll.py index a2c1b3651..d4ce6d223 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_pll.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_pll.py @@ -1,23 +1,23 @@ # # Copyright 2005,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 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 from gnuradio.blks2impl.fm_emph import fm_deemph @@ -27,10 +27,10 @@ class wfm_rcv_pll(gr.hier_block2): def __init__ (self, demod_rate, audio_decimation): """ Hierarchical block for demodulating a broadcast FM signal. - + The input is the downconverted complex baseband signal (gr_complex). The output is two streams of the demodulated audio (float) 0=Left, 1=Right. - + @param demod_rate: input sample rate of complex baseband input. @type demod_rate: float @param audio_decimation: how much to decimate demod_rate to get to audio. @@ -43,7 +43,7 @@ class wfm_rcv_pll(gr.hier_block2): audio_rate = demod_rate / audio_decimation - # We assign to self so that outsiders can grab the demodulator + # We assign to self so that outsiders can grab the demodulator # if they need to. E.g., to plot its output. # # input: complex; output: float @@ -54,7 +54,7 @@ class wfm_rcv_pll(gr.hier_block2): # input: float; output: float self.deemph_Left = fm_deemph (audio_rate) self.deemph_Right = fm_deemph (audio_rate) - + # compute FIR filter taps for audio filter width_of_transition_band = audio_rate / 32 audio_coeffs = gr.firdes.low_pass (1.0 , # gain @@ -75,7 +75,7 @@ class wfm_rcv_pll(gr.hier_block2): -18980, width_of_transition_band, gr.firdes.WIN_HAMMING) - + #print "len stereo carrier filter = ",len(stereo_carrier_filter_coeffs) #print "stereo carrier filter ", stereo_carrier_filter_coeffs #print "width of transition band = ",width_of_transition_band, " audio rate = ", audio_rate @@ -126,10 +126,10 @@ class wfm_rcv_pll(gr.hier_block2): loop_bw = 2*math.pi/100.0 max_freq = -2.0*math.pi*18990/audio_rate; min_freq = -2.0*math.pi*19010/audio_rate; - + self.stereo_carrier_pll_recovery = gr.pll_refout_cc(loop_bw, max_freq, min_freq); - #self.stereo_carrier_pll_recovery.squelch_enable(False) #pll_refout does not have squelch yet, so disabled for now - + #self.stereo_carrier_pll_recovery.squelch_enable(False) #pll_refout does not have squelch yet, so disabled for now + # set up mixer (multiplier) to get the L-R signal at baseband @@ -140,7 +140,7 @@ class wfm_rcv_pll(gr.hier_block2): self.LmR_real = gr.complex_to_real(); self.Make_Left = gr.add_ff(); self.Make_Right = gr.sub_ff(); - + self.stereo_dsbsc_filter = gr.fir_filter_fcc(audio_decimation, stereo_dsbsc_filter_coeffs) @@ -166,14 +166,14 @@ class wfm_rcv_pll(gr.hier_block2): # Make rds carrier by taking the squared pilot tone and multiplying by pilot tone self.connect (self.stereo_basebander,(self.rds_carrier_generator,0)) - self.connect (self.stereo_carrier_pll_recovery,(self.rds_carrier_generator,1)) + self.connect (self.stereo_carrier_pll_recovery,(self.rds_carrier_generator,1)) # take signal, filter off rds, send into mixer 0 channel self.connect (self.fm_demod,self.rds_signal_filter,(self.rds_signal_generator,0)) # take rds_carrier_generator output and send into mixer 1 channel self.connect (self.rds_carrier_generator,(self.rds_signal_generator,1)) # send basebanded rds signal and send into "processor" which for now is a null sink self.connect (self.rds_signal_generator,self_rds_signal_processor) - + if 1: # pick off the audio, L+R that is what we used to have and send it to the summer diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_tx.py b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_tx.py index c7c831ca1..3fcf98f89 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_tx.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_tx.py @@ -1,23 +1,23 @@ # # Copyright 2005,2007 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. -# +# import math from gnuradio import gr, optfir @@ -45,7 +45,7 @@ class wfm_tx(gr.hier_block2): gr.hier_block2.__init__(self, "wfm_tx", gr.io_signature(1, 1, gr.sizeof_float), # Input signature gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature - + # FIXME audio_rate and quad_rate ought to be exact rationals audio_rate = int(audio_rate) quad_rate = int(quad_rate) @@ -53,9 +53,9 @@ class wfm_tx(gr.hier_block2): if quad_rate % audio_rate != 0: raise ValueError, "quad_rate is not an integer multiple of audio_rate" - + do_interp = audio_rate != quad_rate - + if do_interp: interp_factor = quad_rate / audio_rate interp_taps = optfir.low_pass (interp_factor, # gain @@ -69,7 +69,7 @@ class wfm_tx(gr.hier_block2): self.interpolator = gr.interp_fir_filter_fff (interp_factor, interp_taps) self.preemph = fm_preemph (quad_rate, tau=tau) - + k = 2 * math.pi * max_dev / quad_rate self.modulator = gr.frequency_modulator_fc (k) diff --git a/gnuradio-core/src/python/gnuradio/eng_notation.py b/gnuradio-core/src/python/gnuradio/eng_notation.py index 63ff19944..c552a45f5 100644 --- a/gnuradio-core/src/python/gnuradio/eng_notation.py +++ b/gnuradio-core/src/python/gnuradio/eng_notation.py @@ -1,23 +1,23 @@ # # Copyright 2003 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. -# +# scale_factor = {} scale_factor['E'] = 1e18 diff --git a/gnuradio-core/src/python/gnuradio/eng_option.py b/gnuradio-core/src/python/gnuradio/eng_option.py index e10235f14..02e9b0b6d 100644 --- a/gnuradio-core/src/python/gnuradio/eng_option.py +++ b/gnuradio-core/src/python/gnuradio/eng_option.py @@ -1,23 +1,23 @@ # # Copyright 2004 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. -# +# '''Add support for engineering notation to optparse.OptionParser''' diff --git a/gnuradio-core/src/python/gnuradio/gr/.gitignore b/gnuradio-core/src/python/gnuradio/gr/.gitignore deleted file mode 100644 index bf03975bb..000000000 --- a/gnuradio-core/src/python/gnuradio/gr/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/Makefile -/Makefile.in -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo -/run_tests diff --git a/gnuradio-core/src/python/gnuradio/gr/Makefile.am b/gnuradio-core/src/python/gnuradio/gr/Makefile.am deleted file mode 100644 index b1550fc57..000000000 --- a/gnuradio-core/src/python/gnuradio/gr/Makefile.am +++ /dev/null @@ -1,103 +0,0 @@ -# -# Copyright 2004,2005,2006,2008,2010 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. -# - -include $(top_srcdir)/Makefile.common - -EXTRA_DIST += \ - run_tests.in \ - test_16bit_1chunk.wav - -TESTS = run_tests - - -grgrpythondir = $(grpythondir)/gr - -grgrpython_PYTHON = \ - __init__.py \ - exceptions.py \ - gr_threading.py \ - gr_threading_23.py \ - gr_threading_24.py \ - hier_block2.py \ - prefs.py \ - top_block.py \ - pubsub.py - -noinst_PYTHON = \ - benchmark_filters.py \ - qa_add_and_friends.py \ - qa_add_v_and_friends.py \ - qa_agc.py \ - qa_argmax.py \ - qa_bin_statistics.py \ - qa_classify.py \ - qa_complex_to_xxx.py \ - qa_conjugate.py \ - qa_copy.py \ - qa_delay.py \ - qa_dc_blocker.py \ - qa_diff_encoder.py \ - qa_diff_phasor_cc.py \ - qa_ecc_ccsds_27.py \ - qa_feval.py \ - qa_fft.py \ - qa_fft_filter.py \ - qa_filter_delay_fc.py \ - qa_float_to_char.py \ - qa_float_to_int.py \ - qa_float_to_short.py \ - qa_fractional_interpolator.py \ - qa_frequency_modulator.py \ - qa_fsk_stuff.py \ - qa_glfsr_source.py \ - qa_goertzel.py \ - qa_head.py \ - qa_hier_block2.py \ - qa_hilbert.py \ - qa_iir.py \ - qa_int_to_float.py \ - qa_interleave.py \ - qa_interp_fir_filter.py \ - qa_kludge_copy.py \ - qa_kludged_imports.py \ - qa_max.py \ - qa_message.py \ - qa_multiply_conjugate.py \ - qa_mute.py \ - qa_nlog10.py \ - qa_noise.py \ - qa_packed_to_unpacked.py \ - qa_pipe_fittings.py \ - qa_pll_carriertracking.py \ - qa_pll_freqdet.py \ - qa_pll_refout.py \ - qa_pn_correlator_cc.py \ - qa_probe_signal.py \ - qa_rational_resampler.py \ - qa_sig_source.py \ - qa_single_pole_iir.py \ - qa_single_pole_iir_cc.py \ - qa_skiphead.py \ - qa_unpack_k_bits.py \ - qa_repeat.py \ - qa_scrambler.py \ - qa_udp_sink_source.py \ - qa_vector_sink_source.py diff --git a/gnuradio-core/src/python/gnuradio/gr/__init__.py b/gnuradio-core/src/python/gnuradio/gr/__init__.py index 73ca8e08f..602d1119f 100644 --- a/gnuradio-core/src/python/gnuradio/gr/__init__.py +++ b/gnuradio-core/src/python/gnuradio/gr/__init__.py @@ -1,23 +1,23 @@ # # Copyright 2003,2004,2006,2008,2009,2010 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. -# +# # The presence of this file turns this directory into a Python package @@ -35,7 +35,7 @@ except ImportError: from DLFCN import RTLD_GLOBAL as _RTLD_GLOBAL except ImportError: pass - + if _RTLD_GLOBAL != 0: _dlopenflags = sys.getdlopenflags() sys.setdlopenflags(_dlopenflags|_RTLD_GLOBAL) diff --git a/gnuradio-core/src/python/gnuradio/gr/benchmark_filters.py b/gnuradio-core/src/python/gnuradio/gr/benchmark_filters.py index 4d99a397f..4fc10b721 100755 --- a/gnuradio-core/src/python/gnuradio/gr/benchmark_filters.py +++ b/gnuradio-core/src/python/gnuradio/gr/benchmark_filters.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2005,2006,2007 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. -# +# import time import random @@ -32,7 +32,7 @@ def make_random_complex_tuple(L): result.append(complex(random.uniform(-1000,1000), random.uniform(-1000,1000))) return tuple(result) - + def benchmark(name, creator, dec, ntaps, total_test_size, block_size): block_size = 32768 diff --git a/gnuradio-core/src/python/gnuradio/gr/exceptions.py b/gnuradio-core/src/python/gnuradio/gr/exceptions.py index 40b97e3ef..dba04750b 100644 --- a/gnuradio-core/src/python/gnuradio/gr/exceptions.py +++ b/gnuradio-core/src/python/gnuradio/gr/exceptions.py @@ -1,18 +1,18 @@ # # Copyright 2004 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, diff --git a/gnuradio-core/src/python/gnuradio/gr/gr_threading.py b/gnuradio-core/src/python/gnuradio/gr/gr_threading.py index 56d4228f7..5d6f0fdaf 100644 --- a/gnuradio-core/src/python/gnuradio/gr/gr_threading.py +++ b/gnuradio-core/src/python/gnuradio/gr/gr_threading.py @@ -1,23 +1,23 @@ # # Copyright 2005 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 sys import version_info as _version_info diff --git a/gnuradio-core/src/python/gnuradio/gr/hier_block2.py b/gnuradio-core/src/python/gnuradio/gr/hier_block2.py index debb65d91..0c45f1691 100644 --- a/gnuradio-core/src/python/gnuradio/gr/hier_block2.py +++ b/gnuradio-core/src/python/gnuradio/gr/hier_block2.py @@ -1,23 +1,23 @@ # # Copyright 2006,2007 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_core import hier_block2_swig @@ -95,7 +95,7 @@ class hier_block2(object): If more than two arguments are provided, they are disconnected successively. """ - + if len (points) < 1: raise ValueError, ("disconnect requires at least one endpoint; %d provided." % (len (points),)) else: diff --git a/gnuradio-core/src/python/gnuradio/gr/prefs.py b/gnuradio-core/src/python/gnuradio/gr/prefs.py index 40347a2f4..644aea848 100644 --- a/gnuradio-core/src/python/gnuradio/gr/prefs.py +++ b/gnuradio-core/src/python/gnuradio/gr/prefs.py @@ -1,23 +1,23 @@ # # Copyright 2006,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. -# +# import gnuradio_core as gsp _prefs_base = gsp.gr_prefs @@ -31,7 +31,7 @@ import sys def _user_prefs_filename(): return os.path.expanduser('~/.gnuradio/config.conf') - + def _sys_prefs_dirname(): return gsp.prefsdir() @@ -44,7 +44,7 @@ def _bool(x): if isinstance(x, (float, int)): return bool(x) raise TypeError, x - + class _prefs(_prefs_base): """ @@ -98,7 +98,7 @@ class _prefs(_prefs_base): return self.cp.getint(section, option) except: return default_val - + def get_double(self, section, option, default_val): try: return self.cp.getfloat(section, option) @@ -115,7 +115,7 @@ _prefs_db = _prefs() # (make check uses this to avoid interactions.) if os.getenv("GR_DONT_LOAD_PREFS", None) is None: _prefs_db._read_files() - + _prefs_base.set_singleton(_prefs_db) # tell C++ what instance to use diff --git a/gnuradio-core/src/python/gnuradio/gr/pubsub.py b/gnuradio-core/src/python/gnuradio/gr/pubsub.py index 8fb7a8519..90568418f 100644 --- a/gnuradio-core/src/python/gnuradio/gr/pubsub.py +++ b/gnuradio-core/src/python/gnuradio/gr/pubsub.py @@ -31,15 +31,15 @@ class pubsub(dict): self._publishers = { } self._subscribers = { } self._proxies = { } - + def __missing__(self, key, value=None): dict.__setitem__(self, key, value) self._publishers[key] = None self._subscribers[key] = [] self._proxies[key] = None - + def __setitem__(self, key, val): - if not self.has_key(key): + if not self.has_key(key): self.__missing__(key, val) elif self._proxies[key] is not None: (p, newkey) = self._proxies[key] @@ -68,7 +68,7 @@ class pubsub(dict): p.publish(newkey, publisher) else: self._publishers[key] = publisher - + def subscribe(self, key, subscriber): if not self.has_key(key): self.__missing__(key) if self._proxies[key] is not None: @@ -76,14 +76,14 @@ class pubsub(dict): p.subscribe(newkey, subscriber) else: self._subscribers[key].append(subscriber) - + def unpublish(self, key): if self._proxies[key] is not None: (p, newkey) = self._proxies[key] p.unpublish(newkey) else: self._publishers[key] = None - + def unsubscribe(self, key, subscriber): if self._proxies[key] is not None: (p, newkey) = self._proxies[key] @@ -94,7 +94,7 @@ class pubsub(dict): def proxy(self, key, p, newkey=None): if not self.has_key(key): self.__missing__(key) if newkey is None: newkey = key - self._proxies[key] = (p, newkey) + self._proxies[key] = (p, newkey) def unproxy(self, key): self._proxies[key] = None @@ -125,7 +125,7 @@ if __name__ == "__main__": # The third is a lambda function o.subscribe('foo', lambda x: sys.stdout.write('val='+`x`+'\n')) - # Update key 'foo', will notify subscribers + # Update key 'foo', will notify subscribers print "Updating 'foo' with three subscribers:" o['foo'] = 'bar'; @@ -135,7 +135,7 @@ if __name__ == "__main__": # Update now will only trigger second and third subscriber print "Updating 'foo' after removing a subscriber:" o['foo'] = 'bar2'; - + # Publish a key as a function, in this case, a lambda function o.publish('baz', lambda : 42) print "Published value of 'baz':", o['baz'] @@ -145,7 +145,7 @@ if __name__ == "__main__": # This will return None, as there is no publisher print "Value of 'baz' with no publisher:", o['baz'] - + # Set 'baz' key, it gets cached o['baz'] = 'bazzz' diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_add_and_friends.py b/gnuradio-core/src/python/gnuradio/gr/qa_add_and_friends.py index e3b20c3c3..7ccbbe8ad 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_add_and_friends.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_add_and_friends.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_add_v_and_friends.py b/gnuradio-core/src/python/gnuradio/gr/qa_add_v_and_friends.py index 90056e09f..c8df47b39 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_add_v_and_friends.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_add_v_and_friends.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest @@ -91,7 +91,7 @@ class test_add_v_and_friends(gr_unittest.TestCase): self.tb.run() result_data = dst.data() self.assertEqual(exp_data, result_data) - + def help_const_ii(self, src_data, exp_data, op): src = gr.vector_source_i(src_data) srcv = gr.stream_to_vector(gr.sizeof_int, len(src_data)) @@ -101,7 +101,7 @@ class test_add_v_and_friends(gr_unittest.TestCase): self.tb.run() result_data = dst.data() self.assertEqual(exp_data, result_data) - + def help_const_ff(self, src_data, exp_data, op): src = gr.vector_source_f(src_data) srcv = gr.stream_to_vector(gr.sizeof_float, len(src_data)) @@ -111,7 +111,7 @@ class test_add_v_and_friends(gr_unittest.TestCase): self.tb.run() result_data = dst.data() self.assertEqual(exp_data, result_data) - + def help_const_cc(self, src_data, exp_data, op): src = gr.vector_source_c(src_data) srcv = gr.stream_to_vector(gr.sizeof_gr_complex, len(src_data)) @@ -121,7 +121,7 @@ class test_add_v_and_friends(gr_unittest.TestCase): self.tb.run() result_data = dst.data() self.assertEqual(exp_data, result_data) - + def test_add_vss_one(self): src1_data = (1,) @@ -130,7 +130,7 @@ class test_add_v_and_friends(gr_unittest.TestCase): expected_result = (6,) op = gr.add_vss(1) self.help_ss(1, (src1_data, src2_data, src3_data), expected_result, op) - + def test_add_vss_five(self): src1_data = (1, 2, 3, 4, 5) src2_data = (6, 7, 8, 9, 10) @@ -146,7 +146,7 @@ class test_add_v_and_friends(gr_unittest.TestCase): expected_result = (6,) op = gr.add_vii(1) self.help_ii(1, (src1_data, src2_data, src3_data), expected_result, op) - + def test_add_vii_five(self): src1_data = (1, 2, 3, 4, 5) src2_data = (6, 7, 8, 9, 10) @@ -162,7 +162,7 @@ class test_add_v_and_friends(gr_unittest.TestCase): expected_result = (6.0,) op = gr.add_vff(1) self.help_ff(1, (src1_data, src2_data, src3_data), expected_result, op) - + def test_add_vff_five(self): src1_data = (1.0, 2.0, 3.0, 4.0, 5.0) src2_data = (6.0, 7.0, 8.0, 9.0, 10.0) @@ -178,7 +178,7 @@ class test_add_v_and_friends(gr_unittest.TestCase): expected_result = (9.0+12j,) op = gr.add_vcc(1) self.help_cc(1, (src1_data, src2_data, src3_data), expected_result, op) - + def test_add_vcc_five(self): src1_data = (1.0+2.0j, 3.0+4.0j, 5.0+6.0j, 7.0+8.0j, 9.0+10.0j) src2_data = (11.0+12.0j, 13.0+14.0j, 15.0+16.0j, 17.0+18.0j, 19.0+20.0j) @@ -243,7 +243,7 @@ class test_add_v_and_friends(gr_unittest.TestCase): expected_result = (6,) op = gr.multiply_vss(1) self.help_ss(1, (src1_data, src2_data, src3_data), expected_result, op) - + def test_multiply_vss_five(self): src1_data = (1, 2, 3, 4, 5) src2_data = (6, 7, 8, 9, 10) @@ -259,7 +259,7 @@ class test_add_v_and_friends(gr_unittest.TestCase): expected_result = (6,) op = gr.multiply_vii(1) self.help_ii(1, (src1_data, src2_data, src3_data), expected_result, op) - + def test_multiply_vii_five(self): src1_data = (1, 2, 3, 4, 5) src2_data = (6, 7, 8, 9, 10) @@ -275,7 +275,7 @@ class test_add_v_and_friends(gr_unittest.TestCase): expected_result = (6.0,) op = gr.multiply_vff(1) self.help_ff(1, (src1_data, src2_data, src3_data), expected_result, op) - + def test_multiply_vff_five(self): src1_data = (1.0, 2.0, 3.0, 4.0, 5.0) src2_data = (6.0, 7.0, 8.0, 9.0, 10.0) @@ -291,7 +291,7 @@ class test_add_v_and_friends(gr_unittest.TestCase): expected_result = (-85+20j,) op = gr.multiply_vcc(1) self.help_cc(1, (src1_data, src2_data, src3_data), expected_result, op) - + def test_multiply_vcc_five(self): src1_data = (1.0+2.0j, 3.0+4.0j, 5.0+6.0j, 7.0+8.0j, 9.0+10.0j) src2_data = (11.0+12.0j, 13.0+14.0j, 15.0+16.0j, 17.0+18.0j, 19.0+20.0j) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_agc.py b/gnuradio-core/src/python/gnuradio/gr/qa_agc.py index c55d191e0..9fd633576 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_agc.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_agc.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest import math @@ -33,7 +33,7 @@ class test_agc (gr_unittest.TestCase): def tearDown (self): self.tb = None - + def test_001(self): ''' Test the complex AGC loop (single rate input) ''' tb = self.tb @@ -97,7 +97,7 @@ class test_agc (gr_unittest.TestCase): head = gr.head (gr.sizeof_gr_complex, int (5*sampling_freq * 0.10)) agc = gr.agc_cc(1e-3, 1, 1, 1000) - + tb.connect (src1, head) tb.connect (head, agc) tb.connect (agc, dst1) @@ -172,7 +172,7 @@ class test_agc (gr_unittest.TestCase): head = gr.head (gr.sizeof_float, int (5*sampling_freq * 0.10)) agc = gr.agc_ff(1e-3, 1, 1, 1000) - + tb.connect (src1, head) tb.connect (head, agc) tb.connect (agc, dst1) @@ -247,7 +247,7 @@ class test_agc (gr_unittest.TestCase): head = gr.head (gr.sizeof_gr_complex, int (5*sampling_freq * 0.10)) agc = gr.agc2_cc(1e-2, 1e-3, 1, 1, 1000) - + tb.connect (src1, head) tb.connect (head, agc) tb.connect (agc, dst1) @@ -322,7 +322,7 @@ class test_agc (gr_unittest.TestCase): head = gr.head (gr.sizeof_float, int (5*sampling_freq * 0.10)) agc = gr.agc2_ff(1e-2, 1e-3, 1, 1, 1000) - + tb.connect (src1, head) tb.connect (head, agc) tb.connect (agc, dst1) @@ -398,7 +398,7 @@ class test_agc (gr_unittest.TestCase): head = gr.head (gr.sizeof_gr_complex, int (5*sampling_freq * 0.10)) agc = gr.agc2_cc(1e-2, 1e-3, 1, 1, 1000) - + tb.connect (src1, head) tb.connect (head, agc) tb.connect (agc, dst1) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_argmax.py b/gnuradio-core/src/python/gnuradio/gr/qa_argmax.py index a9db3295a..564eb620b 100644 --- a/gnuradio-core/src/python/gnuradio/gr/qa_argmax.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_argmax.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2007,2010 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, gr_unittest import math diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_bin_statistics.py b/gnuradio-core/src/python/gnuradio/gr/qa_bin_statistics.py index b8b718a09..8a6dd9056 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_bin_statistics.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_bin_statistics.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2006,2007,2010 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, gr_unittest import random @@ -44,7 +44,7 @@ class counter(gr.feval_dd): t = self.count self.count = self.count + self.step_size return t - + class counter3(gr.feval_dd): def __init__(self, f, step_size): @@ -62,7 +62,7 @@ class counter3(gr.feval_dd): except Exception, e: print "Exception: ", e return t - + def foobar3(new_t): #print "foobar3: new_t =", new_t pass @@ -84,7 +84,7 @@ class counter4(gr.feval_dd): except Exception, e: print "Exception: ", e return t - + class parse_msg(object): def __init__(self, msg): @@ -122,7 +122,7 @@ class xtest_bin_statistics(gr_unittest.TestCase): 9, 10, 11, 12, 13, 14, 15, 16 )]) - + src = gr.vector_source_f(src_data, False) s2v = gr.stream_to_vector(gr.sizeof_float, vlen) stats = gr.bin_statistics_f(vlen, msgq, tune, tune_delay, dwell_delay) @@ -150,7 +150,7 @@ class xtest_bin_statistics(gr_unittest.TestCase): expected_results = tuple([float(x) for x in ( 9, 10, 11, 12)]) - + src = gr.vector_source_f(src_data, False) s2v = gr.stream_to_vector(gr.sizeof_float, vlen) stats = gr.bin_statistics_f(vlen, msgq, tune, tune_delay, dwell_delay) @@ -180,7 +180,7 @@ class xtest_bin_statistics(gr_unittest.TestCase): expected_results = tuple([float(x) for x in ( 9, 10, 11, 12)]) - + src = gr.vector_source_f(src_data, False) s2v = gr.stream_to_vector(gr.sizeof_float, vlen) stats = gr.bin_statistics_f(vlen, msgq, tune, tune_delay, dwell_delay) @@ -196,7 +196,7 @@ class xtest_bin_statistics(gr_unittest.TestCase): def foobar4(self, new_t): #print "foobar4: new_t =", new_t pass - + def xtest_004(self): vlen = 4 tune = counter4(self, 1) @@ -213,7 +213,7 @@ class xtest_bin_statistics(gr_unittest.TestCase): expected_results = tuple([float(x) for x in ( 9, 10, 11, 12)]) - + src = gr.vector_source_f(src_data, False) s2v = gr.stream_to_vector(gr.sizeof_float, vlen) stats = gr.bin_statistics_f(vlen, msgq, tune, tune_delay, dwell_delay) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_boolean_operators.py b/gnuradio-core/src/python/gnuradio/gr/qa_boolean_operators.py index 8cfb60099..d7d134dcb 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_boolean_operators.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_boolean_operators.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2008,2010 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, gr_unittest @@ -59,7 +59,7 @@ class test_boolean_operators (gr_unittest.TestCase): self.tb.run () result_data = dst.data () self.assertEqual (exp_data, result_data) - + def test_xor_ss (self): src1_data = (1, 2, 3, 0x5004, 0x1150) src2_data = (8, 2, 1 , 0x0508, 0x1105) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_classify.py b/gnuradio-core/src/python/gnuradio/gr/qa_classify.py deleted file mode 100755 index ac5b53b57..000000000 --- a/gnuradio-core/src/python/gnuradio/gr/qa_classify.py +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2008,2010 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. -# - -import numpy -from gnuradio import gr, gr_unittest -import copy -#import pygsl.wavelet as wavelet # FIXME: pygsl not checked for in config -import math - - -def sqr(x): - return x*x - -def np2(k): - m = 0 - n = k - 1 - while n > 0: - m += 1 - return m - - -class test_classify(gr_unittest.TestCase): - - def setUp(self): - self.tb = gr.top_block() - - def tearDown(self): - self.tb = None - -# def test_000_(self): -# src_data = numpy.zeros(10) -# trg_data = numpy.zeros(10) -# src = gr.vector_source_f(src_data) -# dst = gr.vector_sink_f() -# self.tb.connect(src, dst) -# self.tb.run() -# rsl_data = dst.data() -# sum = 0 -# for (u,v) in zip(trg_data, rsl_data): -# w = u - v -# sum += w * w -# sum /= float(len(trg_data)) -# assert sum < 1e-6 - - def test_001_(self): - src_data = numpy.array([-1.0, 1.0, -1.0, 1.0]) - trg_data = src_data * 0.5 - src = gr.vector_source_f(src_data) - dst = gr.vector_sink_f() - rail = gr.rail_ff(-0.5, 0.5) - self.tb.connect(src, rail) - self.tb.connect(rail, dst) - self.tb.run() - rsl_data = dst.data() - sum = 0 - for (u, v) in zip(trg_data, rsl_data): - w = u - v - sum += w * w - sum /= float(len(trg_data)) - assert sum < 1e-6 - - def test_002_(self): - src_data = numpy.array([-1.0, - -1.0/2.0, - -1.0/3.0, - -1.0/4.0, - -1.0/5.0]) - trg_data = copy.deepcopy(src_data) - - src = gr.vector_source_f(src_data, False, len(src_data)) - st = gr.stretch_ff(-1.0/5.0, len(src_data)) - dst = gr.vector_sink_f(len(src_data)) - self.tb.connect(src, st) - self.tb.connect(st, dst) - self.tb.run() - rsl_data = dst.data() - sum = 0 - for (u, v) in zip(trg_data, rsl_data): - w = u - v - sum += w * w - sum /= float(len(trg_data)) - assert sum < 1e-6 - - def test_003_(self): - src_grid = (0.0, 1.0, 2.0, 3.0, 4.0) - trg_grid = copy.deepcopy(src_grid) - src_data = (0.0, 1.0, 0.0, 1.0, 0.0) - - src = gr.vector_source_f(src_data, False, len(src_grid)) - sq = gr.squash_ff(src_grid, trg_grid) - dst = gr.vector_sink_f(len(trg_grid)) - self.tb.connect(src, sq) - self.tb.connect(sq, dst) - self.tb.run() - rsl_data = dst.data() - sum = 0 - for (u, v) in zip(src_data, rsl_data): - w = u - v - sum += w * w - sum /= float(len(src_data)) - assert sum < 1e-6 - -# def test_004_(self): # FIXME: requires pygsl -# -# n = 256 -# o = 4 -# ws = wavelet.workspace(n) -# w = wavelet.daubechies(o) -# -# a = numpy.arange(n) -# b = numpy.sin(a*numpy.pi/16.0) -# c = w.transform_forward(b, ws) -# d = w.transform_inverse(c, ws) -# -# src = gr.vector_source_f(b, False, n) -# wv = gr.wavelet_ff(n, o, True) -# -# dst = gr.vector_sink_f(n) -# self.tb.connect(src, wv) -# self.tb.connect(wv, dst) -# self.tb.run() -# e = dst.data() -# -# sum = 0 -# for (u, v) in zip(c, e): -# w = u - v -# sum += w * w -# sum /= float(len(c)) -# assert sum < 1e-6 - - def test_005_(self): - - src_data = (1.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0) - - dwav = numpy.array(src_data) - wvps = numpy.zeros(3) - # wavelet power spectrum - scl = 1.0/sqr(dwav[0]) - k = 1 - for e in range(len(wvps)): - wvps[e] = scl*sqr(dwav[k:k+(01<<e)]).sum() - k += 01<<e - - src = gr.vector_source_f(src_data, False, len(src_data)) - kon = gr.wvps_ff(len(src_data)) - dst = gr.vector_sink_f(int(math.ceil(math.log(len(src_data), 2)))) - - self.tb.connect(src, kon) - self.tb.connect(kon, dst) - - self.tb.run() - snk_data = dst.data() - - sum = 0 - for (u,v) in zip(snk_data, wvps): - w = u - v - sum += w * w - sum /= float(len(snk_data)) - assert sum < 1e-6 - -if __name__ == '__main__': - gr_unittest.run(test_classify, "test_classify.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_complex_to_xxx.py b/gnuradio-core/src/python/gnuradio/gr/qa_complex_to_xxx.py index 01679dc05..946c0d7f8 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_complex_to_xxx.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_complex_to_xxx.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest import math diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_conjugate.py b/gnuradio-core/src/python/gnuradio/gr/qa_conjugate.py index c07902a5a..17fa891e2 100644 --- a/gnuradio-core/src/python/gnuradio/gr/qa_conjugate.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_conjugate.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2012 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, gr_unittest @@ -34,11 +34,11 @@ class test_conjugate (gr_unittest.TestCase): src_data = (-2-2j, -1-1j, -2+2j, -1+1j, 2-2j, 1-1j, 2+2j, 1+1j, 0+0j) - + exp_data = (-2+2j, -1+1j, -2-2j, -1-1j, 2+2j, 1+1j, 2-2j, 1-1j, 0-0j) - + src = gr.vector_source_c(src_data) op = gr.conjugate_cc () dst = gr.vector_sink_c () diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_copy.py b/gnuradio-core/src/python/gnuradio/gr/qa_copy.py index e8ee480cc..68c8e451f 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_copy.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_copy.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2009,2010 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, gr_unittest @@ -40,7 +40,7 @@ class test_copy(gr_unittest.TestCase): self.tb.run() dst_data = dst.data() self.assertEqual(expected_result, dst_data) - + def test_copy_drop (self): src_data = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) expected_result = () @@ -52,7 +52,7 @@ class test_copy(gr_unittest.TestCase): self.tb.run() dst_data = dst.data() self.assertEqual(expected_result, dst_data) - + if __name__ == '__main__': gr_unittest.run(test_copy, "test_copy.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_dc_blocker.py b/gnuradio-core/src/python/gnuradio/gr/qa_dc_blocker.py index 8977b475a..0f6fa86f5 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_dc_blocker.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_dc_blocker.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2011 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, gr_unittest @@ -32,7 +32,7 @@ class test_dc_blocker(gr_unittest.TestCase): def test_001(self): ''' Test impulse response - long form, cc ''' - src_data = [1,] + 100*[0,] + src_data = [1,] + 100*[0,] expected_result = ((-0.02072429656982422+0j), (-0.02081298828125+0j), (0.979156494140625+0j), (-0.02081298828125+0j), (-0.02072429656982422+0j)) @@ -50,7 +50,7 @@ class test_dc_blocker(gr_unittest.TestCase): def test_002(self): ''' Test impulse response - short form, cc ''' - src_data = [1,] + 100*[0,] + src_data = [1,] + 100*[0,] expected_result = ((-0.029296875+0j), (-0.0302734375+0j), (0.96875+0j), (-0.0302734375+0j), (-0.029296875+0j)) @@ -69,7 +69,7 @@ class test_dc_blocker(gr_unittest.TestCase): def test_003(self): ''' Test impulse response - long form, ff ''' - src_data = [1,] + 100*[0,] + src_data = [1,] + 100*[0,] expected_result = ((-0.02072429656982422), (-0.02081298828125), (0.979156494140625), (-0.02081298828125), (-0.02072429656982422)) @@ -87,7 +87,7 @@ class test_dc_blocker(gr_unittest.TestCase): def test_004(self): ''' Test impulse response - short form, ff ''' - src_data = [1,] + 100*[0,] + src_data = [1,] + 100*[0,] expected_result = ((-0.029296875), (-0.0302734375), (0.96875), (-0.0302734375), (-0.029296875)) @@ -105,4 +105,4 @@ class test_dc_blocker(gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_dc_blocker, "test_dc_blocker.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_delay.py b/gnuradio-core/src/python/gnuradio/gr/qa_delay.py index 114e50108..0d0bc1330 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_delay.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_delay.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest import math diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_diff_encoder.py b/gnuradio-core/src/python/gnuradio/gr/qa_diff_encoder.py index 97e9e329a..c1fe2a700 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_diff_encoder.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_diff_encoder.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2006,2007,2010 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, gr_unittest import math @@ -30,7 +30,7 @@ def make_random_int_tuple(L, min, max): result.append(random.randint(min, max)) return tuple(result) - + class test_diff_encoder (gr_unittest.TestCase): def setUp (self): diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_diff_phasor_cc.py b/gnuradio-core/src/python/gnuradio/gr/qa_diff_phasor_cc.py index 5ac115e20..41f96aa61 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_diff_phasor_cc.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_diff_phasor_cc.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest import math diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_ecc_ccsds_27.py b/gnuradio-core/src/python/gnuradio/gr/qa_ecc_ccsds_27.py index caf3959f4..29122ff3e 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_ecc_ccsds_27.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_ecc_ccsds_27.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest @@ -44,7 +44,7 @@ class test_ccsds_27 (gr_unittest.TestCase): self.tb.run() dst_data = dst.data() self.assertEqual(expected, dst_data) - + if __name__ == '__main__': gr_unittest.run(test_ccsds_27, "test_ccsds_27.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_feval.py b/gnuradio-core/src/python/gnuradio/gr/qa_feval.py index a91409537..9018e12f3 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_feval.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_feval.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2006,2007,2010 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, gr_unittest @@ -59,7 +59,7 @@ class test_feval(gr_unittest.TestCase): actual_result = tuple([gr.feval_dd_example(f, x) for x in src_data]) self.assertEqual(expected_result, actual_result) - + def test_ll_1(self): f = my_add2_ll() src_data = (0, 1, 2, 3, 4) @@ -92,7 +92,7 @@ class test_feval(gr_unittest.TestCase): # this is python -> C++ -> python and back again... actual_result = tuple([gr.feval_cc_example(f, x) for x in src_data]) self.assertEqual(expected_result, actual_result) - + def test_void_1(self): # this is all in python f = my_feval() diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_fft.py b/gnuradio-core/src/python/gnuradio/gr/qa_fft.py index e90eb2e7f..693d0e67c 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_fft.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_fft.py @@ -1,19 +1,19 @@ #!/usr/bin/env python # # Copyright 2008,2010 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 this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -209,4 +209,4 @@ class test_fft(gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_fft, "test_fft.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_fft_filter.py b/gnuradio-core/src/python/gnuradio/gr/qa_fft_filter.py index 1e9fdb6a8..c0aadc306 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_fft_filter.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_fft_filter.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2005,2007,2010 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, gr_unittest import sys @@ -107,7 +107,7 @@ class test_fft_filter(gr_unittest.TestCase): #print 'expected:', expected_result #print 'results: ', result_data self.assertComplexTuplesAlmostEqual (expected_result, result_data, 5) - + def test_ccc_002(self): # Test nthreads @@ -125,7 +125,7 @@ class test_fft_filter(gr_unittest.TestCase): #print 'expected:', expected_result #print 'results: ', result_data self.assertComplexTuplesAlmostEqual (expected_result, result_data, 5) - + def test_ccc_003(self): tb = gr.top_block() src_data = (0,1,2,3,4,5,6,7) @@ -140,7 +140,7 @@ class test_fft_filter(gr_unittest.TestCase): #print 'expected:', expected_result #print 'results: ', result_data self.assertComplexTuplesAlmostEqual (expected_result, result_data, 5) - + def test_ccc_004(self): random.seed(0) @@ -160,7 +160,7 @@ class test_fft_filter(gr_unittest.TestCase): tb.run() result_data = dst.data() del tb - + self.assert_fft_ok2(expected_result, result_data) def test_ccc_005(self): @@ -227,7 +227,7 @@ class test_fft_filter(gr_unittest.TestCase): #print 'expected:', expected_result #print 'results: ', result_data self.assertFloatTuplesAlmostEqual (expected_result, result_data, 5) - + def test_fff_002(self): tb = gr.top_block() @@ -243,7 +243,7 @@ class test_fft_filter(gr_unittest.TestCase): #print 'expected:', expected_result #print 'results: ', result_data self.assertFloatTuplesAlmostEqual (expected_result, result_data, 5) - + def test_fff_003(self): # Test 02 with nthreads tb = gr.top_block() @@ -258,7 +258,7 @@ class test_fft_filter(gr_unittest.TestCase): tb.run() result_data = dst.data() self.assertFloatTuplesAlmostEqual (expected_result, result_data, 5) - + def xtest_fff_004(self): random.seed(0) for i in xrange(25): @@ -380,4 +380,4 @@ class test_fft_filter(gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_fft_filter, "test_fft_filter.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_filter_delay_fc.py b/gnuradio-core/src/python/gnuradio/gr/qa_filter_delay_fc.py index a25c65e5c..8d325fc3e 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_filter_delay_fc.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_filter_delay_fc.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest import math @@ -34,68 +34,68 @@ class test_filter_delay_fc (gr_unittest.TestCase): def test_001_filter_delay_one_input (self): # expected result - expected_result = ( -1.4678005338941702e-11j, - -0.0011950774351134896j, - -0.0019336787518113852j, - -0.0034673355985432863j, - -0.0036765895783901215j, - -0.004916108213365078j, - -0.0042778430506587029j, - -0.006028641015291214j, - -0.005476709920912981j, - -0.0092810001224279404j, - -0.0095402700826525688j, - -0.016060983762145042j, - -0.016446959227323532j, - -0.02523401565849781j, - -0.024382550269365311j, - -0.035477779805660248j, - -0.033021725714206696j, - -0.048487484455108643j, - -0.04543270543217659j, - -0.069477587938308716j, - -0.066984444856643677j, - -0.10703597217798233j, - -0.10620346665382385j, - -0.1852707713842392j, - -0.19357112050056458j, - (7.2191945754696007e-09 -0.50004088878631592j), - (0.58778399229049683 -0.6155126690864563j), - (0.95105588436126709 -0.12377222627401352j), - (0.95105588436126709 +0.41524654626846313j), - (0.5877838134765625 +0.91611981391906738j), - (5.8516356205018383e-09 +1.0670661926269531j), - (-0.5877840518951416 +0.87856143712997437j), - (-0.95105588436126709 +0.35447561740875244j), - (-0.95105588436126709 -0.26055556535720825j), - (-0.5877838134765625 -0.77606213092803955j), - (-8.7774534307527574e-09 -0.96460390090942383j), - (0.58778399229049683 -0.78470128774642944j), - (0.95105588436126709 -0.28380891680717468j), - (0.95105588436126709 +0.32548999786376953j), - (0.5877838134765625 +0.82514488697052002j), - (1.4629089051254596e-08 +1.0096219778060913j), - (-0.5877840518951416 +0.81836479902267456j), - (-0.95105588436126709 +0.31451958417892456j), - (-0.95105588436126709 -0.3030143678188324j), - (-0.5877838134765625 -0.80480599403381348j), - (-1.7554906861505515e-08 -0.99516552686691284j), - (0.58778399229049683 -0.80540722608566284j), - (0.95105582475662231 -0.30557557940483093j), - (0.95105588436126709 +0.31097668409347534j), - (0.5877838134765625 +0.81027895212173462j), - (2.3406542482007353e-08 +1.0000816583633423j), - (-0.5877840518951416 +0.80908381938934326j), - (-0.95105588436126709 +0.30904293060302734j), - (-0.95105588436126709 -0.30904296040534973j), - (-0.5877838134765625 -0.80908387899398804j), - (-2.6332360292258272e-08 -1.0000815391540527j), - (0.58778399229049683 -0.80908381938934326j), - (0.95105582475662231 -0.30904299020767212j), - (0.95105588436126709 +0.30904293060302734j), - (0.5877838134765625 +0.80908381938934326j), - (3.218399768911695e-08 +1.0000815391540527j)) - + expected_result = ( -1.4678005338941702e-11j, + -0.0011950774351134896j, + -0.0019336787518113852j, + -0.0034673355985432863j, + -0.0036765895783901215j, + -0.004916108213365078j, + -0.0042778430506587029j, + -0.006028641015291214j, + -0.005476709920912981j, + -0.0092810001224279404j, + -0.0095402700826525688j, + -0.016060983762145042j, + -0.016446959227323532j, + -0.02523401565849781j, + -0.024382550269365311j, + -0.035477779805660248j, + -0.033021725714206696j, + -0.048487484455108643j, + -0.04543270543217659j, + -0.069477587938308716j, + -0.066984444856643677j, + -0.10703597217798233j, + -0.10620346665382385j, + -0.1852707713842392j, + -0.19357112050056458j, + (7.2191945754696007e-09 -0.50004088878631592j), + (0.58778399229049683 -0.6155126690864563j), + (0.95105588436126709 -0.12377222627401352j), + (0.95105588436126709 +0.41524654626846313j), + (0.5877838134765625 +0.91611981391906738j), + (5.8516356205018383e-09 +1.0670661926269531j), + (-0.5877840518951416 +0.87856143712997437j), + (-0.95105588436126709 +0.35447561740875244j), + (-0.95105588436126709 -0.26055556535720825j), + (-0.5877838134765625 -0.77606213092803955j), + (-8.7774534307527574e-09 -0.96460390090942383j), + (0.58778399229049683 -0.78470128774642944j), + (0.95105588436126709 -0.28380891680717468j), + (0.95105588436126709 +0.32548999786376953j), + (0.5877838134765625 +0.82514488697052002j), + (1.4629089051254596e-08 +1.0096219778060913j), + (-0.5877840518951416 +0.81836479902267456j), + (-0.95105588436126709 +0.31451958417892456j), + (-0.95105588436126709 -0.3030143678188324j), + (-0.5877838134765625 -0.80480599403381348j), + (-1.7554906861505515e-08 -0.99516552686691284j), + (0.58778399229049683 -0.80540722608566284j), + (0.95105582475662231 -0.30557557940483093j), + (0.95105588436126709 +0.31097668409347534j), + (0.5877838134765625 +0.81027895212173462j), + (2.3406542482007353e-08 +1.0000816583633423j), + (-0.5877840518951416 +0.80908381938934326j), + (-0.95105588436126709 +0.30904293060302734j), + (-0.95105588436126709 -0.30904296040534973j), + (-0.5877838134765625 -0.80908387899398804j), + (-2.6332360292258272e-08 -1.0000815391540527j), + (0.58778399229049683 -0.80908381938934326j), + (0.95105582475662231 -0.30904299020767212j), + (0.95105588436126709 +0.30904293060302734j), + (0.5877838134765625 +0.80908381938934326j), + (3.218399768911695e-08 +1.0000815391540527j)) + tb = self.tb sampling_freq = 100 @@ -113,7 +113,7 @@ class test_filter_delay_fc (gr_unittest.TestCase): tb.connect (src1, head) tb.connect (head, hd) tb.connect (hd,dst2) - + tb.run () # get output @@ -126,69 +126,69 @@ class test_filter_delay_fc (gr_unittest.TestCase): # as above # expected result - expected_result = ( -1.4678005338941702e-11j, - -0.0011950774351134896j, - -0.0019336787518113852j, - -0.0034673355985432863j, - -0.0036765895783901215j, - -0.004916108213365078j, - -0.0042778430506587029j, - -0.006028641015291214j, - -0.005476709920912981j, - -0.0092810001224279404j, - -0.0095402700826525688j, - -0.016060983762145042j, - -0.016446959227323532j, - -0.02523401565849781j, - -0.024382550269365311j, - -0.035477779805660248j, - -0.033021725714206696j, - -0.048487484455108643j, - -0.04543270543217659j, - -0.069477587938308716j, - -0.066984444856643677j, - -0.10703597217798233j, - -0.10620346665382385j, - -0.1852707713842392j, - -0.19357112050056458j, - (7.2191945754696007e-09 -0.50004088878631592j), - (0.58778399229049683 -0.6155126690864563j), - (0.95105588436126709 -0.12377222627401352j), - (0.95105588436126709 +0.41524654626846313j), - (0.5877838134765625 +0.91611981391906738j), - (5.8516356205018383e-09 +1.0670661926269531j), - (-0.5877840518951416 +0.87856143712997437j), - (-0.95105588436126709 +0.35447561740875244j), - (-0.95105588436126709 -0.26055556535720825j), - (-0.5877838134765625 -0.77606213092803955j), - (-8.7774534307527574e-09 -0.96460390090942383j), - (0.58778399229049683 -0.78470128774642944j), - (0.95105588436126709 -0.28380891680717468j), - (0.95105588436126709 +0.32548999786376953j), - (0.5877838134765625 +0.82514488697052002j), - (1.4629089051254596e-08 +1.0096219778060913j), - (-0.5877840518951416 +0.81836479902267456j), - (-0.95105588436126709 +0.31451958417892456j), - (-0.95105588436126709 -0.3030143678188324j), - (-0.5877838134765625 -0.80480599403381348j), - (-1.7554906861505515e-08 -0.99516552686691284j), - (0.58778399229049683 -0.80540722608566284j), - (0.95105582475662231 -0.30557557940483093j), - (0.95105588436126709 +0.31097668409347534j), - (0.5877838134765625 +0.81027895212173462j), - (2.3406542482007353e-08 +1.0000816583633423j), - (-0.5877840518951416 +0.80908381938934326j), - (-0.95105588436126709 +0.30904293060302734j), - (-0.95105588436126709 -0.30904296040534973j), - (-0.5877838134765625 -0.80908387899398804j), - (-2.6332360292258272e-08 -1.0000815391540527j), - (0.58778399229049683 -0.80908381938934326j), - (0.95105582475662231 -0.30904299020767212j), - (0.95105588436126709 +0.30904293060302734j), - (0.5877838134765625 +0.80908381938934326j), - (3.218399768911695e-08 +1.0000815391540527j)) - - + expected_result = ( -1.4678005338941702e-11j, + -0.0011950774351134896j, + -0.0019336787518113852j, + -0.0034673355985432863j, + -0.0036765895783901215j, + -0.004916108213365078j, + -0.0042778430506587029j, + -0.006028641015291214j, + -0.005476709920912981j, + -0.0092810001224279404j, + -0.0095402700826525688j, + -0.016060983762145042j, + -0.016446959227323532j, + -0.02523401565849781j, + -0.024382550269365311j, + -0.035477779805660248j, + -0.033021725714206696j, + -0.048487484455108643j, + -0.04543270543217659j, + -0.069477587938308716j, + -0.066984444856643677j, + -0.10703597217798233j, + -0.10620346665382385j, + -0.1852707713842392j, + -0.19357112050056458j, + (7.2191945754696007e-09 -0.50004088878631592j), + (0.58778399229049683 -0.6155126690864563j), + (0.95105588436126709 -0.12377222627401352j), + (0.95105588436126709 +0.41524654626846313j), + (0.5877838134765625 +0.91611981391906738j), + (5.8516356205018383e-09 +1.0670661926269531j), + (-0.5877840518951416 +0.87856143712997437j), + (-0.95105588436126709 +0.35447561740875244j), + (-0.95105588436126709 -0.26055556535720825j), + (-0.5877838134765625 -0.77606213092803955j), + (-8.7774534307527574e-09 -0.96460390090942383j), + (0.58778399229049683 -0.78470128774642944j), + (0.95105588436126709 -0.28380891680717468j), + (0.95105588436126709 +0.32548999786376953j), + (0.5877838134765625 +0.82514488697052002j), + (1.4629089051254596e-08 +1.0096219778060913j), + (-0.5877840518951416 +0.81836479902267456j), + (-0.95105588436126709 +0.31451958417892456j), + (-0.95105588436126709 -0.3030143678188324j), + (-0.5877838134765625 -0.80480599403381348j), + (-1.7554906861505515e-08 -0.99516552686691284j), + (0.58778399229049683 -0.80540722608566284j), + (0.95105582475662231 -0.30557557940483093j), + (0.95105588436126709 +0.31097668409347534j), + (0.5877838134765625 +0.81027895212173462j), + (2.3406542482007353e-08 +1.0000816583633423j), + (-0.5877840518951416 +0.80908381938934326j), + (-0.95105588436126709 +0.30904293060302734j), + (-0.95105588436126709 -0.30904296040534973j), + (-0.5877838134765625 -0.80908387899398804j), + (-2.6332360292258272e-08 -1.0000815391540527j), + (0.58778399229049683 -0.80908381938934326j), + (0.95105582475662231 -0.30904299020767212j), + (0.95105588436126709 +0.30904293060302734j), + (0.5877838134765625 +0.80908381938934326j), + (3.218399768911695e-08 +1.0000815391540527j)) + + tb = self.tb sampling_freq = 100 @@ -220,76 +220,76 @@ class test_filter_delay_fc (gr_unittest.TestCase): # give two different inputs # expected result - expected_result = ( -0.0020331963896751404j, - -0.0016448829555884004j, - -0.0032375147566199303j, - -0.0014826074475422502j, - -0.0033034090884029865j, - -0.00051144487224519253j, - -0.0043686260469257832j, - -0.0010198024101555347j, - -0.0082517862319946289j, - -0.003456643782556057j, - -0.014193611219525337j, - -0.005875137634575367j, - -0.020293503999710083j, - -0.0067503536120057106j, - -0.026798896491527557j, - -0.0073488112539052963j, - -0.037041611969470978j, - -0.010557252913713455j, - -0.055669989436864853j, - -0.018332764506340027j, - -0.089904911816120148j, - -0.033361352980136871j, - -0.16902604699134827j, - -0.074318811297416687j, - -0.58429563045501709j, - (7.2191945754696007e-09 -0.35892376303672791j), - (0.58778399229049683 +0.63660913705825806j), - (0.95105588436126709 +0.87681591510772705j), - (0.95105588436126709 +0.98705857992172241j), - (0.5877838134765625 +0.55447429418563843j), - (5.8516356205018383e-09 +0.026006083935499191j), - (-0.5877840518951416 -0.60616838932037354j), - (-0.95105588436126709 -0.9311758279800415j), - (-0.95105588436126709 -0.96169203519821167j), - (-0.5877838134765625 -0.57292771339416504j), - (-8.7774534307527574e-09 -0.0073488391935825348j), - (0.58778399229049683 +0.59720659255981445j), - (0.95105588436126709 +0.94438445568084717j), - (0.95105588436126709 +0.95582199096679688j), - (0.5877838134765625 +0.58196049928665161j), - (1.4629089051254596e-08 +0.0026587247848510742j), - (-0.5877840518951416 -0.59129220247268677j), - (-0.95105588436126709 -0.94841635227203369j), - (-0.95105588436126709 -0.95215457677841187j), - (-0.5877838134765625 -0.58535969257354736j), - (-1.7554906861505515e-08 -0.00051158666610717773j), - (0.58778399229049683 +0.58867418766021729j), - (0.95105582475662231 +0.94965213537216187j), - (0.95105588436126709 +0.95050644874572754j), - (0.5877838134765625 +0.58619076013565063j), - (2.3406542482007353e-08 +1.1920928955078125e-07j), - (-0.5877840518951416 -0.58783555030822754j), - (-0.95105588436126709 -0.95113480091094971j), - (-0.95105588436126709 -0.95113474130630493j), - (-0.5877838134765625 -0.58783555030822754j), - (-2.6332360292258272e-08 -8.1956386566162109e-08j), - (0.58778399229049683 +0.58783555030822754j), - (0.95105582475662231 +0.95113474130630493j), - (0.95105588436126709 +0.95113474130630493j), - (0.5877838134765625 +0.58783560991287231j), + expected_result = ( -0.0020331963896751404j, + -0.0016448829555884004j, + -0.0032375147566199303j, + -0.0014826074475422502j, + -0.0033034090884029865j, + -0.00051144487224519253j, + -0.0043686260469257832j, + -0.0010198024101555347j, + -0.0082517862319946289j, + -0.003456643782556057j, + -0.014193611219525337j, + -0.005875137634575367j, + -0.020293503999710083j, + -0.0067503536120057106j, + -0.026798896491527557j, + -0.0073488112539052963j, + -0.037041611969470978j, + -0.010557252913713455j, + -0.055669989436864853j, + -0.018332764506340027j, + -0.089904911816120148j, + -0.033361352980136871j, + -0.16902604699134827j, + -0.074318811297416687j, + -0.58429563045501709j, + (7.2191945754696007e-09 -0.35892376303672791j), + (0.58778399229049683 +0.63660913705825806j), + (0.95105588436126709 +0.87681591510772705j), + (0.95105588436126709 +0.98705857992172241j), + (0.5877838134765625 +0.55447429418563843j), + (5.8516356205018383e-09 +0.026006083935499191j), + (-0.5877840518951416 -0.60616838932037354j), + (-0.95105588436126709 -0.9311758279800415j), + (-0.95105588436126709 -0.96169203519821167j), + (-0.5877838134765625 -0.57292771339416504j), + (-8.7774534307527574e-09 -0.0073488391935825348j), + (0.58778399229049683 +0.59720659255981445j), + (0.95105588436126709 +0.94438445568084717j), + (0.95105588436126709 +0.95582199096679688j), + (0.5877838134765625 +0.58196049928665161j), + (1.4629089051254596e-08 +0.0026587247848510742j), + (-0.5877840518951416 -0.59129220247268677j), + (-0.95105588436126709 -0.94841635227203369j), + (-0.95105588436126709 -0.95215457677841187j), + (-0.5877838134765625 -0.58535969257354736j), + (-1.7554906861505515e-08 -0.00051158666610717773j), + (0.58778399229049683 +0.58867418766021729j), + (0.95105582475662231 +0.94965213537216187j), + (0.95105588436126709 +0.95050644874572754j), + (0.5877838134765625 +0.58619076013565063j), + (2.3406542482007353e-08 +1.1920928955078125e-07j), + (-0.5877840518951416 -0.58783555030822754j), + (-0.95105588436126709 -0.95113480091094971j), + (-0.95105588436126709 -0.95113474130630493j), + (-0.5877838134765625 -0.58783555030822754j), + (-2.6332360292258272e-08 -8.1956386566162109e-08j), + (0.58778399229049683 +0.58783555030822754j), + (0.95105582475662231 +0.95113474130630493j), + (0.95105588436126709 +0.95113474130630493j), + (0.5877838134765625 +0.58783560991287231j), (3.218399768911695e-08 +1.1920928955078125e-07j)) tb = self.tb sampling_freq = 100 ntaps = 51 - + src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE,sampling_freq * 0.10, 1.0) src2 = gr.sig_source_f (sampling_freq, gr.GR_COS_WAVE,sampling_freq * 0.10, 1.0) - + head1 = gr.head (gr.sizeof_float, int (ntaps + sampling_freq * 0.10)) head2 = gr.head (gr.sizeof_float, int (ntaps + sampling_freq * 0.10)) @@ -300,7 +300,7 @@ class test_filter_delay_fc (gr_unittest.TestCase): tb.connect (src1, head1) tb.connect (src2, head2) - + tb.connect (head1, (hd,0)) tb.connect (head2, (hd,1)) tb.connect (hd, dst2) @@ -312,6 +312,6 @@ class test_filter_delay_fc (gr_unittest.TestCase): self.assertComplexTuplesAlmostEqual (expected_result, result_data, 5) - + if __name__ == '__main__': gr_unittest.run(test_filter_delay_fc, "test_filter_delay_fc.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_float_to_char.py b/gnuradio-core/src/python/gnuradio/gr/qa_float_to_char.py index ecdd36228..057e297f9 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_float_to_char.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_float_to_char.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2011,2012 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, gr_unittest class test_float_to_char (gr_unittest.TestCase): @@ -60,7 +60,7 @@ class test_float_to_char (gr_unittest.TestCase): self.assertEqual(expected_result, result_data) def test_003(self): - + scale = 2 vlen = 3 src_data = (0.0, 1.1, 2.2, 3.3, 4.4, 5.5, -1.1, -2.2, -3.3) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_float_to_int.py b/gnuradio-core/src/python/gnuradio/gr/qa_float_to_int.py index 977a8518d..5c7a412d2 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_float_to_int.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_float_to_int.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2011 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, gr_unittest @@ -63,7 +63,7 @@ class test_float_to_int (gr_unittest.TestCase): def test_003(self): - + scale = 2 vlen = 3 src_data = (0.0, 1.1, 2.2, 3.3, 4.4, 5.5, -1.1, -2.2, -3.3) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_float_to_short.py b/gnuradio-core/src/python/gnuradio/gr/qa_float_to_short.py index 0d89a149c..3f8b66975 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_float_to_short.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_float_to_short.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2011,2012 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, gr_unittest import ctypes diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_float_to_uchar.py b/gnuradio-core/src/python/gnuradio/gr/qa_float_to_uchar.py index 0d54f45f3..831bed93e 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_float_to_uchar.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_float_to_uchar.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2011 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, gr_unittest import ctypes diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_fractional_interpolator.py b/gnuradio-core/src/python/gnuradio/gr/qa_fractional_interpolator.py index c9ba54164..e19bb28f3 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_fractional_interpolator.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_fractional_interpolator.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2007,2010 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, gr_unittest @@ -33,6 +33,6 @@ class test_fractional_resampler (gr_unittest.TestCase): def test_000_make(self): op = gr.fractional_interpolator_ff(0.0, 1.0) op2 = gr.fractional_interpolator_cc(0.0, 1.0) - + if __name__ == '__main__': gr_unittest.run(test_fractional_resampler, "test_fractional_resampler.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_frequency_modulator.py b/gnuradio-core/src/python/gnuradio/gr/qa_frequency_modulator.py index 7328f041d..23459fff3 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_frequency_modulator.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_frequency_modulator.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest import math @@ -53,4 +53,4 @@ class test_frequency_modulator (gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_frequency_modulator, "test_frequency_modulator.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_fsk_stuff.py b/gnuradio-core/src/python/gnuradio/gr/qa_fsk_stuff.py index 429e57c32..95b8c0664 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_fsk_stuff.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_fsk_stuff.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest import math @@ -49,9 +49,9 @@ class test_bytes_to_syms (gr_unittest.TestCase): self.assertEqual (expected_result, result_data) def test_simple_framer (self): - src_data = (0x00, 0x11, 0x22, 0x33, + src_data = (0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, - 0x88, 0x99, 0xaa, 0xbb, + 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff) expected_result = ( @@ -68,8 +68,8 @@ class test_bytes_to_syms (gr_unittest.TestCase): self.tb.run () result_data = dst.data () self.assertEqual (expected_result, result_data) - + if __name__ == '__main__': gr_unittest.run(test_bytes_to_syms, "test_bytes_to_syms.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_glfsr_source.py b/gnuradio-core/src/python/gnuradio/gr/qa_glfsr_source.py index 1665d9dd5..161e4a5cc 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_glfsr_source.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_glfsr_source.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2007,2010 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, gr_unittest @@ -81,7 +81,7 @@ class test_glfsr_source(gr_unittest.TestCase): self.assertEqual(R[0], float(len(R))) # Auto-correlation peak at origin for i in range(len(R)-1): self.assertEqual(R[i+1], -1.0) # Auto-correlation minimum everywhere else - + def auto_correlate(data): l = len(data) R = [0,]*l diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_goertzel.py b/gnuradio-core/src/python/gnuradio/gr/qa_goertzel.py index dcb3d867e..77f1b5f89 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_goertzel.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_goertzel.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2006,2007,2010 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, gr_unittest from math import pi, cos @@ -40,7 +40,7 @@ class test_goertzel(gr_unittest.TestCase): dst = gr.vector_sink_c() self.tb.connect(src, dft, dst) self.tb.run() - return dst.data() + return dst.data() def test_001(self): # Measure single tone magnitude rate = 8000 diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_head.py b/gnuradio-core/src/python/gnuradio/gr/qa_head.py index aae233b56..d7cb354dc 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_head.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_head.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest @@ -41,7 +41,7 @@ class test_head (gr_unittest.TestCase): self.tb.run () dst_data = dst1.data () self.assertEqual (expected_result, dst_data) - + if __name__ == '__main__': gr_unittest.run(test_head, "test_head.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_hier_block2.py b/gnuradio-core/src/python/gnuradio/gr/qa_hier_block2.py index 924a0fb52..3132d91b0 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_hier_block2.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_hier_block2.py @@ -11,8 +11,8 @@ class test_hier_block2(gr_unittest.TestCase): pass def test_001_make(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) self.assertEqual("test_block", hblock.name()) self.assertEqual(1, hblock.input_signature().max_streams()) @@ -21,22 +21,22 @@ class test_hier_block2(gr_unittest.TestCase): self.assertEqual(gr.sizeof_int, hblock.output_signature().sizeof_stream_item(0)) def test_002_connect_input(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) hblock.connect(hblock, nop1) def test_004_connect_output(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) hblock.connect(nop1, hblock) def test_005_connect_output_in_use(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) nop2 = gr.nop(gr.sizeof_int) @@ -45,37 +45,37 @@ class test_hier_block2(gr_unittest.TestCase): lambda: hblock.connect(nop2, hblock)) def test_006_connect_invalid_src_port_neg(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) - self.assertRaises(ValueError, + self.assertRaises(ValueError, lambda: hblock.connect((hblock, -1), nop1)) def test_005_connect_invalid_src_port_exceeds(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) - self.assertRaises(ValueError, + self.assertRaises(ValueError, lambda: hblock.connect((hblock, 1), nop1)) def test_007_connect_invalid_dst_port_neg(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) nop2 = gr.nop(gr.sizeof_int) - self.assertRaises(ValueError, + self.assertRaises(ValueError, lambda: hblock.connect(nop1, (nop2, -1))) def test_008_connect_invalid_dst_port_exceeds(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.null_sink(gr.sizeof_int) nop2 = gr.null_sink(gr.sizeof_int) - self.assertRaises(ValueError, + self.assertRaises(ValueError, lambda: hblock.connect(nop1, (nop2, 1))) def test_009_check_topology(self): @@ -97,26 +97,26 @@ class test_hier_block2(gr_unittest.TestCase): self.assertEquals(expected, actual2) def test_012_disconnect_input(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) hblock.connect(hblock, nop1) hblock.disconnect(hblock, nop1) - + def test_013_disconnect_input_not_connected(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) nop2 = gr.nop(gr.sizeof_int) hblock.connect(hblock, nop1) self.assertRaises(ValueError, lambda: hblock.disconnect(hblock, nop2)) - + def test_014_disconnect_input_neg(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) hblock.connect(hblock, nop1) @@ -124,8 +124,8 @@ class test_hier_block2(gr_unittest.TestCase): lambda: hblock.disconnect((hblock, -1), nop1)) def test_015_disconnect_input_exceeds(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) hblock.connect(hblock, nop1) @@ -133,26 +133,26 @@ class test_hier_block2(gr_unittest.TestCase): lambda: hblock.disconnect((hblock, 1), nop1)) def test_016_disconnect_output(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) hblock.connect(nop1, hblock) hblock.disconnect(nop1, hblock) - + def test_017_disconnect_output_not_connected(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) nop2 = gr.nop(gr.sizeof_int) hblock.connect(nop1, hblock) self.assertRaises(ValueError, lambda: hblock.disconnect(nop2, hblock)) - + def test_018_disconnect_output_neg(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) hblock.connect(hblock, nop1) @@ -160,8 +160,8 @@ class test_hier_block2(gr_unittest.TestCase): lambda: hblock.disconnect(nop1, (hblock, -1))) def test_019_disconnect_output_exceeds(self): - hblock = gr.hier_block2("test_block", - gr.io_signature(1,1,gr.sizeof_int), + hblock = gr.hier_block2("test_block", + gr.io_signature(1,1,gr.sizeof_int), gr.io_signature(1,1,gr.sizeof_int)) nop1 = gr.nop(gr.sizeof_int) hblock.connect(nop1, hblock) @@ -240,7 +240,7 @@ class test_hier_block2(gr_unittest.TestCase): src = gr.vector_source_b([1, ]) dst = gr.vector_sink_b() tb.connect(src, hb, dst) # hb's input is not connected internally - self.assertRaises(RuntimeError, + self.assertRaises(RuntimeError, lambda: tb.run()) def test_027b_internally_unconnected_output(self): @@ -254,7 +254,7 @@ class test_hier_block2(gr_unittest.TestCase): src = gr.vector_source_b([1, ]) dst = gr.vector_sink_b() tb.connect(src, hb, dst) # hb's output is not connected internally - self.assertRaises(RuntimeError, + self.assertRaises(RuntimeError, lambda: tb.run()) def test_027c_fully_unconnected_output(self): @@ -267,7 +267,7 @@ class test_hier_block2(gr_unittest.TestCase): src = gr.vector_source_b([1, ]) dst = gr.vector_sink_b() tb.connect(src, hb) # hb's output is not connected internally or externally - self.assertRaises(RuntimeError, + self.assertRaises(RuntimeError, lambda: tb.run()) def test_027d_fully_unconnected_input(self): @@ -279,12 +279,12 @@ class test_hier_block2(gr_unittest.TestCase): hb.connect(hdst, hb) # wire output internally dst = gr.vector_sink_b() tb.connect(hb, dst) # hb's input is not connected internally or externally - self.assertRaises(RuntimeError, + self.assertRaises(RuntimeError, lambda: tb.run()) def test_028_singleton_reconfigure(self): tb = gr.top_block() - hb = gr.hier_block2("block", + hb = gr.hier_block2("block", gr.io_signature(0, 0, 0), gr.io_signature(0, 0, 0)) src = gr.vector_source_b([1, ]) dst = gr.vector_sink_b() @@ -332,7 +332,7 @@ class test_hier_block2(gr_unittest.TestCase): add = gr.add_ff() hb.connect(hb, m1) # m1 is connected to hb external input #0 hb.connect(hb, m2) # m2 is also connected to hb external input #0 - hb.connect(m1, (add, 0)) + hb.connect(m1, (add, 0)) hb.connect(m2, (add, 1)) hb.connect(add, hb) # add is connected to hb external output #0 dst = gr.vector_sink_f() @@ -355,7 +355,7 @@ class test_hier_block2(gr_unittest.TestCase): add = gr.add_ff() hb2.connect(hb2, m1) # m1 is connected to hb2 external input #0 hb2.connect(hb2, m2) # m2 is also connected to hb2 external input #0 - hb2.connect(m1, (add, 0)) + hb2.connect(m1, (add, 0)) hb2.connect(m2, (add, 1)) hb2.connect(add, hb2) # add is connected to hb2 external output #0 hb.connect(hb, hb2, hb) # hb as hb2 as nested internal block @@ -363,7 +363,7 @@ class test_hier_block2(gr_unittest.TestCase): tb.connect(src, hb, dst) tb.run() self.assertEquals(dst.data(), (3.0,)) - - + + if __name__ == "__main__": gr_unittest.run(test_hier_block2, "test_hier_block2.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_hilbert.py b/gnuradio-core/src/python/gnuradio/gr/qa_hilbert.py index 2235f28b1..27d01092b 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_hilbert.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_hilbert.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest import math @@ -36,68 +36,68 @@ class test_hilbert (gr_unittest.TestCase): ntaps = 51 sampling_freq = 100 - expected_result = ( -1.4678005338941702e-11j, - -0.0011950774351134896j, - -0.0019336787518113852j, - -0.0034673355985432863j, - -0.0036765895783901215j, - -0.004916108213365078j, - -0.0042778430506587029j, - -0.006028641015291214j, - -0.005476709920912981j, - -0.0092810001224279404j, - -0.0095402700826525688j, - -0.016060983762145042j, - -0.016446959227323532j, - -0.02523401565849781j, - -0.024382550269365311j, - -0.035477779805660248j, - -0.033021725714206696j, - -0.048487484455108643j, - -0.04543270543217659j, - -0.069477587938308716j, - -0.066984444856643677j, - -0.10703597217798233j, - -0.10620346665382385j, - -0.1852707713842392j, - -0.19357112050056458j, - (7.2191945754696007e-09 -0.50004088878631592j), - (0.58778399229049683 -0.6155126690864563j), - (0.95105588436126709 -0.12377222627401352j), - (0.95105588436126709 +0.41524654626846313j), - (0.5877838134765625 +0.91611981391906738j), - (5.8516356205018383e-09 +1.0670661926269531j), - (-0.5877840518951416 +0.87856143712997437j), - (-0.95105588436126709 +0.35447561740875244j), - (-0.95105588436126709 -0.26055556535720825j), - (-0.5877838134765625 -0.77606213092803955j), - (-8.7774534307527574e-09 -0.96460390090942383j), - (0.58778399229049683 -0.78470128774642944j), - (0.95105588436126709 -0.28380891680717468j), - (0.95105588436126709 +0.32548999786376953j), - (0.5877838134765625 +0.82514488697052002j), - (1.4629089051254596e-08 +1.0096219778060913j), - (-0.5877840518951416 +0.81836479902267456j), - (-0.95105588436126709 +0.31451958417892456j), - (-0.95105588436126709 -0.3030143678188324j), - (-0.5877838134765625 -0.80480599403381348j), - (-1.7554906861505515e-08 -0.99516552686691284j), - (0.58778399229049683 -0.80540722608566284j), - (0.95105582475662231 -0.30557557940483093j), - (0.95105588436126709 +0.31097668409347534j), - (0.5877838134765625 +0.81027895212173462j), - (2.3406542482007353e-08 +1.0000816583633423j), - (-0.5877840518951416 +0.80908381938934326j), - (-0.95105588436126709 +0.30904293060302734j), - (-0.95105588436126709 -0.30904296040534973j), - (-0.5877838134765625 -0.80908387899398804j), - (-2.6332360292258272e-08 -1.0000815391540527j), - (0.58778399229049683 -0.80908381938934326j), - (0.95105582475662231 -0.30904299020767212j), - (0.95105588436126709 +0.30904293060302734j), - (0.5877838134765625 +0.80908381938934326j), + expected_result = ( -1.4678005338941702e-11j, + -0.0011950774351134896j, + -0.0019336787518113852j, + -0.0034673355985432863j, + -0.0036765895783901215j, + -0.004916108213365078j, + -0.0042778430506587029j, + -0.006028641015291214j, + -0.005476709920912981j, + -0.0092810001224279404j, + -0.0095402700826525688j, + -0.016060983762145042j, + -0.016446959227323532j, + -0.02523401565849781j, + -0.024382550269365311j, + -0.035477779805660248j, + -0.033021725714206696j, + -0.048487484455108643j, + -0.04543270543217659j, + -0.069477587938308716j, + -0.066984444856643677j, + -0.10703597217798233j, + -0.10620346665382385j, + -0.1852707713842392j, + -0.19357112050056458j, + (7.2191945754696007e-09 -0.50004088878631592j), + (0.58778399229049683 -0.6155126690864563j), + (0.95105588436126709 -0.12377222627401352j), + (0.95105588436126709 +0.41524654626846313j), + (0.5877838134765625 +0.91611981391906738j), + (5.8516356205018383e-09 +1.0670661926269531j), + (-0.5877840518951416 +0.87856143712997437j), + (-0.95105588436126709 +0.35447561740875244j), + (-0.95105588436126709 -0.26055556535720825j), + (-0.5877838134765625 -0.77606213092803955j), + (-8.7774534307527574e-09 -0.96460390090942383j), + (0.58778399229049683 -0.78470128774642944j), + (0.95105588436126709 -0.28380891680717468j), + (0.95105588436126709 +0.32548999786376953j), + (0.5877838134765625 +0.82514488697052002j), + (1.4629089051254596e-08 +1.0096219778060913j), + (-0.5877840518951416 +0.81836479902267456j), + (-0.95105588436126709 +0.31451958417892456j), + (-0.95105588436126709 -0.3030143678188324j), + (-0.5877838134765625 -0.80480599403381348j), + (-1.7554906861505515e-08 -0.99516552686691284j), + (0.58778399229049683 -0.80540722608566284j), + (0.95105582475662231 -0.30557557940483093j), + (0.95105588436126709 +0.31097668409347534j), + (0.5877838134765625 +0.81027895212173462j), + (2.3406542482007353e-08 +1.0000816583633423j), + (-0.5877840518951416 +0.80908381938934326j), + (-0.95105588436126709 +0.30904293060302734j), + (-0.95105588436126709 -0.30904296040534973j), + (-0.5877838134765625 -0.80908387899398804j), + (-2.6332360292258272e-08 -1.0000815391540527j), + (0.58778399229049683 -0.80908381938934326j), + (0.95105582475662231 -0.30904299020767212j), + (0.95105588436126709 +0.30904293060302734j), + (0.5877838134765625 +0.80908381938934326j), (3.218399768911695e-08 +1.0000815391540527j)) - + src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, sampling_freq * 0.10, 1.0) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_iir.py b/gnuradio-core/src/python/gnuradio/gr/qa_iir.py index 0e522c16b..06b8d767e 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_iir.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_iir.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest @@ -133,7 +133,7 @@ class test_iir (gr_unittest.TestCase): self.tb.run () result_data = dst.data () self.assertFloatTuplesAlmostEqual (expected_result, result_data) - + def test_iir_direct_008 (self): src_data = (1, 2, 3, 4, 5, 6, 7, 8) expected_result = (2,4,4,10,18,14,26,56) @@ -150,10 +150,10 @@ class test_iir (gr_unittest.TestCase): self.tb.run () result_data = dst.data () self.assertFloatTuplesAlmostEqual (expected_result, result_data) - - + + if __name__ == '__main__': gr_unittest.run(test_iir, "test_iir.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_int_to_float.py b/gnuradio-core/src/python/gnuradio/gr/qa_int_to_float.py index 530b2a5cc..7536b3820 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_int_to_float.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_int_to_float.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2011 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, gr_unittest @@ -41,7 +41,7 @@ class test_int_to_float (gr_unittest.TestCase): self.tb.connect(src, op, dst) self.tb.run() result_data = dst.data() - + self.assertFloatTuplesAlmostEqual(expected_result, result_data) def test_002(self): @@ -49,7 +49,7 @@ class test_int_to_float (gr_unittest.TestCase): vlen = 3 src_data = ( 65000, 65001, 65002, 65003, 65004, 65005, -65001, -65002, -65003) - expected_result = [ 65000.0, 65001.0, 65002.0, + expected_result = [ 65000.0, 65001.0, 65002.0, 65003.0, 65004.0, 65005.0, -65001.0, -65002.0, -65003.0] src = gr.vector_source_i(src_data) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_integrate.py b/gnuradio-core/src/python/gnuradio/gr/qa_integrate.py index 501a89f84..ddb1310b6 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_integrate.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_integrate.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2008,2010 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, gr_unittest import math @@ -40,7 +40,7 @@ class test_integrate (gr_unittest.TestCase): self.tb.connect(src, itg, dst) self.tb.run() self.assertEqual(dst_data, dst.data()) - + def test_001_ii(self): src_data = (1, 2, 3, 4, 5, 6) dst_data = (6, 15) @@ -50,7 +50,7 @@ class test_integrate (gr_unittest.TestCase): self.tb.connect(src, itg, dst) self.tb.run() self.assertEqual(dst_data, dst.data()) - + def test_002_ff(self): src_data = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] dst_data = [6.0, 15.0] @@ -59,7 +59,7 @@ class test_integrate (gr_unittest.TestCase): dst = gr.vector_sink_f() self.tb.connect(src, itg, dst) self.tb.run() - self.assertFloatTuplesAlmostEqual(dst_data, dst.data(), 6) + self.assertFloatTuplesAlmostEqual(dst_data, dst.data(), 6) def test_003_cc(self): src_data = [1.0+1.0j, 2.0+2.0j, 3.0+3.0j, 4.0+4.0j, 5.0+5.0j, 6.0+6.0j] @@ -69,7 +69,7 @@ class test_integrate (gr_unittest.TestCase): dst = gr.vector_sink_c() self.tb.connect(src, itg, dst) self.tb.run() - self.assertComplexTuplesAlmostEqual(dst_data, dst.data(), 6) + self.assertComplexTuplesAlmostEqual(dst_data, dst.data(), 6) if __name__ == '__main__': gr_unittest.run(test_integrate, "test_integrate.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_interleave.py b/gnuradio-core/src/python/gnuradio/gr/qa_interleave.py index 1320d0ec5..1ff178251 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_interleave.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_interleave.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest import math @@ -78,4 +78,4 @@ class test_interleave (gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_interleave, "test_interleave.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_interp_fir_filter.py b/gnuradio-core/src/python/gnuradio/gr/qa_interp_fir_filter.py index 9901b71b7..9bd9977c7 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_interp_fir_filter.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_interp_fir_filter.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest import math @@ -51,4 +51,4 @@ class test_interp_fir_filter (gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_interp_fir_filter, "test_interp_fir_filter.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_kludge_copy.py b/gnuradio-core/src/python/gnuradio/gr/qa_kludge_copy.py index 2f0bbe33d..2a3aa44b1 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_kludge_copy.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_kludge_copy.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2006,2010 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, gr_unittest import math @@ -53,7 +53,7 @@ class test_kludge_copy(gr_unittest.TestCase): self.tb.run() dst0_data = dst0.data() self.assertEqual(src0_data, dst0_data) - + def test_002(self): # 2 input streams; 2 output streams src0_data = self.make_random_int_tuple(16000) @@ -70,7 +70,7 @@ class test_kludge_copy(gr_unittest.TestCase): dst1_data = dst1.data() self.assertEqual(src0_data, dst0_data) self.assertEqual(src1_data, dst1_data) - + # Note: this is disabled due to triggering bug in ticket:181 # It only occurs with new top block code def xtest_003(self): @@ -88,4 +88,4 @@ class test_kludge_copy(gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_kludge_copy, "test_kludge_copy.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_kludged_imports.py b/gnuradio-core/src/python/gnuradio/gr/qa_kludged_imports.py index 7d29a9507..39b5d781e 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_kludged_imports.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_kludged_imports.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2005,2008,2010 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, gr_unittest diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_max.py b/gnuradio-core/src/python/gnuradio/gr/qa_max.py index 5aa231623..f962df457 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_max.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_max.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2007,2010 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, gr_unittest import math diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_message.py b/gnuradio-core/src/python/gnuradio/gr/qa_message.py index e7f2778d1..4cef39bd7 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_message.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_message.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2010 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, gr_unittest @@ -38,7 +38,7 @@ class test_message (gr_unittest.TestCase): def tearDown (self): self.msgq = None - + def leak_check (self, fct): begin = all_counts () fct () @@ -61,7 +61,7 @@ class test_message (gr_unittest.TestCase): def test_200 (self): self.leak_check (self.body_200) - + def body_200 (self): self.msgq.insert_tail (gr.message (0)) self.assertEquals (1, self.msgq.count()) @@ -75,7 +75,7 @@ class test_message (gr_unittest.TestCase): def test_201 (self): self.leak_check (self.body_201) - + def body_201 (self): self.msgq.insert_tail (gr.message (0)) self.assertEquals (1, self.msgq.count()) @@ -84,7 +84,7 @@ class test_message (gr_unittest.TestCase): def test_202 (self): self.leak_check (self.body_202) - + def body_202 (self): # global msg msg = gr.message (666) @@ -111,7 +111,7 @@ class test_message (gr_unittest.TestCase): src.msgq().insert_tail(gr.message(1)) # send EOF tb.run() self.assertEquals(tuple(map(ord, '0123456789')), dst.data()) - + def test_302(self): # Use itemsize, msgq constructor msgq = gr.msg_queue() diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_multiply_conjugate.py b/gnuradio-core/src/python/gnuradio/gr/qa_multiply_conjugate.py index aaf3cc125..1601a109e 100644 --- a/gnuradio-core/src/python/gnuradio/gr/qa_multiply_conjugate.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_multiply_conjugate.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2012 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, gr_unittest @@ -37,8 +37,8 @@ class test_multiply_conjugate (gr_unittest.TestCase): src_data1 = (-3-3j, -4-4j, -3+3j, -4+4j, 3-3j, 4-4j, 3+3j, 4+4j, 0+0j) - - exp_data = (12+0j, 8+0j, 12+0j, 8+0j, + + exp_data = (12+0j, 8+0j, 12+0j, 8+0j, 12+0j, 8+0j, 12+0j, 8+0j, 0+0j) src0 = gr.vector_source_c(src_data0) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_mute.py b/gnuradio-core/src/python/gnuradio/gr/qa_mute.py index 58c5062a5..afdfdfe13 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_mute.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_mute.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2005,2007,2010 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, gr_unittest diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_nlog10.py b/gnuradio-core/src/python/gnuradio/gr/qa_nlog10.py index 5a2e6a0d2..a87ed87ee 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_nlog10.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_nlog10.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2005,2007,2010 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, gr_unittest @@ -44,4 +44,4 @@ class test_nlog10(gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_nlog10, "test_nlog10.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_noise.py b/gnuradio-core/src/python/gnuradio/gr/qa_noise.py index d7750cfe2..e87519150 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_noise.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_noise.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2007,2010 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, gr_unittest @@ -44,8 +44,8 @@ class test_noise_source(gr_unittest.TestCase): self.assertEqual(get_type, set_type) self.assertEqual(get_ampl, set_ampl) - + if __name__ == '__main__': gr_unittest.run(test_noise_source, "test_noise_source.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_packed_to_unpacked.py b/gnuradio-core/src/python/gnuradio/gr/qa_packed_to_unpacked.py index 8833f755b..08accd0ad 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_packed_to_unpacked.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_packed_to_unpacked.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2005,2007,2010 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, gr_unittest import random @@ -40,7 +40,7 @@ class test_packing(gr_unittest.TestCase): src = gr.vector_source_b(src_data,False) op = gr.packed_to_unpacked_bb(1, gr.GR_MSB_FIRST) self.tb.connect(src, op) - + dst = gr.vector_sink_b() self.tb.connect(op, dst) @@ -57,7 +57,7 @@ class test_packing(gr_unittest.TestCase): src = gr.vector_source_b(src_data,False) op = gr.packed_to_unpacked_bb(1, gr.GR_LSB_FIRST) self.tb.connect(src, op) - + dst = gr.vector_sink_b() self.tb.connect(op, dst) @@ -74,7 +74,7 @@ class test_packing(gr_unittest.TestCase): src = gr.vector_source_b(src_data,False) op = gr.packed_to_unpacked_bb(3, gr.GR_LSB_FIRST) self.tb.connect(src, op) - + dst = gr.vector_sink_b() self.tb.connect(op, dst) @@ -91,7 +91,7 @@ class test_packing(gr_unittest.TestCase): src = gr.vector_source_b(src_data,False) op = gr.packed_to_unpacked_bb(3, gr.GR_MSB_FIRST) self.tb.connect(src, op) - + dst = gr.vector_sink_b() self.tb.connect(op, dst) @@ -108,7 +108,7 @@ class test_packing(gr_unittest.TestCase): src = gr.vector_source_b(src_data,False) op = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST) self.tb.connect(src, op) - + dst = gr.vector_sink_b() self.tb.connect(op, dst) @@ -125,7 +125,7 @@ class test_packing(gr_unittest.TestCase): src = gr.vector_source_b(src_data,False) op = gr.unpacked_to_packed_bb(1, gr.GR_LSB_FIRST) self.tb.connect(src, op) - + dst = gr.vector_sink_b() self.tb.connect(op, dst) @@ -143,7 +143,7 @@ class test_packing(gr_unittest.TestCase): src = gr.vector_source_b(src_data,False) op = gr.unpacked_to_packed_bb(3, gr.GR_LSB_FIRST) self.tb.connect(src, op) - + dst = gr.vector_sink_b() self.tb.connect(op, dst) @@ -160,7 +160,7 @@ class test_packing(gr_unittest.TestCase): src = gr.vector_source_b(src_data,False) op = gr.unpacked_to_packed_bb(3, gr.GR_MSB_FIRST) self.tb.connect(src, op) - + dst = gr.vector_sink_b() self.tb.connect(op, dst) @@ -184,12 +184,12 @@ class test_packing(gr_unittest.TestCase): op1 = gr.packed_to_unpacked_bb(3, gr.GR_MSB_FIRST) op2 = gr.unpacked_to_packed_bb(3, gr.GR_MSB_FIRST) self.tb.connect(src, op1, op2) - + dst = gr.vector_sink_b() self.tb.connect(op2, dst) self.tb.run() - + self.assertEqual(expected_results[0:201], dst.data()) def test_010(self): @@ -233,10 +233,10 @@ class test_packing(gr_unittest.TestCase): self.tb.run() self.assertEqual(expected_results[0:201], dst.data()) - + # tests on shorts - + def test_100a(self): """ test short version @@ -318,7 +318,7 @@ class test_packing(gr_unittest.TestCase): self.assertEqual(expected_results, dst.data()) # tests on ints - + def test_200a(self): """ test int version @@ -402,4 +402,4 @@ class test_packing(gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_packing, "test_packing.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pipe_fittings.py b/gnuradio-core/src/python/gnuradio/gr/qa_pipe_fittings.py index a6683c5c3..1f24062b1 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_pipe_fittings.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_pipe_fittings.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2005,2007,2010 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, gr_unittest @@ -58,7 +58,7 @@ class test_pipe_fittings(gr_unittest.TestCase): src = gr.vector_source_i(src_data) op = gr.stream_to_streams(gr.sizeof_int, n) self.tb.connect(src, op) - + dsts = [] for i in range(n): dst = gr.vector_sink_i() @@ -83,15 +83,15 @@ class test_pipe_fittings(gr_unittest.TestCase): op1 = gr.stream_to_streams(gr.sizeof_int, n) op2 = gr.streams_to_stream(gr.sizeof_int, n) dst = gr.vector_sink_i() - + self.tb.connect(src, op1) for i in range(n): self.tb.connect((op1, i), (op2, i)) self.tb.connect(op2, dst) - + self.tb.run() self.assertEqual(expected_results, dst.data()) - + def test_003(self): """ Test streams_to_vector (using stream_to_streams & vector_to_stream). @@ -106,15 +106,15 @@ class test_pipe_fittings(gr_unittest.TestCase): op2 = gr.streams_to_vector(gr.sizeof_int, n) op3 = gr.vector_to_stream(gr.sizeof_int, n) dst = gr.vector_sink_i() - + self.tb.connect(src, op1) for i in range(n): self.tb.connect((op1, i), (op2, i)) self.tb.connect(op2, op3, dst) - + self.tb.run() self.assertEqual(expected_results, dst.data()) - + def test_004(self): """ Test vector_to_streams. @@ -129,15 +129,15 @@ class test_pipe_fittings(gr_unittest.TestCase): op2 = gr.vector_to_streams(gr.sizeof_int, n) op3 = gr.streams_to_stream(gr.sizeof_int, n) dst = gr.vector_sink_i() - + self.tb.connect(src, op1, op2) for i in range(n): self.tb.connect((op2, i), (op3, i)) self.tb.connect(op3, dst) - + self.tb.run() self.assertEqual(expected_results, dst.data()) if __name__ == '__main__': gr_unittest.run(test_pipe_fittings, "test_pipe_fittings.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py b/gnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py index 5977c1b52..8964db53d 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010,2011 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, gr_unittest import math diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py b/gnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py index 152026c35..219e9b84b 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010,2011 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, gr_unittest import math @@ -153,7 +153,7 @@ class test_pll_freqdet (gr_unittest.TestCase): # convert it from normalized frequency to absolute frequency (Hz) dst_data = [i*(sampling_freq/(2*math.pi)) for i in dst_data] - + self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 3) if __name__ == '__main__': diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py b/gnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py index 4d82ed692..f319f6381 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2010 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, gr_unittest import math diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pn_correlator_cc.py b/gnuradio-core/src/python/gnuradio/gr/qa_pn_correlator_cc.py index fbdabb4cb..6a62a6997 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_pn_correlator_cc.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_pn_correlator_cc.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2007,2010 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, gr_unittest @@ -45,6 +45,6 @@ class test_pn_correlator_cc(gr_unittest.TestCase): self.tb.run() data = dst.data() self.assertEqual(data[-1], (1.0+0j)) - + if __name__ == '__main__': gr_unittest.run(test_pn_correlator_cc, "test_pn_correlator_cc.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_probe_signal.py b/gnuradio-core/src/python/gnuradio/gr/qa_probe_signal.py index ed0756f5b..4e10afdb6 100644 --- a/gnuradio-core/src/python/gnuradio/gr/qa_probe_signal.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_probe_signal.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2012 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. -# +# import time @@ -33,7 +33,7 @@ class test_probe_signal (gr_unittest.TestCase): self.tb = None def test_001(self): - + value = 12.3 repeats = 100 src_data = [value] * repeats @@ -52,7 +52,7 @@ class test_probe_signal (gr_unittest.TestCase): repeats = 10 value = [0.5+i for i in range(0, vector_length)] src_data = value * repeats - + src = gr.vector_source_f(src_data) s2v = gr.stream_to_vector(gr.sizeof_float, vector_length) dst = gr.probe_signal_vf(vector_length) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_rational_resampler.py b/gnuradio-core/src/python/gnuradio/gr/qa_rational_resampler.py index 3bd6160df..cc963d757 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_rational_resampler.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_rational_resampler.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2005,2006,2007,2010 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, gr_unittest from gnuradio import blks2 @@ -71,7 +71,7 @@ def reference_interp_dec_filter(src_data, interp, decim, taps): result_data = dst.data() tb = None return result_data - + class test_rational_resampler (gr_unittest.TestCase): @@ -80,11 +80,11 @@ class test_rational_resampler (gr_unittest.TestCase): def tearDown(self): pass - + # # test the gr.rational_resampler_base primitives... # - + def test_000_1_to_1(self): taps = (-4, 5) src_data = (234, -4, 23, -56, 45, 98, -23, -7) @@ -100,7 +100,7 @@ class test_rational_resampler (gr_unittest.TestCase): tb.run() result_data = dst.data() self.assertEqual(expected_result, result_data) - + def test_001_interp(self): taps = [1, 10, 100, 1000, 10000] src_data = (0, 2, 3, 5, 7, 11, 13, 17) @@ -118,7 +118,7 @@ class test_rational_resampler (gr_unittest.TestCase): result_data = dst.data() self.assertEqual(expected_result, result_data) - def test_002_interp(self): + def test_002_interp(self): taps = random_floats(31) #src_data = random_floats(10000) # FIXME the 10k case fails! src_data = random_floats(1000) @@ -295,4 +295,4 @@ if __name__ == '__main__': pass # FIXME: Disabled, see ticket:210 # gr_unittest.run(test_rational_resampler, "test_rational_resampler.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py b/gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py index 32ecc3776..5aca03b77 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_regenerate.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2007,2010 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, gr_unittest import math @@ -33,7 +33,7 @@ class test_regenerate (gr_unittest.TestCase): def test_regen1 (self): tb = self.tb - + data = [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] @@ -52,12 +52,12 @@ class test_regenerate (gr_unittest.TestCase): tb.run () dst_data = dst.data () - + self.assertEqual (expected_result, dst_data) def test_regen2 (self): tb = self.tb - + data = 200*[0,] data[9] = 1 data[99] = 1 @@ -67,7 +67,7 @@ class test_regenerate (gr_unittest.TestCase): expected_result[19] = 1 expected_result[29] = 1 expected_result[39] = 1 - + expected_result[99] = 1 expected_result[109] = 1 expected_result[119] = 1 @@ -82,7 +82,7 @@ class test_regenerate (gr_unittest.TestCase): tb.run () dst_data = dst.data () - + self.assertEqual (tuple(expected_result), dst_data) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_repeat.py b/gnuradio-core/src/python/gnuradio/gr/qa_repeat.py index 2b1429980..116f37115 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_repeat.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_repeat.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2008,2010 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, gr_unittest import math @@ -36,13 +36,13 @@ class test_repeat (gr_unittest.TestCase): dst_data = [] for n in range(100): dst_data += [1.0*n, 1.0*n, 1.0*n] - + src = gr.vector_source_f(src_data) rpt = gr.repeat(gr.sizeof_float, 3) dst = gr.vector_sink_f() self.tb.connect(src, rpt, dst) self.tb.run() - self.assertFloatTuplesAlmostEqual(dst_data, dst.data(), 6) + self.assertFloatTuplesAlmostEqual(dst_data, dst.data(), 6) if __name__ == '__main__': gr_unittest.run(test_repeat, "test_repeat.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_scrambler.py b/gnuradio-core/src/python/gnuradio/gr/qa_scrambler.py index 241d8ec2a..5fe89bdc7 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_scrambler.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_scrambler.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2008,2010 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, gr_unittest @@ -34,7 +34,7 @@ class test_scrambler(gr_unittest.TestCase): src_data = (1,)*1000 src = gr.vector_source_b(src_data, False) scrambler = gr.scrambler_bb(0x8a, 0x7F, 7) # CCSDS 7-bit scrambler - descrambler = gr.descrambler_bb(0x8a, 0x7F, 7) + descrambler = gr.descrambler_bb(0x8a, 0x7F, 7) dst = gr.vector_sink_b() self.tb.connect(src, scrambler, descrambler, dst) self.tb.run() @@ -48,7 +48,7 @@ class test_scrambler(gr_unittest.TestCase): dst = gr.vector_sink_b() self.tb.connect(src, scrambler, descrambler, dst) self.tb.run() - self.assertEqual(src_data, dst.data()) + self.assertEqual(src_data, dst.data()) def test_additive_scrambler_reset(self): src_data = (1,)*1000 @@ -58,7 +58,7 @@ class test_scrambler(gr_unittest.TestCase): dst = gr.vector_sink_b() self.tb.connect(src, scrambler, descrambler, dst) self.tb.run() - self.assertEqual(src_data, dst.data()) + self.assertEqual(src_data, dst.data()) if __name__ == '__main__': gr_unittest.run(test_scrambler, "test_scrambler.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_short_to_char.py b/gnuradio-core/src/python/gnuradio/gr/qa_short_to_char.py index 6a95fa01d..490b149c7 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_short_to_char.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_short_to_char.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2011,2012 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, gr_unittest import ctypes diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_short_to_float.py b/gnuradio-core/src/python/gnuradio/gr/qa_short_to_float.py index 8f331b495..130f034ec 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_short_to_float.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_short_to_float.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2011,2012 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, gr_unittest import ctypes diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_sig_source.py b/gnuradio-core/src/python/gnuradio/gr/qa_sig_source.py index 4bb58038f..122b169b7 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_sig_source.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_sig_source.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2007,2010 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, gr_unittest import math @@ -42,7 +42,7 @@ class test_sig_source (gr_unittest.TestCase): tb.run () dst_data = dst1.data () self.assertEqual (expected_result, dst_data) - + def test_const_i (self): tb = self.tb expected_result = (1, 1, 1, 1) @@ -54,7 +54,7 @@ class test_sig_source (gr_unittest.TestCase): tb.run () dst_data = dst1.data () self.assertEqual (expected_result, dst_data) - + def test_sine_f (self): tb = self.tb sqrt2 = math.sqrt(2) / 2 @@ -80,7 +80,7 @@ class test_sig_source (gr_unittest.TestCase): tb.run () dst_data = dst1.data () self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 5) - + def test_sqr_c (self): tb = self.tb #arg6 is a bit before -PI/2 expected_result = (1j, 1j, 0, 0, 1, 1, 1+0j, 1+1j, 1j) @@ -92,7 +92,7 @@ class test_sig_source (gr_unittest.TestCase): tb.run () dst_data = dst1.data () self.assertEqual (expected_result, dst_data) - + def test_tri_c (self): tb = self.tb expected_result = (1+.5j, .75+.75j, .5+1j, .25+.75j, 0+.5j, .25+.25j, .5+0j, .75+.25j, 1+.5j) @@ -104,7 +104,7 @@ class test_sig_source (gr_unittest.TestCase): tb.run () dst_data = dst1.data () self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5) - + def test_saw_c (self): tb = self.tb expected_result = (.5+.25j, .625+.375j, .75+.5j, .875+.625j, 0+.75j, .125+.875j, .25+1j, .375+.125j, .5+.25j) @@ -116,7 +116,7 @@ class test_sig_source (gr_unittest.TestCase): tb.run () dst_data = dst1.data () self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5) - + def test_sqr_f (self): tb = self.tb expected_result = (0, 0, 0, 0, 1, 1, 1, 1, 0) @@ -128,7 +128,7 @@ class test_sig_source (gr_unittest.TestCase): tb.run () dst_data = dst1.data () self.assertEqual (expected_result, dst_data) - + def test_tri_f (self): tb = self.tb expected_result = (1, .75, .5, .25, 0, .25, .5, .75, 1) @@ -140,7 +140,7 @@ class test_sig_source (gr_unittest.TestCase): tb.run () dst_data = dst1.data () self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 5) - + def test_saw_f (self): tb = self.tb expected_result = (.5, .625, .75, .875, 0, .125, .25, .375, .5) diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_single_pole_iir.py b/gnuradio-core/src/python/gnuradio/gr/qa_single_pole_iir.py index 1d2e6595c..bfe2d8fc8 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_single_pole_iir.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_single_pole_iir.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2005,2007,2010 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, gr_unittest @@ -69,4 +69,4 @@ class test_single_pole_iir(gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_single_pole_iir, "test_single_pole_iir.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_single_pole_iir_cc.py b/gnuradio-core/src/python/gnuradio/gr/qa_single_pole_iir_cc.py index 47b4948ba..353df1bc0 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_single_pole_iir_cc.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_single_pole_iir_cc.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2005,2006,2007,2010 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, gr_unittest @@ -69,4 +69,4 @@ class test_single_pole_iir_cc(gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_single_pole_iir_cc, "test_single_pole_iir_cc.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_skiphead.py b/gnuradio-core/src/python/gnuradio/gr/qa_skiphead.py index de2d8fc95..1e730398c 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_skiphead.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_skiphead.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2007,2010 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, gr_unittest @@ -41,7 +41,7 @@ class test_skiphead (gr_unittest.TestCase): self.tb.run () dst_data = dst1.data () self.assertEqual (expected_result, dst_data) - + def test_skip_1(self): skip_cnt = 1 expected_result = tuple(self.src_data[skip_cnt:]) @@ -52,7 +52,7 @@ class test_skiphead (gr_unittest.TestCase): self.tb.run () dst_data = dst1.data () self.assertEqual (expected_result, dst_data) - + def test_skip_1023(self): skip_cnt = 1023 expected_result = tuple(self.src_data[skip_cnt:]) @@ -63,7 +63,7 @@ class test_skiphead (gr_unittest.TestCase): self.tb.run () dst_data = dst1.data () self.assertEqual (expected_result, dst_data) - + def test_skip_6339(self): skip_cnt = 6339 expected_result = tuple(self.src_data[skip_cnt:]) @@ -74,7 +74,7 @@ class test_skiphead (gr_unittest.TestCase): self.tb.run () dst_data = dst1.data () self.assertEqual (expected_result, dst_data) - + def test_skip_12678(self): skip_cnt = 12678 expected_result = tuple(self.src_data[skip_cnt:]) @@ -96,7 +96,7 @@ class test_skiphead (gr_unittest.TestCase): self.tb.run () dst_data = dst1.data () self.assertEqual (expected_result, dst_data) - + if __name__ == '__main__': gr_unittest.run(test_skiphead, "test_skiphead.xml") diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_stream_mux.py b/gnuradio-core/src/python/gnuradio/gr/qa_stream_mux.py index 7d6ddf81b..779d0b25e 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_stream_mux.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_stream_mux.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2005,2007,2010 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, gr_unittest @@ -33,7 +33,7 @@ class test_stream_mux (gr_unittest.TestCase): def help_stream_2ff(self, N, stream_sizes): v0 = gr.vector_source_f(N*[1,], False) v1 = gr.vector_source_f(N*[2,], False) - + mux = gr.stream_mux(gr.sizeof_float, stream_sizes) dst = gr.vector_sink_f () @@ -44,7 +44,7 @@ class test_stream_mux (gr_unittest.TestCase): self.tb.run () return dst.data () - + def help_stream_ramp_2ff(self, N, stream_sizes): r1 = range(N) r2 = range(N) @@ -52,7 +52,7 @@ class test_stream_mux (gr_unittest.TestCase): v0 = gr.vector_source_f(r1, False) v1 = gr.vector_source_f(r2, False) - + mux = gr.stream_mux(gr.sizeof_float, stream_sizes) dst = gr.vector_sink_f () @@ -63,7 +63,7 @@ class test_stream_mux (gr_unittest.TestCase): self.tb.run () return dst.data () - + def test_stream_2NN_ff(self): N = 40 stream_sizes = [10, 10] @@ -101,17 +101,17 @@ class test_stream_mux (gr_unittest.TestCase): result_data = self.help_stream_2ff(N, stream_sizes) - exp_data = (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + exp_data = (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0) - + self.assertEqual (exp_data, result_data) @@ -122,13 +122,13 @@ class test_stream_mux (gr_unittest.TestCase): result_data = self.help_stream_2ff(N, stream_sizes) - exp_data = (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + exp_data = (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0) @@ -142,12 +142,12 @@ class test_stream_mux (gr_unittest.TestCase): result_data = self.help_stream_2ff(N, stream_sizes) - exp_data = (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + exp_data = (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0) - + self.assertEqual (exp_data, result_data) def test_stream_20N_ff(self): @@ -157,11 +157,11 @@ class test_stream_mux (gr_unittest.TestCase): result_data = self.help_stream_2ff(N, stream_sizes) - exp_data = (2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, + exp_data = (2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0) - + self.assertEqual (exp_data, result_data) if __name__ == '__main__': diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_udp_sink_source.py b/gnuradio-core/src/python/gnuradio/gr/qa_udp_sink_source.py index 097e394c9..0a719990e 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_udp_sink_source.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_udp_sink_source.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2008,2010 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, gr_unittest from threading import Timer @@ -32,7 +32,7 @@ class test_udp_sink_source(gr_unittest.TestCase): def tearDown(self): self.tb_rcv = None self.tb_snd = None - + def test_001(self): port = 65500 @@ -59,7 +59,7 @@ class test_udp_sink_source(gr_unittest.TestCase): result_data = dst.data() self.assertEqual(expected_result, result_data) self.assert_(not self.timeout) - + def test_002(self): udp_rcv = gr.udp_source( gr.sizeof_float, '0.0.0.0', 0, eof=False ) rcv_port = udp_rcv.get_port() @@ -93,7 +93,7 @@ class test_udp_sink_source(gr_unittest.TestCase): self.timeout = True self.tb_rcv.stop() #print "tb_rcv stopped by Timer" - + if __name__ == '__main__': gr_unittest.run(test_udp_sink_source, "test_udp_sink_source.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_unpack_k_bits.py b/gnuradio-core/src/python/gnuradio/gr/qa_unpack_k_bits.py index d1faf9d9e..bb4e7733d 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_unpack_k_bits.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_unpack_k_bits.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2006,2010 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, gr_unittest import random @@ -54,4 +54,4 @@ class test_unpack(gr_unittest.TestCase): if __name__ == '__main__': gr_unittest.run(test_unpack, "test_unpack.xml") - + diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_vector_sink_source.py b/gnuradio-core/src/python/gnuradio/gr/qa_vector_sink_source.py index 5d8d85c7c..64cbbe72a 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_vector_sink_source.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_vector_sink_source.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2008,2010 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, gr_unittest import math diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_wavefile.py b/gnuradio-core/src/python/gnuradio/gr/qa_wavefile.py index d9f38e3f1..3b9a3eb20 100755 --- a/gnuradio-core/src/python/gnuradio/gr/qa_wavefile.py +++ b/gnuradio-core/src/python/gnuradio/gr/qa_wavefile.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2008,2010 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, gr_unittest @@ -61,7 +61,7 @@ class test_wavefile(gr_unittest.TestCase): out_data = out_f.read() out_f.close() os.remove(outfile) - + self.assertEqual(in_data, out_data) diff --git a/gnuradio-core/src/python/gnuradio/gr/run_tests.in b/gnuradio-core/src/python/gnuradio/gr/run_tests.in deleted file mode 100755 index 107efe728..000000000 --- a/gnuradio-core/src/python/gnuradio/gr/run_tests.in +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# 1st parameter is absolute path to component source directory -# 2nd parameter is absolute path to component build directory -# 3rd parameter is path to Python QA directory - -# Note: calling master run_tests.sh in gnuradio core is not strictly -# correct, as it will result in a partially bogus PYTHONPATH, but it -# does make the correct paths in the second half so all is well. - -@top_builddir@/run_tests.sh \ - @abs_top_srcdir@/gnuradio-core \ - @abs_top_builddir@/gnuradio-core \ - @srcdir@ diff --git a/gnuradio-core/src/python/gnuradio/gr/top_block.py b/gnuradio-core/src/python/gnuradio/gr/top_block.py index f2d83893c..43af8073b 100644 --- a/gnuradio-core/src/python/gnuradio/gr/top_block.py +++ b/gnuradio-core/src/python/gnuradio/gr/top_block.py @@ -1,23 +1,23 @@ # # Copyright 2007 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_core import top_block_swig, \ top_block_wait_unlocked, top_block_run_unlocked @@ -95,7 +95,7 @@ class top_block(object): def start(self, max_noutput_items=100000): self._tb.start(max_noutput_items) - + def stop(self): self._tb.stop() diff --git a/gnuradio-core/src/python/gnuradio/gr_unittest.py b/gnuradio-core/src/python/gnuradio/gr_unittest.py index c2c4df2ba..e4510a6eb 100755 --- a/gnuradio-core/src/python/gnuradio/gr_unittest.py +++ b/gnuradio-core/src/python/gnuradio/gr_unittest.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004,2010 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. -# +# import unittest import gr_xmlrunner @@ -45,7 +45,7 @@ class TestCase(unittest.TestCase): if round(second.imag-first.imag, places) != 0: raise self.failureException, \ (msg or '%s != %s within %s places' % (`first`, `second`, `places` )) - + def assertComplexAlmostEqual2 (self, ref, x, abs_eps=1e-12, rel_eps=1e-6, msg=None): """ Fail if the two complex objects are unequal as determined by... @@ -64,7 +64,7 @@ class TestCase(unittest.TestCase): `ref`, `x`, abs(ref-x)/abs(ref), `rel_eps` )) - + def assertComplexTuplesAlmostEqual (self, a, b, places=7, msg=None): self.assertEqual (len(a), len(b)) for i in xrange (len(a)): @@ -108,7 +108,7 @@ TestProgram = unittest.TestProgram main = TestProgram def run(PUT, filename=None): - ''' + ''' Runs the unittest on a TestCase and produces an optional XML report PUT: the program under test and should be a gr_unittest.TestCase filename: an optional filename to save the XML report of the tests @@ -149,7 +149,7 @@ def run(PUT, filename=None): xmlrunner.run(suite) main() - + # This will run and fail make check if problem # but does not output to screen. #main(testRunner = xmlrunner) diff --git a/gnuradio-core/src/python/gnuradio/gr_xmlrunner.py b/gnuradio-core/src/python/gnuradio/gr_xmlrunner.py index c3dc5cf13..31298197f 100644 --- a/gnuradio-core/src/python/gnuradio/gr_xmlrunner.py +++ b/gnuradio-core/src/python/gnuradio/gr_xmlrunner.py @@ -25,9 +25,9 @@ except ImportError: class _TestInfo(object): """Information about a particular test. - + Used by _XMLTestResult. - + """ def __init__(self, test, time): @@ -132,7 +132,7 @@ class _XMLTestResult(unittest.TestResult): def print_report(self, stream, time_taken, out, err): """Prints the XML report to the supplied stream. - + The time the tests took to perform as well as the captured standard output and standard error streams must be passed in.a @@ -210,7 +210,7 @@ class XMLTestRunner(object): path = property(lambda self: self._path, _set_path, None, """The path where the XML files are stored. - + This property is ignored when the XML file is written to a file stream.""") @@ -262,7 +262,7 @@ class XMLTestRunnerTest(unittest.TestCase): def test_no_tests(self): """Regression test: Check whether a test run without any tests matches a previous run. - + """ class TestTest(unittest.TestCase): pass @@ -275,7 +275,7 @@ class XMLTestRunnerTest(unittest.TestCase): def test_success(self): """Regression test: Check whether a test run with a successful test matches a previous run. - + """ class TestTest(unittest.TestCase): def test_foo(self): @@ -290,7 +290,7 @@ class XMLTestRunnerTest(unittest.TestCase): def test_failure(self): """Regression test: Check whether a test run with a failing test matches a previous run. - + """ class TestTest(unittest.TestCase): def test_foo(self): @@ -307,7 +307,7 @@ class XMLTestRunnerTest(unittest.TestCase): def test_error(self): """Regression test: Check whether a test run with a erroneous test matches a previous run. - + """ class TestTest(unittest.TestCase): def test_foo(self): @@ -324,7 +324,7 @@ class XMLTestRunnerTest(unittest.TestCase): def test_stdout_capture(self): """Regression test: Check whether a test run with output to stdout matches a previous run. - + """ class TestTest(unittest.TestCase): def test_foo(self): @@ -340,7 +340,7 @@ class XMLTestRunnerTest(unittest.TestCase): def test_stderr_capture(self): """Regression test: Check whether a test run with output to stderr matches a previous run. - + """ class TestTest(unittest.TestCase): def test_foo(self): diff --git a/gnuradio-core/src/python/gnuradio/gru/.gitignore b/gnuradio-core/src/python/gnuradio/gru/.gitignore deleted file mode 100644 index f9c5da0db..000000000 --- a/gnuradio-core/src/python/gnuradio/gru/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/Makefile -/Makefile.in -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo diff --git a/gnuradio-core/src/python/gnuradio/gru/Makefile.am b/gnuradio-core/src/python/gnuradio/gru/Makefile.am deleted file mode 100644 index 9b311d81f..000000000 --- a/gnuradio-core/src/python/gnuradio/gru/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright 2005,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. -# - -include $(top_srcdir)/Makefile.common - -# EXTRA_DIST = run_tests.in -# TESTS = run_tests - -grblkspythondir = $(grpythondir)/gru - -grblkspython_PYTHON = \ - __init__.py diff --git a/gnuradio-core/src/python/gnuradio/gru/__init__.py b/gnuradio-core/src/python/gnuradio/gru/__init__.py index 8fcdf83ed..c24439ff5 100644 --- a/gnuradio-core/src/python/gnuradio/gru/__init__.py +++ b/gnuradio-core/src/python/gnuradio/gru/__init__.py @@ -1,29 +1,29 @@ # # Copyright 2005 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. -# +# import glob import os.path # Semi-hideous kludge to import everything in the gruimpl directory -# into the gnuradio.gru namespace. This keeps us from having to remember +# into the gnuradio.gru namespace. This keeps us from having to remember # to manually update this file. for p in __path__: diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/.gitignore b/gnuradio-core/src/python/gnuradio/gruimpl/.gitignore deleted file mode 100644 index f9c5da0db..000000000 --- a/gnuradio-core/src/python/gnuradio/gruimpl/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/Makefile -/Makefile.in -/.deps -/.libs -/*.la -/*.lo -/*.pyc -/*.pyo diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/Makefile.am b/gnuradio-core/src/python/gnuradio/gruimpl/Makefile.am deleted file mode 100644 index 903bc2695..000000000 --- a/gnuradio-core/src/python/gnuradio/gruimpl/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright 2005,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. -# - -include $(top_srcdir)/Makefile.common - -grupythondir = $(grpythondir)/gruimpl - -grupython_PYTHON = \ - __init__.py \ - freqz.py \ - gnuplot_freqz.py \ - hexint.py \ - listmisc.py \ - mathmisc.py \ - lmx2306.py \ - msgq_runner.py \ - os_read_exactly.py \ - sdr_1000.py \ - seq_with_cursor.py \ - socket_stuff.py \ - daemon.py diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/daemon.py b/gnuradio-core/src/python/gnuradio/gruimpl/daemon.py index 4fa972ad2..e04702152 100644 --- a/gnuradio-core/src/python/gnuradio/gruimpl/daemon.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/daemon.py @@ -1,23 +1,23 @@ # # Copyright 2008 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. -# +# import os, sys, signal # Turn application into a background daemon process. @@ -62,7 +62,7 @@ def daemonize(pidfile=None, logfile=None): if pid == 0: # First child of first fork() # Become session leader of new session os.setsid() - + # fork() into background again try: pid = os.fork() @@ -74,14 +74,14 @@ def daemonize(pidfile=None, logfile=None): else: # Second child of first fork() os._exit(0) - + os.umask(0111) # Write pid pid = os.getpid() if pidfile is not None: open(pidfile, 'w').write('%d\n'%pid) - + # Redirect streams if logfile is not None: lf = open(logfile, 'a+') diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/freqz.py b/gnuradio-core/src/python/gnuradio/gruimpl/freqz.py index 46696a50e..60dca64a5 100644 --- a/gnuradio-core/src/python/gnuradio/gruimpl/freqz.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/freqz.py @@ -1,34 +1,34 @@ #!/usr/bin/env python # # Copyright 2005,2007 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. -# +# # This code lifted from various parts of www.scipy.org -eb 2005-01-24 # Copyright (c) 2001, 2002 Enthought, Inc. -# +# # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: -# +# # a. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # b. Redistributions in binary form must reproduce the above copyright @@ -37,8 +37,8 @@ # c. Neither the name of the Enthought nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. -# -# +# +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -50,7 +50,7 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH # DAMAGE. -# +# __all__ = ['freqz'] @@ -62,7 +62,7 @@ def atleast_1d(*arys): """ Force a sequence of arrays to each be at least 1D. Description: - Force an array to be at least 1D. If an array is 0D, the + Force an array to be at least 1D. If an array is 0D, the array is converted to a single row of values. Otherwise, the array is unaltered. Arguments: @@ -73,7 +73,7 @@ def atleast_1d(*arys): res = [] for ary in arys: ary = asarray(ary) - if len(ary.shape) == 0: + if len(ary.shape) == 0: result = numpy.array([ary[0]]) else: result = ary @@ -147,7 +147,7 @@ class poly1d: def __coerce__(self,other): return None - + def __repr__(self): vals = repr(self.coeffs) vals = vals[6:-1] @@ -177,14 +177,14 @@ class poly1d: newstr = '' elif coefstr == '1': newstr = 'x' - else: + else: newstr = '%s x' % (coefstr,) else: if coefstr == '0': newstr = '' elif coefstr == '1': newstr = 'x**%d' % (power,) - else: + else: newstr = '%s x**%d' % (coefstr, power) if k > 0: @@ -198,7 +198,7 @@ class poly1d: else: thestr = newstr return _raise_power(thestr) - + def __call__(self, val): return polyval(self.coeffs, val) @@ -215,12 +215,12 @@ class poly1d: return poly1d(other * self.coeffs) else: other = poly1d(other) - return poly1d(polymul(self.coeffs, other.coeffs)) - + return poly1d(polymul(self.coeffs, other.coeffs)) + def __add__(self, other): other = poly1d(other) - return poly1d(polyadd(self.coeffs, other.coeffs)) - + return poly1d(polyadd(self.coeffs, other.coeffs)) + def __radd__(self, other): other = poly1d(other) return poly1d(polyadd(self.coeffs, other.coeffs)) @@ -267,7 +267,7 @@ class poly1d: return self.order else: return self.__dict__[key] - + def __getitem__(self, val): ind = self.order - val if val > self.order: @@ -306,7 +306,7 @@ def freqz(b, a, worN=None, whole=0, plot=None): jw B(e) b[0] + b[1]e + .... + b[m]e H(e) = ---- = ------------------------------------ jw -jw -jnw - A(e) a[0] + a[2]e + .... + a[n]e + A(e) a[0] + a[2]e + .... + a[n]e Inputs: diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/gnuplot_freqz.py b/gnuradio-core/src/python/gnuradio/gruimpl/gnuplot_freqz.py index 2c2a06847..defc47b59 100755 --- a/gnuradio-core/src/python/gnuradio/gruimpl/gnuplot_freqz.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/gnuplot_freqz.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2005,2007 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. -# +# __all__ = ['gnuplot_freqz'] @@ -40,14 +40,14 @@ def gnuplot_freqz (hw, Fs=None, logfreq=False): Returns a handle to the gnuplot graph. When the handle is reclaimed the graph is torn down.""" - + data_file = tempfile.NamedTemporaryFile () cmd_file = os.popen ('gnuplot', 'w') h, w = hw ampl = 20 * numpy.log10 (numpy.absolute (h) + 1e-9) phase = map (lambda x: math.atan2 (x.imag, x.real), h) - + if Fs: w *= (Fs/(2*math.pi)) @@ -63,7 +63,7 @@ def gnuplot_freqz (hw, Fs=None, logfreq=False): cmd_file.write ("unset logscale x\n") cmd_file.write ("plot '%s' using 1:2 with lines\n" % (data_file.name,)) cmd_file.flush () - + return (cmd_file, data_file) diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/hexint.py b/gnuradio-core/src/python/gnuradio/gruimpl/hexint.py index f2808c448..0fb5ecde0 100644 --- a/gnuradio-core/src/python/gnuradio/gruimpl/hexint.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/hexint.py @@ -1,23 +1,23 @@ # # Copyright 2005 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. -# +# def hexint(mask): """ diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/listmisc.py b/gnuradio-core/src/python/gnuradio/gruimpl/listmisc.py index 953bf90b1..9e70eb863 100644 --- a/gnuradio-core/src/python/gnuradio/gruimpl/listmisc.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/listmisc.py @@ -1,23 +1,23 @@ # # Copyright 2005 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. -# +# def list_reverse(x): """ diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/lmx2306.py b/gnuradio-core/src/python/gnuradio/gruimpl/lmx2306.py index 1a7741814..aa4efc3e9 100755 --- a/gnuradio-core/src/python/gnuradio/gruimpl/lmx2306.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/lmx2306.py @@ -1,24 +1,24 @@ #!/usr/bin/env python # # Copyright 2004 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. -# +# '''Control National LMX2306 based frequency synthesizer''' @@ -78,7 +78,7 @@ class lmx2306 (object): self._set_fosc (fosc) self._set_step (step_size) - + def program (self, r, a, b): if self.verbose: print "lmx2306: r = %d a = %d b = %d" % (r, a, b) @@ -102,10 +102,10 @@ class lmx2306 (object): return actual # ---------------------------------------------------------------- - + def _set_fosc (self, ref_oscillator_freq): self.fosc = ref_oscillator_freq - + def _set_step (self, step_size): r = int (self.fosc / step_size) if r * step_size != self.fosc: @@ -114,7 +114,7 @@ class lmx2306 (object): raise ValueError, "r is out of range" self.r = r self.step_size = step_size - + def _compute_ab (self, divisor): b = divisor / 8 a = divisor - (b * 8) @@ -174,7 +174,7 @@ if __name__ == '__main__': eng_notation.num_to_str (options.fosc), eng_notation.num_to_str (options.step_size), eng_notation.num_to_str (options.freq)) - + lmx = lmx2306 (options.fosc, options.step_size) lmx.verbose = options.verbose diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/mathmisc.py b/gnuradio-core/src/python/gnuradio/gruimpl/mathmisc.py index 77f2e03b5..7e6f23a34 100644 --- a/gnuradio-core/src/python/gnuradio/gruimpl/mathmisc.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/mathmisc.py @@ -1,23 +1,23 @@ # # Copyright 2005 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. -# +# import math diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/os_read_exactly.py b/gnuradio-core/src/python/gnuradio/gruimpl/os_read_exactly.py index 0d999dd02..40b053770 100644 --- a/gnuradio-core/src/python/gnuradio/gruimpl/os_read_exactly.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/os_read_exactly.py @@ -1,23 +1,23 @@ # # Copyright 2005 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. -# +# import os diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/sdr_1000.py b/gnuradio-core/src/python/gnuradio/gruimpl/sdr_1000.py index 8296831b1..5192a7155 100644 --- a/gnuradio-core/src/python/gnuradio/gruimpl/sdr_1000.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/sdr_1000.py @@ -1,23 +1,23 @@ # # Copyright 2003,2004 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 @@ -33,7 +33,7 @@ class sdr_1000 (gr.sdr_1000_base): self.write_latch (2, data, 0xff) self.write_latch (3, 0x40, 0x40) self.write_latch (3, 0x00, 0x40) - + def set_freq(self, freq): self.set_band (freq) ftw = freq / 200e6; @@ -56,23 +56,23 @@ class sdr_1000 (gr.sdr_1000_base): band = 4 else: band = 5 - + self.write_latch (1, 1 << band, 0x3f) def set_bit (self, reg, bit, state): val = 0x00 if state: val = 1<<bit self.write_latch (reg, val, 1<<bit) - + def set_tx (self, on = 1): self.set_bit(1, 6, on) def set_rx (self): self.set_bit(1, 6, 0) - + def set_gain (self, high): self.set_bit(0, 7, high) - + def set_mute (self, mute = 1): self.set_bit(1, 7, mute) diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/seq_with_cursor.py b/gnuradio-core/src/python/gnuradio/gruimpl/seq_with_cursor.py index 7416423bf..def3299b6 100644 --- a/gnuradio-core/src/python/gnuradio/gruimpl/seq_with_cursor.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/seq_with_cursor.py @@ -1,23 +1,23 @@ # # Copyright 2003,2004 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. -# +# # misc utilities @@ -41,7 +41,7 @@ class seq_with_cursor (object): self.index = initial_index else: raise exceptions.ValueError - + def set_index_by_value(self, v): """ Set index to the smallest value such that items[index] >= v. @@ -52,7 +52,7 @@ class seq_with_cursor (object): more = True while cv < v and more: cv, more = self.next() # side effect! - + def next (self): new_index = self.index + 1 if new_index < len (self.items): @@ -74,4 +74,4 @@ class seq_with_cursor (object): def get_seq (self): return self.items[:] # copy of items - + diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/socket_stuff.py b/gnuradio-core/src/python/gnuradio/gruimpl/socket_stuff.py index cc2381d2e..329fd2ed3 100644 --- a/gnuradio-core/src/python/gnuradio/gruimpl/socket_stuff.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/socket_stuff.py @@ -1,23 +1,23 @@ # # Copyright 2005 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. -# +# # random socket related stuff diff --git a/gnuradio-core/src/python/gnuradio/optfir.py b/gnuradio-core/src/python/gnuradio/optfir.py index aee1d2a0c..bbf9ead74 100644 --- a/gnuradio-core/src/python/gnuradio/optfir.py +++ b/gnuradio-core/src/python/gnuradio/optfir.py @@ -1,23 +1,23 @@ # # Copyright 2004,2005,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. -# +# ''' Routines for designing optimal FIR filters. @@ -150,7 +150,7 @@ def high_pass (gain, Fs, freq1, freq2, passband_ripple_db, stopband_atten_db, # In gr.remez, ntaps = n+1, so n must be even if((n+nextra_taps)%2 == 1): n += 1 - + # The remezord typically under-estimates the filter order, so add 2 taps by default taps = gr.remez (n + nextra_taps, fo, ao, w, "bandpass") return taps @@ -210,7 +210,7 @@ def remezord (fcuts, mags, devs, fsamp = 2): fcuts = fcuts[:] mags = mags[:] devs = devs[:] - + for i in range (len (fcuts)): fcuts[i] = float (fcuts[i]) / fsamp @@ -224,11 +224,11 @@ def remezord (fcuts, mags, devs, fsamp = 2): if nf != 2 * (nbands - 1): raise ValueError, "Length of f must be 2 * len (mags) - 2" - + for i in range (len (mags)): if mags[i] != 0: # if not stopband, get relative deviation devs[i] = devs[i] / mags[i] - + # separate the passband and stopband edges f1 = fcuts[0::2] f2 = fcuts[1::2] @@ -254,7 +254,7 @@ def remezord (fcuts, mags, devs, fsamp = 2): l = max (l, l1, l2) n = int (math.ceil (l)) - 1 # need order, not length for remez - + # cook up remez compatible result ff = [0] + fcuts + [1] for i in range (1, len (ff) - 1): diff --git a/gnuradio-core/src/python/gnuradio/vocoder/.gitignore b/gnuradio-core/src/python/gnuradio/vocoder/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/gnuradio-core/src/python/gnuradio/vocoder/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/gnuradio-core/src/python/gnuradio/window.py b/gnuradio-core/src/python/gnuradio/window.py index e109a9892..4a1d0c516 100644 --- a/gnuradio-core/src/python/gnuradio/window.py +++ b/gnuradio-core/src/python/gnuradio/window.py @@ -1,23 +1,23 @@ # # Copyright 2004,2005,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. -# +# ''' Routines for designing window functions. @@ -54,7 +54,7 @@ def rate(fft_size): def expn(fft_size): math.log(2.0)/(midn(fft_size) + 1.0) - + def hamming(fft_size): window = [] for index in xrange(fft_size): @@ -93,7 +93,7 @@ def bartlett(fft_size): angle += freq j -= 1 return window - + def blackman2(fft_size): mfrq = freq(fft_size) angle = 0 @@ -105,7 +105,7 @@ def blackman2(fft_size): angle += freq j -= 1 return window - + def blackman3(fft_size): mfrq = freq(fft_size) angle = 0 @@ -117,7 +117,7 @@ def blackman3(fft_size): angle += freq j -= 1 return window - + def blackman4(fft_size): mfrq = freq(fft_size) angle = 0 @@ -129,7 +129,7 @@ def blackman4(fft_size): angle += freq j -= 1 return window - + def exponential(fft_size): expsum = 1.0 window = [0 for i in range(fft_size)] |