diff options
Diffstat (limited to 'gr-noaa')
43 files changed, 83 insertions, 1826 deletions
diff --git a/gr-noaa/.gitignore b/gr-noaa/.gitignore deleted file mode 100644 index 2f7735b5e..000000000 --- a/gr-noaa/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -Makefile.in -*.pc diff --git a/gr-noaa/CMakeLists.txt b/gr-noaa/CMakeLists.txt index a3a5d56db..09ce2a329 100644 --- a/gr-noaa/CMakeLists.txt +++ b/gr-noaa/CMakeLists.txt @@ -1,17 +1,17 @@ # 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, @@ -35,6 +35,8 @@ GR_SET_GLOBAL(GR_NOAA_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/lib ) +SET(GR_PKG_NOAA_EXAMPLES_DIR ${GR_PKG_DATA_DIR}/examples/noaa) + ######################################################################## # Begin conditional configuration ######################################################################## @@ -81,7 +83,7 @@ add_subdirectory(lib) if(ENABLE_PYTHON) add_subdirectory(swig) add_subdirectory(grc) - add_subdirectory(apps) + add_subdirectory(examples) endif(ENABLE_PYTHON) ######################################################################## diff --git a/gr-noaa/Makefile.am b/gr-noaa/Makefile.am deleted file mode 100644 index ce5f66109..000000000 --- a/gr-noaa/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# -# 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. -# - -include $(top_srcdir)/Makefile.common - -SUBDIRS = lib grc oct - -if PYTHON -SUBDIRS += swig python apps -endif - -pkgconfigdir = $(libdir)/pkgconfig -dist_pkgconfig_DATA = gnuradio-noaa.pc diff --git a/gr-noaa/apps/.gitignore b/gr-noaa/apps/.gitignore deleted file mode 100644 index be02dd265..000000000 --- a/gr-noaa/apps/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.dat -#*.txt -*.hrpt diff --git a/gr-noaa/apps/Makefile.am b/gr-noaa/apps/Makefile.am deleted file mode 100644 index c60c8c137..000000000 --- a/gr-noaa/apps/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -# -# 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. -# - -include $(top_srcdir)/Makefile.common - -if PYTHON - -dist_bin_SCRIPTS = \ - hrpt_decode.py \ - hrpt_demod.py \ - file_rx_hrpt.py \ - usrp_rx_hrpt.py \ - usrp_rx_hrpt_nogui.py - -EXTRA_DIST += \ - hrpt_decode.grc \ - hrpt_demod.grc \ - file_rx_hrpt.grc \ - usrp_rx_hrpt.grc \ - usrp_rx_hrpt_nogui.grc -endif diff --git a/gr-noaa/apps/file_rx_hrpt.py b/gr-noaa/apps/file_rx_hrpt.py deleted file mode 100755 index fcd1832f6..000000000 --- a/gr-noaa/apps/file_rx_hrpt.py +++ /dev/null @@ -1,239 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: USRP HRPT Receiver -# Generated: Thu Oct 27 13:48:25 2011 -################################################## - -from gnuradio import digital -from gnuradio import eng_notation -from gnuradio import gr -from gnuradio import noaa -from gnuradio.eng_option import eng_option -from gnuradio.gr import firdes -from optparse import OptionParser -import ConfigParser -import math, os - -class file_rx_hrpt(gr.top_block): - - def __init__(self): - gr.top_block.__init__(self, "USRP HRPT Receiver") - - ################################################## - # Variables - ################################################## - self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 4e6 - self.sps = sps = sample_rate/sym_rate - self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf' - self._pll_alpha_config = ConfigParser.ConfigParser() - self._pll_alpha_config.read(config_filename) - try: pll_alpha = self._pll_alpha_config.getfloat('usrp_rx_hrpt', 'pll_alpha') - except: pll_alpha = 0.01 - self.pll_alpha = pll_alpha - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(config_filename) - try: output_filename = self._output_filename_config.get('usrp_rx_hrpt', 'filename') - except: output_filename = 'frames.hrpt' - self.output_filename = output_filename - self.max_clock_offset = max_clock_offset = 100e-6 - self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate - self.hs = hs = int(sps/2.0) - self._gain_config = ConfigParser.ConfigParser() - self._gain_config.read(config_filename) - try: gain = self._gain_config.getfloat('usrp_rx_hrpt', 'gain') - except: gain = 35 - self.gain = gain - self._freq_config = ConfigParser.ConfigParser() - self._freq_config.read(config_filename) - try: freq = self._freq_config.getfloat('usrp_rx_hrpt', 'freq') - except: freq = 1698e6 - self.freq = freq - self._clock_alpha_config = ConfigParser.ConfigParser() - self._clock_alpha_config.read(config_filename) - try: clock_alpha = self._clock_alpha_config.getfloat('usrp_rx_hrpt', 'clock_alpha') - except: clock_alpha = 0.01 - self.clock_alpha = clock_alpha - - ################################################## - # Blocks - ################################################## - self.throttle = gr.throttle(gr.sizeof_short*1, 2*sample_rate) - self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) - self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) - self.gr_interleaved_short_to_complex_0 = gr.interleaved_short_to_complex() - self.gr_file_source_0 = gr.file_source(gr.sizeof_short*1, "input_filename", False) - self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename) - self.frame_sink.set_unbuffered(False) - self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) - self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() - self.deframer = noaa.hrpt_deframer() - self.decoder = noaa.hrpt_decoder(True,True) - self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) - - ################################################## - # Connections - ################################################## - self.connect((self.gr_moving_average_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) - self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0)) - self.connect((self.agc, 0), (self.pll, 0)) - self.connect((self.deframer, 0), (self.decoder, 0)) - self.connect((self.deframer, 0), (self.frame_sink, 0)) - self.connect((self.gr_interleaved_short_to_complex_0, 0), (self.agc, 0)) - self.connect((self.throttle, 0), (self.gr_interleaved_short_to_complex_0, 0)) - self.connect((self.gr_file_source_0, 0), (self.throttle, 0)) - self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) - self.connect((self.digital_binary_slicer_fb_0, 0), (self.deframer, 0)) - - def get_sym_rate(self): - return self.sym_rate - - def set_sym_rate(self, sym_rate): - self.sym_rate = sym_rate - self.set_sps(self.sample_rate/self.sym_rate) - - def get_sample_rate(self): - return self.sample_rate - - def set_sample_rate(self, sample_rate): - self.sample_rate = sample_rate - self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate) - self.set_sps(self.sample_rate/self.sym_rate) - - def get_sps(self): - return self.sps - - def set_sps(self, sps): - self.sps = sps - self.set_hs(int(self.sps/2.0)) - self.digital_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) - - def get_config_filename(self): - return self.config_filename - - def set_config_filename(self, config_filename): - self.config_filename = config_filename - self._freq_config = ConfigParser.ConfigParser() - self._freq_config.read(self.config_filename) - if not self._freq_config.has_section('usrp_rx_hrpt'): - self._freq_config.add_section('usrp_rx_hrpt') - self._freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq)) - self._freq_config.write(open(self.config_filename, 'w')) - self._gain_config = ConfigParser.ConfigParser() - self._gain_config.read(self.config_filename) - if not self._gain_config.has_section('usrp_rx_hrpt'): - self._gain_config.add_section('usrp_rx_hrpt') - self._gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain)) - self._gain_config.write(open(self.config_filename, 'w')) - self._pll_alpha_config = ConfigParser.ConfigParser() - self._pll_alpha_config.read(self.config_filename) - if not self._pll_alpha_config.has_section('usrp_rx_hrpt'): - self._pll_alpha_config.add_section('usrp_rx_hrpt') - self._pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha)) - self._pll_alpha_config.write(open(self.config_filename, 'w')) - self._clock_alpha_config = ConfigParser.ConfigParser() - self._clock_alpha_config.read(self.config_filename) - if not self._clock_alpha_config.has_section('usrp_rx_hrpt'): - self._clock_alpha_config.add_section('usrp_rx_hrpt') - self._clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha)) - self._clock_alpha_config.write(open(self.config_filename, 'w')) - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(self.config_filename) - if not self._output_filename_config.has_section('usrp_rx_hrpt'): - self._output_filename_config.add_section('usrp_rx_hrpt') - self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) - self._output_filename_config.write(open(self.config_filename, 'w')) - - def get_pll_alpha(self): - return self.pll_alpha - - def set_pll_alpha(self, pll_alpha): - self.pll_alpha = pll_alpha - self.pll.set_alpha(self.pll_alpha) - self.pll.set_beta(self.pll_alpha**2/4.0) - self._pll_alpha_config = ConfigParser.ConfigParser() - self._pll_alpha_config.read(self.config_filename) - if not self._pll_alpha_config.has_section('usrp_rx_hrpt'): - self._pll_alpha_config.add_section('usrp_rx_hrpt') - self._pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha)) - self._pll_alpha_config.write(open(self.config_filename, 'w')) - - def get_output_filename(self): - return self.output_filename - - def set_output_filename(self, output_filename): - self.output_filename = output_filename - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(self.config_filename) - if not self._output_filename_config.has_section('usrp_rx_hrpt'): - self._output_filename_config.add_section('usrp_rx_hrpt') - self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) - self._output_filename_config.write(open(self.config_filename, 'w')) - - def get_max_clock_offset(self): - return self.max_clock_offset - - def set_max_clock_offset(self, max_clock_offset): - self.max_clock_offset = max_clock_offset - - def get_max_carrier_offset(self): - return self.max_carrier_offset - - def set_max_carrier_offset(self, max_carrier_offset): - self.max_carrier_offset = max_carrier_offset - self.pll.set_max_offset(self.max_carrier_offset) - - def get_hs(self): - return self.hs - - def set_hs(self, hs): - self.hs = hs - self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs) - - def get_gain(self): - return self.gain - - def set_gain(self, gain): - self.gain = gain - self._gain_config = ConfigParser.ConfigParser() - self._gain_config.read(self.config_filename) - if not self._gain_config.has_section('usrp_rx_hrpt'): - self._gain_config.add_section('usrp_rx_hrpt') - self._gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain)) - self._gain_config.write(open(self.config_filename, 'w')) - - def get_freq(self): - return self.freq - - def set_freq(self, freq): - self.freq = freq - self._freq_config = ConfigParser.ConfigParser() - self._freq_config.read(self.config_filename) - if not self._freq_config.has_section('usrp_rx_hrpt'): - self._freq_config.add_section('usrp_rx_hrpt') - self._freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq)) - self._freq_config.write(open(self.config_filename, 'w')) - - def get_clock_alpha(self): - return self.clock_alpha - - def set_clock_alpha(self, clock_alpha): - self.clock_alpha = clock_alpha - self.digital_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0) - self.digital_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha) - self._clock_alpha_config = ConfigParser.ConfigParser() - self._clock_alpha_config.read(self.config_filename) - if not self._clock_alpha_config.has_section('usrp_rx_hrpt'): - self._clock_alpha_config.add_section('usrp_rx_hrpt') - self._clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha)) - self._clock_alpha_config.write(open(self.config_filename, 'w')) - -if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - (options, args) = parser.parse_args() - tb = file_rx_hrpt() - tb.start() - raw_input('Press Enter to quit: ') - tb.stop() - diff --git a/gr-noaa/apps/hrpt_decode.py b/gr-noaa/apps/hrpt_decode.py deleted file mode 100755 index 158780b17..000000000 --- a/gr-noaa/apps/hrpt_decode.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: Hrpt Decode -# Generated: Sun Nov 8 10:49:01 2009 -################################################## - -from gnuradio import eng_notation -from gnuradio import gr -from gnuradio import noaa -from gnuradio.eng_option import eng_option -from gnuradio.gr import firdes -from optparse import OptionParser -import math, os - -class hrpt_decode(gr.top_block): - - def __init__(self, decim=32, pll_alpha=0.01, clock_alpha=0.01, input_filename="frames.hrpt"): - gr.top_block.__init__(self, "Hrpt Decode") - - ################################################## - # Parameters - ################################################## - self.decim = decim - self.pll_alpha = pll_alpha - self.clock_alpha = clock_alpha - self.input_filename = input_filename - - ################################################## - # Variables - ################################################## - self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 64e6/decim - self.sps = sps = sample_rate/sym_rate - self.max_clock_offset = max_clock_offset = 100e-6 - self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate - self.hs = hs = int(sps/2.0) - - ################################################## - # Blocks - ################################################## - self.decoder = noaa.hrpt_decoder(True,True) - self.file_source = gr.file_source(gr.sizeof_short*1, input_filename, False) - - ################################################## - # Connections - ################################################## - self.connect((self.file_source, 0), (self.decoder, 0)) - - def set_decim(self, decim): - self.decim = decim - self.set_sample_rate(64e6/self.decim) - - def set_pll_alpha(self, pll_alpha): - self.pll_alpha = pll_alpha - - def set_clock_alpha(self, clock_alpha): - self.clock_alpha = clock_alpha - - def set_input_filename(self, input_filename): - self.input_filename = input_filename - - def set_sym_rate(self, sym_rate): - self.sym_rate = sym_rate - self.set_sps(self.sample_rate/self.sym_rate) - - def set_sample_rate(self, sample_rate): - self.sample_rate = sample_rate - self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate) - self.set_sps(self.sample_rate/self.sym_rate) - - def set_sps(self, sps): - self.sps = sps - self.set_hs(int(self.sps/2.0)) - - def set_max_clock_offset(self, max_clock_offset): - self.max_clock_offset = max_clock_offset - - def set_max_carrier_offset(self, max_carrier_offset): - self.max_carrier_offset = max_carrier_offset - - def set_hs(self, hs): - self.hs = hs - -if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - parser.add_option("-d", "--decim", dest="decim", type="intx", default=32, - help="Set decim [default=%default]") - parser.add_option("-p", "--pll-alpha", dest="pll_alpha", type="eng_float", default=eng_notation.num_to_str(0.01), - help="Set pll_alpha [default=%default]") - parser.add_option("-s", "--clock-alpha", dest="clock_alpha", type="eng_float", default=eng_notation.num_to_str(0.01), - help="Set clock_alpha [default=%default]") - parser.add_option("-F", "--input-filename", dest="input_filename", type="string", default="frames.hrpt", - help="Set frames.hrpt [default=%default]") - (options, args) = parser.parse_args() - tb = hrpt_decode(decim=options.decim, pll_alpha=options.pll_alpha, clock_alpha=options.clock_alpha, input_filename=options.input_filename) - tb.run() - diff --git a/gr-noaa/apps/hrpt_demod.py b/gr-noaa/apps/hrpt_demod.py deleted file mode 100755 index 38b4b2fe3..000000000 --- a/gr-noaa/apps/hrpt_demod.py +++ /dev/null @@ -1,161 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: Hrpt Demod -# Generated: Thu Oct 27 13:51:59 2011 -################################################## - -from gnuradio import digital -from gnuradio import eng_notation -from gnuradio import gr -from gnuradio import noaa -from gnuradio.eng_option import eng_option -from gnuradio.gr import firdes -from optparse import OptionParser -import math, os - -class hrpt_demod(gr.top_block): - - def __init__(self, input_filename="usrp.dat", output_filename="frames.dat", decim=32, pll_alpha=0.01, clock_alpha=0.01): - gr.top_block.__init__(self, "Hrpt Demod") - - ################################################## - # Parameters - ################################################## - self.input_filename = input_filename - self.output_filename = output_filename - self.decim = decim - self.pll_alpha = pll_alpha - self.clock_alpha = clock_alpha - - ################################################## - # Variables - ################################################## - self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 4e6 - self.sps = sps = sample_rate/sym_rate - self.max_clock_offset = max_clock_offset = 100e-6 - self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate - self.hs = hs = int(sps/2.0) - - ################################################## - # Blocks - ################################################## - self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) - self.noaa_hrpt_deframer_0 = noaa.hrpt_deframer() - self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) - self.gr_file_sink_0 = gr.file_sink(gr.sizeof_short*1, output_filename) - self.gr_file_sink_0.set_unbuffered(False) - self.file_source = gr.file_source(gr.sizeof_short*1, input_filename, False) - self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) - self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() - self.decoder = noaa.hrpt_decoder(True,False) - self.cs2cf = gr.interleaved_short_to_complex() - self.agc = gr.agc_cc(1e-5, 1.0, 1.0/32768.0, 1.0) - - ################################################## - # Connections - ################################################## - self.connect((self.file_source, 0), (self.cs2cf, 0)) - self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0)) - self.connect((self.cs2cf, 0), (self.agc, 0)) - self.connect((self.agc, 0), (self.pll, 0)) - self.connect((self.noaa_hrpt_deframer_0, 0), (self.gr_file_sink_0, 0)) - self.connect((self.noaa_hrpt_deframer_0, 0), (self.decoder, 0)) - self.connect((self.gr_moving_average_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) - self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) - self.connect((self.digital_binary_slicer_fb_0, 0), (self.noaa_hrpt_deframer_0, 0)) - - def get_input_filename(self): - return self.input_filename - - def set_input_filename(self, input_filename): - self.input_filename = input_filename - - def get_output_filename(self): - return self.output_filename - - def set_output_filename(self, output_filename): - self.output_filename = output_filename - - def get_decim(self): - return self.decim - - def set_decim(self, decim): - self.decim = decim - - def get_pll_alpha(self): - return self.pll_alpha - - def set_pll_alpha(self, pll_alpha): - self.pll_alpha = pll_alpha - self.pll.set_alpha(self.pll_alpha) - self.pll.set_beta(self.pll_alpha**2/4.0) - - def get_clock_alpha(self): - return self.clock_alpha - - def set_clock_alpha(self, clock_alpha): - self.clock_alpha = clock_alpha - self.digital_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0) - self.digital_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha) - - def get_sym_rate(self): - return self.sym_rate - - def set_sym_rate(self, sym_rate): - self.sym_rate = sym_rate - self.set_sps(self.sample_rate/self.sym_rate) - - def get_sample_rate(self): - return self.sample_rate - - def set_sample_rate(self, sample_rate): - self.sample_rate = sample_rate - self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate) - self.set_sps(self.sample_rate/self.sym_rate) - - def get_sps(self): - return self.sps - - def set_sps(self, sps): - self.sps = sps - self.set_hs(int(self.sps/2.0)) - self.digital_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) - - def get_max_clock_offset(self): - return self.max_clock_offset - - def set_max_clock_offset(self, max_clock_offset): - self.max_clock_offset = max_clock_offset - - def get_max_carrier_offset(self): - return self.max_carrier_offset - - def set_max_carrier_offset(self, max_carrier_offset): - self.max_carrier_offset = max_carrier_offset - self.pll.set_max_offset(self.max_carrier_offset) - - def get_hs(self): - return self.hs - - def set_hs(self, hs): - self.hs = hs - self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs) - -if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - parser.add_option("-F", "--input-filename", dest="input_filename", type="string", default="usrp.dat", - help="Set usrp.dat [default=%default]") - parser.add_option("-o", "--output-filename", dest="output_filename", type="string", default="frames.dat", - help="Set frames.dat [default=%default]") - parser.add_option("-d", "--decim", dest="decim", type="intx", default=32, - help="Set None [default=%default]") - parser.add_option("-p", "--pll-alpha", dest="pll_alpha", type="eng_float", default=eng_notation.num_to_str(0.01), - help="Set None [default=%default]") - parser.add_option("-s", "--clock-alpha", dest="clock_alpha", type="eng_float", default=eng_notation.num_to_str(0.01), - help="Set None [default=%default]") - (options, args) = parser.parse_args() - tb = hrpt_demod(input_filename=options.input_filename, output_filename=options.output_filename, decim=options.decim, pll_alpha=options.pll_alpha, clock_alpha=options.clock_alpha) - tb.run() - diff --git a/gr-noaa/apps/usrp_rx_hrpt.py b/gr-noaa/apps/usrp_rx_hrpt.py deleted file mode 100755 index e603e768e..000000000 --- a/gr-noaa/apps/usrp_rx_hrpt.py +++ /dev/null @@ -1,462 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: USRP HRPT Receiver -# Generated: Thu Oct 27 13:26:42 2011 -################################################## - -from gnuradio import digital -from gnuradio import eng_notation -from gnuradio import gr -from gnuradio import noaa -from gnuradio import uhd -from gnuradio import window -from gnuradio.eng_option import eng_option -from gnuradio.gr import firdes -from gnuradio.wxgui import fftsink2 -from gnuradio.wxgui import forms -from gnuradio.wxgui import scopesink2 -from grc_gnuradio import wxgui as grc_wxgui -from optparse import OptionParser -import ConfigParser -import math, os -import wx - -class usrp_rx_hrpt(grc_wxgui.top_block_gui): - - def __init__(self): - grc_wxgui.top_block_gui.__init__(self, title="USRP HRPT Receiver") - - ################################################## - # Variables - ################################################## - self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 4e6 - self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf' - self.sps = sps = sample_rate/sym_rate - self._saved_pll_alpha_config = ConfigParser.ConfigParser() - self._saved_pll_alpha_config.read(config_filename) - try: saved_pll_alpha = self._saved_pll_alpha_config.getfloat('usrp_rx_hrpt', 'pll_alpha') - except: saved_pll_alpha = 0.01 - self.saved_pll_alpha = saved_pll_alpha - self._saved_gain_config = ConfigParser.ConfigParser() - self._saved_gain_config.read(config_filename) - try: saved_gain = self._saved_gain_config.getfloat('usrp_rx_hrpt', 'gain') - except: saved_gain = 35 - self.saved_gain = saved_gain - self._saved_freq_config = ConfigParser.ConfigParser() - self._saved_freq_config.read(config_filename) - try: saved_freq = self._saved_freq_config.getfloat('usrp_rx_hrpt', 'freq') - except: saved_freq = 1698e6 - self.saved_freq = saved_freq - self._saved_clock_alpha_config = ConfigParser.ConfigParser() - self._saved_clock_alpha_config.read(config_filename) - try: saved_clock_alpha = self._saved_clock_alpha_config.getfloat('usrp_rx_hrpt', 'clock_alpha') - except: saved_clock_alpha = 0.01 - self.saved_clock_alpha = saved_clock_alpha - self._addr_config = ConfigParser.ConfigParser() - self._addr_config.read(config_filename) - try: addr = self._addr_config.get('usrp_rx_hrpt', 'addr') - except: addr = "" - self.addr = addr - self.rate_text = rate_text = sample_rate - self.pll_alpha = pll_alpha = saved_pll_alpha - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(config_filename) - try: output_filename = self._output_filename_config.get('usrp_rx_hrpt', 'filename') - except: output_filename = 'frames.hrpt' - self.output_filename = output_filename - self.max_clock_offset = max_clock_offset = 100e-6 - self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate - self.hs = hs = int(sps/2.0) - self.gain = gain = saved_gain - self.freq = freq = saved_freq - self.clock_alpha = clock_alpha = saved_clock_alpha - self.addr_text = addr_text = addr - - ################################################## - # Blocks - ################################################## - self._freq_text_box = forms.text_box( - parent=self.GetWin(), - value=self.freq, - callback=self.set_freq, - label="Frequency", - converter=forms.float_converter(), - ) - self.GridAdd(self._freq_text_box, 0, 0, 1, 1) - self.displays = self.displays = wx.Notebook(self.GetWin(), style=wx.NB_TOP) - self.displays.AddPage(grc_wxgui.Panel(self.displays), "Spectrum") - self.displays.AddPage(grc_wxgui.Panel(self.displays), "Demod") - self.GridAdd(self.displays, 2, 0, 1, 4) - _clock_alpha_sizer = wx.BoxSizer(wx.VERTICAL) - self._clock_alpha_text_box = forms.text_box( - parent=self.GetWin(), - sizer=_clock_alpha_sizer, - value=self.clock_alpha, - callback=self.set_clock_alpha, - label="Clock Alpha", - converter=forms.float_converter(), - proportion=0, - ) - self._clock_alpha_slider = forms.slider( - parent=self.GetWin(), - sizer=_clock_alpha_sizer, - value=self.clock_alpha, - callback=self.set_clock_alpha, - minimum=0.0, - maximum=0.5, - num_steps=100, - style=wx.SL_HORIZONTAL, - cast=float, - proportion=1, - ) - self.GridAdd(_clock_alpha_sizer, 0, 3, 1, 1) - self.uhd_usrp_source_0 = uhd.usrp_source( - device_addr=addr, - io_type=uhd.io_type.COMPLEX_FLOAT32, - num_channels=1, - ) - self.uhd_usrp_source_0.set_samp_rate(sample_rate) - self.uhd_usrp_source_0.set_center_freq(freq, 0) - self.uhd_usrp_source_0.set_gain(0, 0) - self.rx_fft = fftsink2.fft_sink_c( - self.displays.GetPage(0).GetWin(), - baseband_freq=freq, - y_per_div=5, - y_divs=8, - ref_level=-5, - ref_scale=2.0, - sample_rate=sample_rate, - fft_size=1024, - fft_rate=15, - average=True, - avg_alpha=0.1, - title="RX Spectrum", - peak_hold=False, - size=(640, 360), - ) - self.displays.GetPage(0).GridAdd(self.rx_fft.win, 0, 0, 1, 1) - self._rate_text_static_text = forms.static_text( - parent=self.GetWin(), - value=self.rate_text, - callback=self.set_rate_text, - label="Baseband Rate", - converter=forms.float_converter(), - ) - self.GridAdd(self._rate_text_static_text, 1, 1, 1, 1) - _pll_alpha_sizer = wx.BoxSizer(wx.VERTICAL) - self._pll_alpha_text_box = forms.text_box( - parent=self.GetWin(), - sizer=_pll_alpha_sizer, - value=self.pll_alpha, - callback=self.set_pll_alpha, - label="PLL Alpha", - converter=forms.float_converter(), - proportion=0, - ) - self._pll_alpha_slider = forms.slider( - parent=self.GetWin(), - sizer=_pll_alpha_sizer, - value=self.pll_alpha, - callback=self.set_pll_alpha, - minimum=0.0, - maximum=0.5, - num_steps=100, - style=wx.SL_HORIZONTAL, - cast=float, - proportion=1, - ) - self.GridAdd(_pll_alpha_sizer, 0, 2, 1, 1) - self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) - self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) - _gain_sizer = wx.BoxSizer(wx.VERTICAL) - self._gain_text_box = forms.text_box( - parent=self.GetWin(), - sizer=_gain_sizer, - value=self.gain, - callback=self.set_gain, - label="RX Gain", - converter=forms.float_converter(), - proportion=0, - ) - self._gain_slider = forms.slider( - parent=self.GetWin(), - sizer=_gain_sizer, - value=self.gain, - callback=self.set_gain, - minimum=0, - maximum=100, - num_steps=100, - style=wx.SL_HORIZONTAL, - cast=float, - proportion=1, - ) - self.GridAdd(_gain_sizer, 0, 1, 1, 1) - self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename) - self.frame_sink.set_unbuffered(False) - self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) - self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() - self.demod_scope = scopesink2.scope_sink_f( - self.displays.GetPage(1).GetWin(), - title="Post-Demod", - sample_rate=sym_rate*2.0, - v_scale=0.5, - v_offset=0, - t_scale=10.0/sym_rate, - ac_couple=False, - xy_mode=False, - num_inputs=1, - trig_mode=gr.gr_TRIG_MODE_AUTO, - y_axis_label="Counts", - ) - self.displays.GetPage(1).GridAdd(self.demod_scope.win, 0, 0, 1, 1) - self.deframer = noaa.hrpt_deframer() - self.decoder = noaa.hrpt_decoder(True,True) - self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) - self._addr_text_static_text = forms.static_text( - parent=self.GetWin(), - value=self.addr_text, - callback=self.set_addr_text, - label="USRP Addr", - converter=forms.str_converter(), - ) - self.GridAdd(self._addr_text_static_text, 1, 0, 1, 1) - - ################################################## - # Connections - ################################################## - self.connect((self.deframer, 0), (self.frame_sink, 0)) - self.connect((self.deframer, 0), (self.decoder, 0)) - self.connect((self.agc, 0), (self.pll, 0)) - self.connect((self.agc, 0), (self.rx_fft, 0)) - self.connect((self.uhd_usrp_source_0, 0), (self.agc, 0)) - self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0)) - self.connect((self.gr_moving_average_xx_0, 0), (self.demod_scope, 0)) - self.connect((self.gr_moving_average_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) - self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) - self.connect((self.digital_binary_slicer_fb_0, 0), (self.deframer, 0)) - - def get_sym_rate(self): - return self.sym_rate - - def set_sym_rate(self, sym_rate): - self.sym_rate = sym_rate - self.set_sps(self.sample_rate/self.sym_rate) - self.demod_scope.set_sample_rate(self.sym_rate*2.0) - - def get_sample_rate(self): - return self.sample_rate - - def set_sample_rate(self, sample_rate): - self.sample_rate = sample_rate - self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate) - self.set_sps(self.sample_rate/self.sym_rate) - self.rx_fft.set_sample_rate(self.sample_rate) - self.uhd_usrp_source_0.set_samp_rate(self.sample_rate) - self.set_rate_text(self.sample_rate) - - def get_config_filename(self): - return self.config_filename - - def set_config_filename(self, config_filename): - self.config_filename = config_filename - self._addr_config = ConfigParser.ConfigParser() - self._addr_config.read(self.config_filename) - if not self._addr_config.has_section('usrp_rx_hrpt'): - self._addr_config.add_section('usrp_rx_hrpt') - self._addr_config.set('usrp_rx_hrpt', 'addr', str(self.addr)) - self._addr_config.write(open(self.config_filename, 'w')) - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(self.config_filename) - if not self._output_filename_config.has_section('usrp_rx_hrpt'): - self._output_filename_config.add_section('usrp_rx_hrpt') - self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) - self._output_filename_config.write(open(self.config_filename, 'w')) - self._saved_clock_alpha_config = ConfigParser.ConfigParser() - self._saved_clock_alpha_config.read(self.config_filename) - if not self._saved_clock_alpha_config.has_section('usrp_rx_hrpt'): - self._saved_clock_alpha_config.add_section('usrp_rx_hrpt') - self._saved_clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha)) - self._saved_clock_alpha_config.write(open(self.config_filename, 'w')) - self._saved_pll_alpha_config = ConfigParser.ConfigParser() - self._saved_pll_alpha_config.read(self.config_filename) - if not self._saved_pll_alpha_config.has_section('usrp_rx_hrpt'): - self._saved_pll_alpha_config.add_section('usrp_rx_hrpt') - self._saved_pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha)) - self._saved_pll_alpha_config.write(open(self.config_filename, 'w')) - self._saved_gain_config = ConfigParser.ConfigParser() - self._saved_gain_config.read(self.config_filename) - if not self._saved_gain_config.has_section('usrp_rx_hrpt'): - self._saved_gain_config.add_section('usrp_rx_hrpt') - self._saved_gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain)) - self._saved_gain_config.write(open(self.config_filename, 'w')) - self._saved_freq_config = ConfigParser.ConfigParser() - self._saved_freq_config.read(self.config_filename) - if not self._saved_freq_config.has_section('usrp_rx_hrpt'): - self._saved_freq_config.add_section('usrp_rx_hrpt') - self._saved_freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq)) - self._saved_freq_config.write(open(self.config_filename, 'w')) - - def get_sps(self): - return self.sps - - def set_sps(self, sps): - self.sps = sps - self.set_hs(int(self.sps/2.0)) - self.digital_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) - - def get_saved_pll_alpha(self): - return self.saved_pll_alpha - - def set_saved_pll_alpha(self, saved_pll_alpha): - self.saved_pll_alpha = saved_pll_alpha - self.set_pll_alpha(self.saved_pll_alpha) - - def get_saved_gain(self): - return self.saved_gain - - def set_saved_gain(self, saved_gain): - self.saved_gain = saved_gain - self.set_gain(self.saved_gain) - - def get_saved_freq(self): - return self.saved_freq - - def set_saved_freq(self, saved_freq): - self.saved_freq = saved_freq - self.set_freq(self.saved_freq) - - def get_saved_clock_alpha(self): - return self.saved_clock_alpha - - def set_saved_clock_alpha(self, saved_clock_alpha): - self.saved_clock_alpha = saved_clock_alpha - self.set_clock_alpha(self.saved_clock_alpha) - - def get_addr(self): - return self.addr - - def set_addr(self, addr): - self.addr = addr - self._addr_config = ConfigParser.ConfigParser() - self._addr_config.read(self.config_filename) - if not self._addr_config.has_section('usrp_rx_hrpt'): - self._addr_config.add_section('usrp_rx_hrpt') - self._addr_config.set('usrp_rx_hrpt', 'addr', str(self.addr)) - self._addr_config.write(open(self.config_filename, 'w')) - self.set_addr_text(self.addr) - - def get_rate_text(self): - return self.rate_text - - def set_rate_text(self, rate_text): - self.rate_text = rate_text - self._rate_text_static_text.set_value(self.rate_text) - - def get_pll_alpha(self): - return self.pll_alpha - - def set_pll_alpha(self, pll_alpha): - self.pll_alpha = pll_alpha - self._pll_alpha_slider.set_value(self.pll_alpha) - self._pll_alpha_text_box.set_value(self.pll_alpha) - self.pll.set_alpha(self.pll_alpha) - self.pll.set_beta(self.pll_alpha**2/4.0) - self._saved_pll_alpha_config = ConfigParser.ConfigParser() - self._saved_pll_alpha_config.read(self.config_filename) - if not self._saved_pll_alpha_config.has_section('usrp_rx_hrpt'): - self._saved_pll_alpha_config.add_section('usrp_rx_hrpt') - self._saved_pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha)) - self._saved_pll_alpha_config.write(open(self.config_filename, 'w')) - - def get_output_filename(self): - return self.output_filename - - def set_output_filename(self, output_filename): - self.output_filename = output_filename - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(self.config_filename) - if not self._output_filename_config.has_section('usrp_rx_hrpt'): - self._output_filename_config.add_section('usrp_rx_hrpt') - self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) - self._output_filename_config.write(open(self.config_filename, 'w')) - - def get_max_clock_offset(self): - return self.max_clock_offset - - def set_max_clock_offset(self, max_clock_offset): - self.max_clock_offset = max_clock_offset - - def get_max_carrier_offset(self): - return self.max_carrier_offset - - def set_max_carrier_offset(self, max_carrier_offset): - self.max_carrier_offset = max_carrier_offset - self.pll.set_max_offset(self.max_carrier_offset) - - def get_hs(self): - return self.hs - - def set_hs(self, hs): - self.hs = hs - self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs) - - def get_gain(self): - return self.gain - - def set_gain(self, gain): - self.gain = gain - self._gain_slider.set_value(self.gain) - self._gain_text_box.set_value(self.gain) - self._saved_gain_config = ConfigParser.ConfigParser() - self._saved_gain_config.read(self.config_filename) - if not self._saved_gain_config.has_section('usrp_rx_hrpt'): - self._saved_gain_config.add_section('usrp_rx_hrpt') - self._saved_gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain)) - self._saved_gain_config.write(open(self.config_filename, 'w')) - - def get_freq(self): - return self.freq - - def set_freq(self, freq): - self.freq = freq - self._freq_text_box.set_value(self.freq) - self.rx_fft.set_baseband_freq(self.freq) - self.uhd_usrp_source_0.set_center_freq(self.freq, 0) - self._saved_freq_config = ConfigParser.ConfigParser() - self._saved_freq_config.read(self.config_filename) - if not self._saved_freq_config.has_section('usrp_rx_hrpt'): - self._saved_freq_config.add_section('usrp_rx_hrpt') - self._saved_freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq)) - self._saved_freq_config.write(open(self.config_filename, 'w')) - - def get_clock_alpha(self): - return self.clock_alpha - - def set_clock_alpha(self, clock_alpha): - self.clock_alpha = clock_alpha - self._clock_alpha_slider.set_value(self.clock_alpha) - self._clock_alpha_text_box.set_value(self.clock_alpha) - self._saved_clock_alpha_config = ConfigParser.ConfigParser() - self._saved_clock_alpha_config.read(self.config_filename) - if not self._saved_clock_alpha_config.has_section('usrp_rx_hrpt'): - self._saved_clock_alpha_config.add_section('usrp_rx_hrpt') - self._saved_clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha)) - self._saved_clock_alpha_config.write(open(self.config_filename, 'w')) - self.digital_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0) - self.digital_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha) - - def get_addr_text(self): - return self.addr_text - - def set_addr_text(self, addr_text): - self.addr_text = addr_text - self._addr_text_static_text.set_value(self.addr_text) - -if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - (options, args) = parser.parse_args() - tb = usrp_rx_hrpt() - tb.Run(True) - diff --git a/gr-noaa/apps/usrp_rx_hrpt_nogui.py b/gr-noaa/apps/usrp_rx_hrpt_nogui.py deleted file mode 100755 index 4fc5642ff..000000000 --- a/gr-noaa/apps/usrp_rx_hrpt_nogui.py +++ /dev/null @@ -1,268 +0,0 @@ -#!/usr/bin/env python -################################################## -# Gnuradio Python Flow Graph -# Title: USRP HRPT Receiver -# Generated: Thu Oct 27 13:49:01 2011 -################################################## - -from gnuradio import digital -from gnuradio import eng_notation -from gnuradio import gr -from gnuradio import noaa -from gnuradio import uhd -from gnuradio.eng_option import eng_option -from gnuradio.gr import firdes -from optparse import OptionParser -import ConfigParser -import math, os - -class usrp_rx_hrpt_nogui(gr.top_block): - - def __init__(self): - gr.top_block.__init__(self, "USRP HRPT Receiver") - - ################################################## - # Variables - ################################################## - self.sym_rate = sym_rate = 600*1109 - self.sample_rate = sample_rate = 4e6 - self.sps = sps = sample_rate/sym_rate - self.config_filename = config_filename = os.environ['HOME']+'/.gnuradio/config.conf' - self._pll_alpha_config = ConfigParser.ConfigParser() - self._pll_alpha_config.read(config_filename) - try: pll_alpha = self._pll_alpha_config.getfloat('usrp_rx_hrpt', 'pll_alpha') - except: pll_alpha = 0.01 - self.pll_alpha = pll_alpha - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(config_filename) - try: output_filename = self._output_filename_config.get('usrp_rx_hrpt', 'filename') - except: output_filename = 'frames.hrpt' - self.output_filename = output_filename - self.max_clock_offset = max_clock_offset = 100e-6 - self.max_carrier_offset = max_carrier_offset = 2*math.pi*100e3/sample_rate - self.hs = hs = int(sps/2.0) - self._gain_config = ConfigParser.ConfigParser() - self._gain_config.read(config_filename) - try: gain = self._gain_config.getfloat('usrp_rx_hrpt', 'gain') - except: gain = 35 - self.gain = gain - self._freq_config = ConfigParser.ConfigParser() - self._freq_config.read(config_filename) - try: freq = self._freq_config.getfloat('usrp_rx_hrpt', 'freq') - except: freq = 1698e6 - self.freq = freq - self._clock_alpha_config = ConfigParser.ConfigParser() - self._clock_alpha_config.read(config_filename) - try: clock_alpha = self._clock_alpha_config.getfloat('usrp_rx_hrpt', 'clock_alpha') - except: clock_alpha = 0.01 - self.clock_alpha = clock_alpha - self._addr_config = ConfigParser.ConfigParser() - self._addr_config.read(config_filename) - try: addr = self._addr_config.get('usrp_rx_hrpt', 'addr') - except: addr = "" - self.addr = addr - - ################################################## - # Blocks - ################################################## - self.uhd_usrp_source_0 = uhd.usrp_source( - device_addr=addr, - io_type=uhd.io_type.COMPLEX_FLOAT32, - num_channels=1, - ) - self.uhd_usrp_source_0.set_samp_rate(sample_rate) - self.uhd_usrp_source_0.set_center_freq(freq, 0) - self.uhd_usrp_source_0.set_gain(0, 0) - self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset) - self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000) - self.frame_sink = gr.file_sink(gr.sizeof_short*1, output_filename) - self.frame_sink.set_unbuffered(False) - self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset) - self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() - self.deframer = noaa.hrpt_deframer() - self.decoder = noaa.hrpt_decoder(True,True) - self.agc = gr.agc_cc(1e-6, 1.0, 1.0, 1.0) - - ################################################## - # Connections - ################################################## - self.connect((self.gr_moving_average_xx_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) - self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0)) - self.connect((self.uhd_usrp_source_0, 0), (self.agc, 0)) - self.connect((self.agc, 0), (self.pll, 0)) - self.connect((self.digital_binary_slicer_fb_0, 0), (self.deframer, 0)) - self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) - self.connect((self.deframer, 0), (self.decoder, 0)) - self.connect((self.deframer, 0), (self.frame_sink, 0)) - - def get_sym_rate(self): - return self.sym_rate - - def set_sym_rate(self, sym_rate): - self.sym_rate = sym_rate - self.set_sps(self.sample_rate/self.sym_rate) - - def get_sample_rate(self): - return self.sample_rate - - def set_sample_rate(self, sample_rate): - self.sample_rate = sample_rate - self.set_max_carrier_offset(2*math.pi*100e3/self.sample_rate) - self.set_sps(self.sample_rate/self.sym_rate) - self.uhd_usrp_source_0.set_samp_rate(self.sample_rate) - - def get_sps(self): - return self.sps - - def set_sps(self, sps): - self.sps = sps - self.set_hs(int(self.sps/2.0)) - self.digital_clock_recovery_mm_xx_0.set_omega(self.sps/2.0) - - def get_config_filename(self): - return self.config_filename - - def set_config_filename(self, config_filename): - self.config_filename = config_filename - self._clock_alpha_config = ConfigParser.ConfigParser() - self._clock_alpha_config.read(self.config_filename) - if not self._clock_alpha_config.has_section('usrp_rx_hrpt'): - self._clock_alpha_config.add_section('usrp_rx_hrpt') - self._clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha)) - self._clock_alpha_config.write(open(self.config_filename, 'w')) - self._pll_alpha_config = ConfigParser.ConfigParser() - self._pll_alpha_config.read(self.config_filename) - if not self._pll_alpha_config.has_section('usrp_rx_hrpt'): - self._pll_alpha_config.add_section('usrp_rx_hrpt') - self._pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha)) - self._pll_alpha_config.write(open(self.config_filename, 'w')) - self._gain_config = ConfigParser.ConfigParser() - self._gain_config.read(self.config_filename) - if not self._gain_config.has_section('usrp_rx_hrpt'): - self._gain_config.add_section('usrp_rx_hrpt') - self._gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain)) - self._gain_config.write(open(self.config_filename, 'w')) - self._freq_config = ConfigParser.ConfigParser() - self._freq_config.read(self.config_filename) - if not self._freq_config.has_section('usrp_rx_hrpt'): - self._freq_config.add_section('usrp_rx_hrpt') - self._freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq)) - self._freq_config.write(open(self.config_filename, 'w')) - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(self.config_filename) - if not self._output_filename_config.has_section('usrp_rx_hrpt'): - self._output_filename_config.add_section('usrp_rx_hrpt') - self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) - self._output_filename_config.write(open(self.config_filename, 'w')) - self._addr_config = ConfigParser.ConfigParser() - self._addr_config.read(self.config_filename) - if not self._addr_config.has_section('usrp_rx_hrpt'): - self._addr_config.add_section('usrp_rx_hrpt') - self._addr_config.set('usrp_rx_hrpt', 'addr', str(self.addr)) - self._addr_config.write(open(self.config_filename, 'w')) - - def get_pll_alpha(self): - return self.pll_alpha - - def set_pll_alpha(self, pll_alpha): - self.pll_alpha = pll_alpha - self._pll_alpha_config = ConfigParser.ConfigParser() - self._pll_alpha_config.read(self.config_filename) - if not self._pll_alpha_config.has_section('usrp_rx_hrpt'): - self._pll_alpha_config.add_section('usrp_rx_hrpt') - self._pll_alpha_config.set('usrp_rx_hrpt', 'pll_alpha', str(self.pll_alpha)) - self._pll_alpha_config.write(open(self.config_filename, 'w')) - self.pll.set_alpha(self.pll_alpha) - self.pll.set_beta(self.pll_alpha**2/4.0) - - def get_output_filename(self): - return self.output_filename - - def set_output_filename(self, output_filename): - self.output_filename = output_filename - self._output_filename_config = ConfigParser.ConfigParser() - self._output_filename_config.read(self.config_filename) - if not self._output_filename_config.has_section('usrp_rx_hrpt'): - self._output_filename_config.add_section('usrp_rx_hrpt') - self._output_filename_config.set('usrp_rx_hrpt', 'filename', str(self.output_filename)) - self._output_filename_config.write(open(self.config_filename, 'w')) - - def get_max_clock_offset(self): - return self.max_clock_offset - - def set_max_clock_offset(self, max_clock_offset): - self.max_clock_offset = max_clock_offset - - def get_max_carrier_offset(self): - return self.max_carrier_offset - - def set_max_carrier_offset(self, max_carrier_offset): - self.max_carrier_offset = max_carrier_offset - self.pll.set_max_offset(self.max_carrier_offset) - - def get_hs(self): - return self.hs - - def set_hs(self, hs): - self.hs = hs - self.gr_moving_average_xx_0.set_length_and_scale(self.hs, 1.0/self.hs) - - def get_gain(self): - return self.gain - - def set_gain(self, gain): - self.gain = gain - self._gain_config = ConfigParser.ConfigParser() - self._gain_config.read(self.config_filename) - if not self._gain_config.has_section('usrp_rx_hrpt'): - self._gain_config.add_section('usrp_rx_hrpt') - self._gain_config.set('usrp_rx_hrpt', 'gain', str(self.gain)) - self._gain_config.write(open(self.config_filename, 'w')) - - def get_freq(self): - return self.freq - - def set_freq(self, freq): - self.freq = freq - self._freq_config = ConfigParser.ConfigParser() - self._freq_config.read(self.config_filename) - if not self._freq_config.has_section('usrp_rx_hrpt'): - self._freq_config.add_section('usrp_rx_hrpt') - self._freq_config.set('usrp_rx_hrpt', 'freq', str(self.freq)) - self._freq_config.write(open(self.config_filename, 'w')) - self.uhd_usrp_source_0.set_center_freq(self.freq, 0) - - def get_clock_alpha(self): - return self.clock_alpha - - def set_clock_alpha(self, clock_alpha): - self.clock_alpha = clock_alpha - self._clock_alpha_config = ConfigParser.ConfigParser() - self._clock_alpha_config.read(self.config_filename) - if not self._clock_alpha_config.has_section('usrp_rx_hrpt'): - self._clock_alpha_config.add_section('usrp_rx_hrpt') - self._clock_alpha_config.set('usrp_rx_hrpt', 'clock_alpha', str(self.clock_alpha)) - self._clock_alpha_config.write(open(self.config_filename, 'w')) - self.digital_clock_recovery_mm_xx_0.set_gain_omega(self.clock_alpha**2/4.0) - self.digital_clock_recovery_mm_xx_0.set_gain_mu(self.clock_alpha) - - def get_addr(self): - return self.addr - - def set_addr(self, addr): - self.addr = addr - self._addr_config = ConfigParser.ConfigParser() - self._addr_config.read(self.config_filename) - if not self._addr_config.has_section('usrp_rx_hrpt'): - self._addr_config.add_section('usrp_rx_hrpt') - self._addr_config.set('usrp_rx_hrpt', 'addr', str(self.addr)) - self._addr_config.write(open(self.config_filename, 'w')) - -if __name__ == '__main__': - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") - (options, args) = parser.parse_args() - tb = usrp_rx_hrpt_nogui() - tb.start() - raw_input('Press Enter to quit: ') - tb.stop() - diff --git a/gr-noaa/apps/CMakeLists.txt b/gr-noaa/examples/CMakeLists.txt index 233f0ee5f..6994148df 100644 --- a/gr-noaa/apps/CMakeLists.txt +++ b/gr-noaa/examples/CMakeLists.txt @@ -17,15 +17,13 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -include(GrPython) - -GR_PYTHON_INSTALL( - PROGRAMS - hrpt_decode.py - hrpt_demod.py - file_rx_hrpt.py - usrp_rx_hrpt.py - usrp_rx_hrpt_nogui.py - DESTINATION ${GR_RUNTIME_DIR} +INSTALL( + FILES + hrpt_decode.grc + hrpt_demod.grc + file_rx_hrpt.grc + usrp_rx_hrpt.grc + usrp_rx_hrpt_nogui.grc + DESTINATION ${GR_PKG_NOAA_EXAMPLES_DIR} COMPONENT "noaa_python" ) diff --git a/gr-noaa/apps/file_rx_hrpt.grc b/gr-noaa/examples/file_rx_hrpt.grc index 4097e83d3..4097e83d3 100644 --- a/gr-noaa/apps/file_rx_hrpt.grc +++ b/gr-noaa/examples/file_rx_hrpt.grc diff --git a/gr-noaa/apps/hrpt_decode.grc b/gr-noaa/examples/hrpt_decode.grc index 39fe195d1..39fe195d1 100644 --- a/gr-noaa/apps/hrpt_decode.grc +++ b/gr-noaa/examples/hrpt_decode.grc diff --git a/gr-noaa/apps/hrpt_demod.grc b/gr-noaa/examples/hrpt_demod.grc index f5833b864..f5833b864 100644 --- a/gr-noaa/apps/hrpt_demod.grc +++ b/gr-noaa/examples/hrpt_demod.grc diff --git a/gr-noaa/apps/usrp_rx_hrpt.grc b/gr-noaa/examples/usrp_rx_hrpt.grc index 26af48ff0..26af48ff0 100644 --- a/gr-noaa/apps/usrp_rx_hrpt.grc +++ b/gr-noaa/examples/usrp_rx_hrpt.grc diff --git a/gr-noaa/apps/usrp_rx_hrpt_nogui.grc b/gr-noaa/examples/usrp_rx_hrpt_nogui.grc index 5936c94c8..5936c94c8 100644 --- a/gr-noaa/apps/usrp_rx_hrpt_nogui.grc +++ b/gr-noaa/examples/usrp_rx_hrpt_nogui.grc diff --git a/gr-noaa/grc/.gitignore b/gr-noaa/grc/.gitignore deleted file mode 100644 index 70845e08e..000000000 --- a/gr-noaa/grc/.gitignore +++ /dev/null @@ -1 +0,0 @@ -Makefile.in diff --git a/gr-noaa/grc/CMakeLists.txt b/gr-noaa/grc/CMakeLists.txt index 92d707477..ae04d4b6e 100644 --- a/gr-noaa/grc/CMakeLists.txt +++ b/gr-noaa/grc/CMakeLists.txt @@ -1,17 +1,17 @@ # 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, diff --git a/gr-noaa/grc/Makefile.am b/gr-noaa/grc/Makefile.am deleted file mode 100644 index 73a028231..000000000 --- a/gr-noaa/grc/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -# -# 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. -# - -include $(top_srcdir)/Makefile.common - -grcblocksdir = $(grc_blocksdir) - -dist_grcblocks_DATA = \ - noaa_hrpt_decoder.xml \ - noaa_hrpt_deframer.xml \ - noaa_hrpt_pll_cf.xml - diff --git a/gr-noaa/lib/.gitignore b/gr-noaa/lib/.gitignore deleted file mode 100644 index 02b052397..000000000 --- a/gr-noaa/lib/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -Makefile -Makefile.in -.deps -.libs diff --git a/gr-noaa/lib/Makefile.am b/gr-noaa/lib/Makefile.am deleted file mode 100644 index 8eedbbb18..000000000 --- a/gr-noaa/lib/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -# -# 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. -# - -include $(top_srcdir)/Makefile.common - -AM_CPPFLAGS = \ - $(STD_DEFINES_AND_INCLUDES) \ - $(WITH_INCLUDES) - -lib_LTLIBRARIES = \ - libgnuradio-noaa.la - -libgnuradio_noaa_la_SOURCES = \ - noaa_hrpt_decoder.cc \ - noaa_hrpt_deframer.cc \ - noaa_hrpt_pll_cf.cc - -noinst_HEADERS = \ - noaa_hrpt.h - -libgnuradio_noaa_la_LIBADD = \ - $(GNURADIO_CORE_LA) - -libgnuradio_noaa_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS) - -grinclude_HEADERS = \ - noaa_api.h \ - noaa_hrpt_decoder.h \ - noaa_hrpt_deframer.h \ - noaa_hrpt_pll_cf.h diff --git a/gr-noaa/lib/noaa_hrpt.h b/gr-noaa/lib/noaa_hrpt.h index 3812e9368..f0f0e53f4 100644 --- a/gr-noaa/lib/noaa_hrpt.h +++ b/gr-noaa/lib/noaa_hrpt.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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, diff --git a/gr-noaa/lib/noaa_hrpt_decoder.cc b/gr-noaa/lib/noaa_hrpt_decoder.cc index 243310089..d6a063285 100644 --- a/gr-noaa/lib/noaa_hrpt_decoder.cc +++ b/gr-noaa/lib/noaa_hrpt_decoder.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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, @@ -142,7 +142,7 @@ noaa_hrpt_decoder::process_mfnum() else if (d_verbose) fprintf(stderr, " "); - + if (d_verbose) fprintf(stderr, "%i ", d_current_mfnum); d_expected_mfnum = (d_current_mfnum == 3) ? 1 : d_current_mfnum+1; diff --git a/gr-noaa/lib/noaa_hrpt_decoder.h b/gr-noaa/lib/noaa_hrpt_decoder.h index 4db09106e..3b3214b72 100644 --- a/gr-noaa/lib/noaa_hrpt_decoder.h +++ b/gr-noaa/lib/noaa_hrpt_decoder.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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, diff --git a/gr-noaa/lib/noaa_hrpt_deframer.cc b/gr-noaa/lib/noaa_hrpt_deframer.cc index 1a2af6c37..d668ccad3 100644 --- a/gr-noaa/lib/noaa_hrpt_deframer.cc +++ b/gr-noaa/lib/noaa_hrpt_deframer.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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, @@ -86,7 +86,7 @@ noaa_hrpt_deframer::general_work(int noutput_items, switch (d_state) { case ST_IDLE: d_shifter = (d_shifter << 1) | bit; // MSB transmitted first - + if ((d_shifter & 0x0FFFFFFFFFFFFFFFLL) == HRPT_MINOR_FRAME_SYNC) { out[j++] = HRPT_SYNC1; out[j++] = HRPT_SYNC2; @@ -97,7 +97,7 @@ noaa_hrpt_deframer::general_work(int noutput_items, enter_synced(); } break; - + case ST_SYNCED: d_word = (d_word << 1) | bit; // MSB transmitted first if (--d_bit_count == 0) { @@ -109,7 +109,7 @@ noaa_hrpt_deframer::general_work(int noutput_items, } } break; - + default: throw std::runtime_error("noaa_hrpt_deframer: bad state\n"); } diff --git a/gr-noaa/lib/noaa_hrpt_deframer.h b/gr-noaa/lib/noaa_hrpt_deframer.h index d254746af..475ad90f6 100644 --- a/gr-noaa/lib/noaa_hrpt_deframer.h +++ b/gr-noaa/lib/noaa_hrpt_deframer.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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, @@ -47,7 +47,7 @@ class NOAA_API noaa_hrpt_deframer : public gr_block void enter_idle(); void enter_synced(); - + public: int general_work(int noutput_items, gr_vector_int &ninput_items, diff --git a/gr-noaa/lib/noaa_hrpt_pll_cf.cc b/gr-noaa/lib/noaa_hrpt_pll_cf.cc index ba2ce98d5..ea948f04b 100644 --- a/gr-noaa/lib/noaa_hrpt_pll_cf.cc +++ b/gr-noaa/lib/noaa_hrpt_pll_cf.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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, diff --git a/gr-noaa/lib/noaa_hrpt_pll_cf.h b/gr-noaa/lib/noaa_hrpt_pll_cf.h index 8d3e8f8d5..178dccfb3 100644 --- a/gr-noaa/lib/noaa_hrpt_pll_cf.h +++ b/gr-noaa/lib/noaa_hrpt_pll_cf.h @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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, diff --git a/gr-noaa/oct/.gitignore b/gr-noaa/oct/.gitignore deleted file mode 100644 index b336cc7ce..000000000 --- a/gr-noaa/oct/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/Makefile -/Makefile.in diff --git a/gr-noaa/oct/Makefile.am b/gr-noaa/oct/Makefile.am deleted file mode 100644 index 68a0d1aed..000000000 --- a/gr-noaa/oct/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# -# 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. -# - -include $(top_srcdir)/Makefile.common - -EXTRA_DIST += \ - frames_to_ppm.m \ - frames-to-png.sh diff --git a/gr-noaa/oct/frames_to_ppm.m b/gr-noaa/oct/frames_to_ppm.m index 73842f0a9..099f96f2b 100644 --- a/gr-noaa/oct/frames_to_ppm.m +++ b/gr-noaa/oct/frames_to_ppm.m @@ -1,24 +1,24 @@ % -*- octave -*- % % 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. -% +% % Extract AVHRR images from HRPT frames.dat clear @@ -40,7 +40,7 @@ for line = 1:len start = start + frame_len; stop = stop + frame_len; end - + start = 752; stop = 10987; @@ -49,7 +49,7 @@ for line = 1:len start = start + frame_len; stop = stop + frame_len; end - + start = 753; stop = 10988; @@ -58,7 +58,7 @@ for line = 1:len start = start + frame_len; stop = stop + frame_len; end - + start = 754; stop = 10989; @@ -67,7 +67,7 @@ for line = 1:len start = start + frame_len; stop = stop + frame_len; end - + start = 755; stop = 10990; @@ -77,7 +77,7 @@ for line = 1:len stop = stop + frame_len; end -colormap(gray) +colormap(gray) saveimage("chan1.ppm", chan1/4, 'ppm') saveimage("chan2.ppm", chan2/4, 'ppm') saveimage("chan3.ppm", chan3/4, 'ppm') diff --git a/gr-noaa/python/Makefile.am b/gr-noaa/python/Makefile.am deleted file mode 100644 index 869c5f353..000000000 --- a/gr-noaa/python/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# -# 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. -# - -include $(top_srcdir)/Makefile.common - -if PYTHON - -endif - diff --git a/gr-noaa/swig/.gitignore b/gr-noaa/swig/.gitignore deleted file mode 100644 index 7dc6d984b..000000000 --- a/gr-noaa/swig/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -Makefile -Makefile.in -.deps -.libs -noaa_swig.cc -noaa_swig.py -/run_guile_tests -/guile -/python diff --git a/gr-noaa/swig/Makefile.am b/gr-noaa/swig/Makefile.am deleted file mode 100644 index 5a0a8f154..000000000 --- a/gr-noaa/swig/Makefile.am +++ /dev/null @@ -1,85 +0,0 @@ -# -# Copyright 2004,2005,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. -# - -include $(top_srcdir)/Makefile.common -include $(top_srcdir)/Makefile.swig - -TESTS = -EXTRA_DIST += $(nobase_guile_DATA) - -noinst_GUILE = noaa.test - -if GUILE -nobase_guile_DATA = gnuradio/noaa.scm -endif - - -AM_CPPFLAGS = \ - -I$(top_srcdir)/gr-noaa/lib \ - $(STD_DEFINES_AND_INCLUDES) \ - $(PYTHON_CPPFLAGS) \ - $(WITH_INCLUDES) - -# ---------------------------------------------------------------- -# The SWIG library -# TESTS = run_tests - -TOP_SWIG_DOC_IFILES = \ - noaa_swig_doc.i - -TOP_SWIG_IFILES = \ - $(TOP_SWIG_DOC_IFILES) \ - noaa_swig.i - -BUILT_SOURCES += \ - $(TOP_SWIG_DOC_IFILES) - -EXTRA_DIST += \ - $(TOP_SWIG_DOC_IFILES) - -$(TOP_SWIG_DOC_IFILES): - `echo "" > $@` - -# Install so that they end up available as: -# import gnuradio.noaa -# This ends up at: -# ${prefix}/lib/python${python_version}/site-packages/gnuradio/noaa -noaa_swig_pythondir_category = \ - gnuradio/noaa - -# additional libraries for linking with the SWIG-generated library -noaa_swig_la_swig_libadd = \ - $(top_builddir)/gr-noaa/lib/libgnuradio-noaa.la - -# additional Python files to be installed along with the SWIG-generated one -noaa_swig_python = \ - __init__.py - -# additional SWIG files to be installed -noaa_swig_swiginclude_headers = \ - noaa_hrpt_decoder.i \ - noaa_hrpt_deframer.i \ - noaa_hrpt_pll_cf.i \ - $(TOP_SWIG_DOC_IFILES) - -if GUILE -TESTS += run_guile_tests -endif diff --git a/gr-noaa/swig/Makefile.swig.gen b/gr-noaa/swig/Makefile.swig.gen deleted file mode 100644 index 757c368f5..000000000 --- a/gr-noaa/swig/Makefile.swig.gen +++ /dev/null @@ -1,145 +0,0 @@ -# -*- Makefile -*- -# -# 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. -# - -# Makefile.swig.gen for noaa_swig.i - -## Default install locations for these files: -## -## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/noaa_swig -## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/noaa_swig -## -## The following can be overloaded to change the install location, but -## this has to be done in the including Makefile.am -before- -## Makefile.swig is included. - -noaa_swig_pythondir_category ?= gnuradio/noaa_swig -noaa_swig_pylibdir_category ?= $(noaa_swig_pythondir_category) -noaa_swig_pythondir = $(pythondir)/$(noaa_swig_pythondir_category) -noaa_swig_pylibdir = $(pyexecdir)/$(noaa_swig_pylibdir_category) - -# The .so libraries for the guile modules get installed whereever guile -# is installed, usually /usr/lib/guile/gnuradio/ -# FIXME: determince whether these should be installed with gnuradio. -noaa_swig_scmlibdir = $(libdir) - -# The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/noaa_swig -# FIXME: determince whether these should be installed with gnuradio. -noaa_swig_scmdir = $(guiledir) - -## SWIG headers are always installed into the same directory. - -noaa_swig_swigincludedir = $(swigincludedir) - -## This is a template file for a "generated" Makefile addition (in -## this case, "Makefile.swig.gen"). By including the top-level -## Makefile.swig, this file will be used to generate the SWIG -## dependencies. Assign the variable TOP_SWIG_FILES to be the list of -## SWIG .i files to generated wrappings for; there can be more than 1 -## so long as the names are unique (no sorting is done on the -## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i -## file will generate .cc, .py, and possibly .h files -- meaning that -## all of these files will have the same base name (that provided for -## the SWIG .i file). -## -## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the -## right thing. For more info, see < -## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > - -## Other cleaned files: dependency files generated by SWIG or this Makefile - -MOSTLYCLEANFILES += $(DEPDIR)/*.S* - -## Various SWIG variables. These can be overloaded in the including -## Makefile.am by setting the variable value there, then including -## Makefile.swig . - -noaa_swig_swiginclude_HEADERS = \ - noaa_swig.i \ - $(noaa_swig_swiginclude_headers) - -if PYTHON -noaa_swig_pylib_LTLIBRARIES = \ - _noaa_swig.la - -_noaa_swig_la_SOURCES = \ - python/noaa_swig.cc \ - $(noaa_swig_la_swig_sources) - -noaa_swig_python_PYTHON = \ - noaa_swig.py \ - $(noaa_swig_python) - -_noaa_swig_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(noaa_swig_la_swig_libadd) - -_noaa_swig_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(noaa_swig_la_swig_ldflags) - -_noaa_swig_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(noaa_swig_la_swig_cxxflags) - -python/noaa_swig.cc: noaa_swig.py -noaa_swig.py: noaa_swig.i - -# Include the python dependencies for this file --include python/noaa_swig.d - -endif # end of if python - -if GUILE - -noaa_swig_scmlib_LTLIBRARIES = \ - libguile-gnuradio-noaa_swig.la -libguile_gnuradio_noaa_swig_la_SOURCES = \ - guile/noaa_swig.cc \ - $(noaa_swig_la_swig_sources) -nobase_noaa_swig_scm_DATA = \ - gnuradio/noaa_swig.scm \ - gnuradio/noaa_swig-primitive.scm -libguile_gnuradio_noaa_swig_la_LIBADD = \ - $(STD_SWIG_LA_LIB_ADD) \ - $(noaa_swig_la_swig_libadd) -libguile_gnuradio_noaa_swig_la_LDFLAGS = \ - $(STD_SWIG_LA_LD_FLAGS) \ - $(noaa_swig_la_swig_ldflags) -libguile_gnuradio_noaa_swig_la_CXXFLAGS = \ - $(STD_SWIG_CXX_FLAGS) \ - -I$(top_builddir) \ - $(noaa_swig_la_swig_cxxflags) - -guile/noaa_swig.cc: gnuradio/noaa_swig.scm -gnuradio/noaa_swig.scm: noaa_swig.i -gnuradio/noaa_swig-primitive.scm: gnuradio/noaa_swig.scm - -# Include the guile dependencies for this file --include guile/noaa_swig.d - -endif # end of GUILE - - diff --git a/gr-noaa/swig/__init__.py b/gr-noaa/swig/__init__.py index b82603953..5ea4d934c 100644 --- a/gr-noaa/swig/__init__.py +++ b/gr-noaa/swig/__init__.py @@ -1,23 +1,23 @@ # # 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. -# +# # The presence of this file turns this directory into a Python package diff --git a/gr-noaa/swig/gnuradio/.gitignore b/gr-noaa/swig/gnuradio/.gitignore deleted file mode 100644 index 0c49489de..000000000 --- a/gr-noaa/swig/gnuradio/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/noaa_swig-primitive.scm -/noaa_swig.scm diff --git a/gr-noaa/swig/noaa.test b/gr-noaa/swig/noaa.test deleted file mode 100644 index 9a0862fdf..000000000 --- a/gr-noaa/swig/noaa.test +++ /dev/null @@ -1,36 +0,0 @@ -;;; -*- Scheme -*- -;;; -;;; Copyright 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, see <http://www.gnu.org/licenses/>. -;;; - -;;; If you're using Emacs's Scheme mode: -;;; (put 'with-test-prefix 'scheme-indent-function 1) - -;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests. -;;; See also the very end of the file, where the test-equal, test-eqv -;;; and test-eq macros are defined. - -(define-module (test-module) - #:use-module (oop goops) - #:use-module (gnuradio core) - #:use-module (gnuradio test-suite lib) - #:duplicates (merge-generics replace check)) - -;;; Confirm we can import the module... -(use-modules (gnuradio noaa)) - diff --git a/gr-noaa/swig/noaa_hrpt_decoder.i b/gr-noaa/swig/noaa_hrpt_decoder.i index 220a5714d..a3f8f48c3 100644 --- a/gr-noaa/swig/noaa_hrpt_decoder.i +++ b/gr-noaa/swig/noaa_hrpt_decoder.i @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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, diff --git a/gr-noaa/swig/noaa_hrpt_deframer.i b/gr-noaa/swig/noaa_hrpt_deframer.i index 6914b93e6..833ad18ad 100644 --- a/gr-noaa/swig/noaa_hrpt_deframer.i +++ b/gr-noaa/swig/noaa_hrpt_deframer.i @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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, diff --git a/gr-noaa/swig/noaa_hrpt_pll_cf.i b/gr-noaa/swig/noaa_hrpt_pll_cf.i index 859548a2d..2a5f524b3 100644 --- a/gr-noaa/swig/noaa_hrpt_pll_cf.i +++ b/gr-noaa/swig/noaa_hrpt_pll_cf.i @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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, diff --git a/gr-noaa/swig/noaa_swig.i b/gr-noaa/swig/noaa_swig.i index bc139651d..3c4d19650 100644 --- a/gr-noaa/swig/noaa_swig.i +++ b/gr-noaa/swig/noaa_swig.i @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * 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, @@ -34,13 +34,3 @@ %include "noaa_hrpt_decoder.i" %include "noaa_hrpt_deframer.i" %include "noaa_hrpt_pll_cf.i" - -#if SWIGGUILE -%scheme %{ -(load-extension-global "libguile-gnuradio-noaa_swig" "scm_init_gnuradio_noaa_swig_module") -%} - -%goops %{ -(use-modules (gnuradio gnuradio_core_runtime)) -%} -#endif diff --git a/gr-noaa/swig/run_guile_tests.in b/gr-noaa/swig/run_guile_tests.in deleted file mode 100644 index 5d08b0dd5..000000000 --- a/gr-noaa/swig/run_guile_tests.in +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -. @top_builddir@/setup_guile_test_env - -# 1st argument is absolute path to hand coded guile source directory -# 2nd argument is absolute path to component C++ shared library build directory -# 3nd argument is absolute path to component SWIG build directory - -add_local_paths \ - @srcdir@ \ - @abs_builddir@ \ - @abs_builddir@ - -@GUILE@ -e main -c '(use-modules (gnuradio test-suite guile-test))' -t @srcdir@ |