diff options
author | Tom Rondeau <trondeau@vt.edu> | 2012-04-13 18:36:53 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2012-04-13 18:36:53 -0400 |
commit | f919f9dcbb54a08e6e26d6c229ce92fb784fa1b2 (patch) | |
tree | 7e846386b9eb1676f9a93fc4a1e55916b9accc97 /gnuradio-core/src/python/gnuradio/blks2impl | |
parent | 6a1e9783fec6ed827f49db27c171591d30f32933 (diff) |
Removed whitespace and added dtools/bin/remove-whitespace as a tool to do this in the future.
The sed script was provided by Moritz Fischer.
Diffstat (limited to 'gnuradio-core/src/python/gnuradio/blks2impl')
17 files changed, 173 insertions, 174 deletions
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/am_demod.py b/gnuradio-core/src/python/gnuradio/blks2impl/am_demod.py index b454f0942d..68d024565a 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 57487dff22..e5cd471df5 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 f214da4a96..08f1d450ba 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 55870513aa..6bc0d7ed0d 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 fd19f5fd99..fc3f2d60d2 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 dcdd460b55..8bcb47ae19 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 15818c2043..839cf6784a 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 3aadf700b6..e83c327fc8 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 dea71b2869..4bbe1bec6c 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 @@ -69,5 +69,5 @@ class pfb_channelizer_ccf(gr.hier_block2): def set_channel_map(self, newmap): self.pfb.set_channel_map(newmap) - - + + diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py index 2e36e7bc1d..adcdfe9ba1 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 a6094f7f45..5492dfcac6 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 b7de0de7cf..eea12af958 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 c5fdc01dbc..bd7fb535ae 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 3bdb22cce9..d1cbcf9127 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 14eaa1606a..e229bcc2e6 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 a2c1b36514..d4ce6d2231 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 c7c831ca16..3fcf98f891 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) |