summaryrefslogtreecommitdiff
path: root/gr-noaa
diff options
context:
space:
mode:
authorJohnathan Corgan <jcorgan@corganenterprises.com>2009-09-20 19:32:30 -0700
committerJohnathan Corgan <jcorgan@corganenterprises.com>2009-09-20 19:32:30 -0700
commitf8fcb642dabca11870886c53dfdff66c86774db0 (patch)
tree012cd20603f4e38f5e50b41f08eac578d1ec7480 /gr-noaa
parent789435387ab3a886cd33304f4f47d60456765b70 (diff)
Added skeleton HRPT decoder block
Diffstat (limited to 'gr-noaa')
-rw-r--r--gr-noaa/apps/usrp_rx_hrpt.grc127
-rwxr-xr-xgr-noaa/apps/usrp_rx_hrpt.py6
-rw-r--r--gr-noaa/grc/Makefile.am1
-rw-r--r--gr-noaa/grc/noaa_hrpt_decoder.xml12
-rw-r--r--gr-noaa/lib/Makefile.am2
-rw-r--r--gr-noaa/lib/noaa_hrpt_decoder.cc64
-rw-r--r--gr-noaa/lib/noaa_hrpt_decoder.h47
-rw-r--r--gr-noaa/swig/Makefile.am1
-rw-r--r--gr-noaa/swig/noaa_hrpt_decoder.i32
-rw-r--r--gr-noaa/swig/noaa_hrpt_deframer.i2
-rw-r--r--gr-noaa/swig/noaa_swig.i2
11 files changed, 242 insertions, 54 deletions
diff --git a/gr-noaa/apps/usrp_rx_hrpt.grc b/gr-noaa/apps/usrp_rx_hrpt.grc
index 8edc2b4ea9..f629ae8b7f 100644
--- a/gr-noaa/apps/usrp_rx_hrpt.grc
+++ b/gr-noaa/apps/usrp_rx_hrpt.grc
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
- <timestamp>Sun Sep 20 19:09:57 2009</timestamp>
+ <timestamp>Sun Sep 20 19:30:16 2009</timestamp>
<block>
<key>options</key>
<param>
@@ -111,56 +111,6 @@
</param>
</block>
<block>
- <key>gr_file_sink</key>
- <param>
- <key>id</key>
- <value>gr_file_sink_1</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>file</key>
- <value>frames.dat</value>
- </param>
- <param>
- <key>type</key>
- <value>short</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(1253, 805)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>noaa_hrpt_deframer</key>
- <param>
- <key>id</key>
- <value>noaa_hrpt_deframer_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(1063, 809)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
<key>wxgui_scopesink2</key>
<param>
<key>id</key>
@@ -1000,6 +950,75 @@
<value>0</value>
</param>
</block>
+ <block>
+ <key>gr_file_sink</key>
+ <param>
+ <key>id</key>
+ <value>gr_file_sink_1</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>file</key>
+ <value>frames.dat</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>short</value>
+ </param>
+ <param>
+ <key>vlen</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1265, 917)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>noaa_hrpt_deframer</key>
+ <param>
+ <key>id</key>
+ <value>noaa_hrpt_deframer_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1063, 809)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>noaa_hrpt_decoder</key>
+ <param>
+ <key>id</key>
+ <value>noaa_hrpt_decoder_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1266, 809)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
<connection>
<source_block_id>virtual_source_0</source_block_id>
<sink_block_id>agr</sink_block_id>
@@ -1090,4 +1109,10 @@
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
+ <connection>
+ <source_block_id>noaa_hrpt_deframer_0</source_block_id>
+ <sink_block_id>noaa_hrpt_decoder_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
</flow_graph>
diff --git a/gr-noaa/apps/usrp_rx_hrpt.py b/gr-noaa/apps/usrp_rx_hrpt.py
index 6c50a348a6..b29af5654e 100755
--- a/gr-noaa/apps/usrp_rx_hrpt.py
+++ b/gr-noaa/apps/usrp_rx_hrpt.py
@@ -2,7 +2,7 @@
##################################################
# Gnuradio Python Flow Graph
# Title: USRP HRPT Receiver
-# Generated: Sun Sep 20 19:09:57 2009
+# Generated: Sun Sep 20 19:30:17 2009
##################################################
from gnuradio import eng_notation
@@ -105,10 +105,11 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
self.agr = gr.agc_cc(1e-6, 1.0, 1.0, 1.0)
self.gr_deinterleave_0 = gr.deinterleave(gr.sizeof_float*1)
self.gr_file_sink_1 = gr.file_sink(gr.sizeof_short*1, "frames.dat")
- self.gr_file_source_0 = gr.file_source(gr.sizeof_short*1, "filename", False)
+ self.gr_file_source_0 = gr.file_source(gr.sizeof_short*1, filename, False)
self.gr_float_to_complex_0 = gr.float_to_complex(1)
self.gr_short_to_float_0 = gr.short_to_float()
self.matched_filter = gr.moving_average_cc(hs, 1.0/hs, 4000)
+ self.noaa_hrpt_decoder_0 = noaa.hrpt_decoder()
self.noaa_hrpt_deframer_0 = noaa.hrpt_deframer()
self.noaa_hrpt_pll_cf_0 = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset)
self.noaa_hrpt_sync_fb_0 = noaa.hrpt_sync_fb(sync_alpha, sync_alpha**2/4.0, sps, max_sync_offset)
@@ -169,6 +170,7 @@ class usrp_rx_hrpt(grc_wxgui.top_block_gui):
self.connect((self.gr_deinterleave_0, 1), (self.gr_float_to_complex_0, 1))
self.connect((self.gr_deinterleave_0, 0), (self.gr_float_to_complex_0, 0))
self.connect((self.gr_file_source_0, 0), (self.gr_short_to_float_0, 0))
+ self.connect((self.noaa_hrpt_deframer_0, 0), (self.noaa_hrpt_decoder_0, 0))
def set_filename(self, filename):
self.filename = filename
diff --git a/gr-noaa/grc/Makefile.am b/gr-noaa/grc/Makefile.am
index 9f1f88195c..1f056473c5 100644
--- a/gr-noaa/grc/Makefile.am
+++ b/gr-noaa/grc/Makefile.am
@@ -24,6 +24,7 @@ include $(top_srcdir)/Makefile.common
grcblocksdir = $(prefix)/share/gnuradio/grc/blocks
dist_grcblocks_DATA = \
+ noaa_hrpt_decoder.xml \
noaa_hrpt_deframer.xml \
noaa_hrpt_pll_cf.xml \
noaa_hrpt_sync_fb.xml
diff --git a/gr-noaa/grc/noaa_hrpt_decoder.xml b/gr-noaa/grc/noaa_hrpt_decoder.xml
new file mode 100644
index 0000000000..183d72aba3
--- /dev/null
+++ b/gr-noaa/grc/noaa_hrpt_decoder.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<block>
+ <name>HRPT Decoder</name>
+ <key>noaa_hrpt_decoder</key>
+ <category>NOAA</category>
+ <import>from gnuradio import noaa</import>
+ <make>noaa.hrpt_decoder()</make>
+ <sink>
+ <name>in</name>
+ <type>short</type>
+ </sink>
+</block>
diff --git a/gr-noaa/lib/Makefile.am b/gr-noaa/lib/Makefile.am
index 578c98adaf..6435d192e9 100644
--- a/gr-noaa/lib/Makefile.am
+++ b/gr-noaa/lib/Makefile.am
@@ -29,6 +29,7 @@ lib_LTLIBRARIES = \
libgnuradio-noaa.la
libgnuradio_noaa_la_SOURCES = \
+ noaa_hrpt_decoder.cc \
noaa_hrpt_deframer.cc \
noaa_hrpt_pll_cf.cc \
noaa_hrpt_sync_fb.cc
@@ -39,6 +40,7 @@ libgnuradio_noaa_la_LIBADD = \
libgnuradio_noaa_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0
grinclude_HEADERS = \
+ noaa_hrpt_decoder.h \
noaa_hrpt_deframer.h \
noaa_hrpt_pll_cf.h \
noaa_hrpt_sync_fb.h
diff --git a/gr-noaa/lib/noaa_hrpt_decoder.cc b/gr-noaa/lib/noaa_hrpt_decoder.cc
new file mode 100644
index 0000000000..7aa815c5c5
--- /dev/null
+++ b/gr-noaa/lib/noaa_hrpt_decoder.cc
@@ -0,0 +1,64 @@
+/* -*- 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,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <noaa_hrpt_decoder.h>
+#include <gr_io_signature.h>
+
+#define SYNC1 0x0284
+#define SYNC2 0x016F
+#define SYNC3 0x035C
+#define SYNC4 0x019D
+#define SYNC5 0x020F
+#define SYNC6 0x0095
+
+noaa_hrpt_decoder_sptr
+noaa_make_hrpt_decoder()
+{
+ return gnuradio::get_initial_sptr(new noaa_hrpt_decoder());
+}
+
+noaa_hrpt_decoder::noaa_hrpt_decoder()
+ : gr_sync_block("noaa_hrpt_decoder",
+ gr_make_io_signature(1, 1, sizeof(short)),
+ gr_make_io_signature(0, 0, 0))
+{
+ d_word_count = 0;
+}
+
+int
+noaa_hrpt_decoder::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const unsigned short *in = (const unsigned short*)input_items[0];
+
+ int i = 0;
+ while (i < noutput_items) {
+ unsigned short word = in[i++];
+ }
+
+ return i;
+}
diff --git a/gr-noaa/lib/noaa_hrpt_decoder.h b/gr-noaa/lib/noaa_hrpt_decoder.h
new file mode 100644
index 0000000000..305243b09a
--- /dev/null
+++ b/gr-noaa/lib/noaa_hrpt_decoder.h
@@ -0,0 +1,47 @@
+/* -*- 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,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_NOAA_HRPT_DECODER_H
+#define INCLUDED_NOAA_HRPT_DECODER_H
+
+#include <gr_sync_block.h>
+
+class noaa_hrpt_decoder;
+typedef boost::shared_ptr<noaa_hrpt_decoder> noaa_hrpt_decoder_sptr;
+
+noaa_hrpt_decoder_sptr
+noaa_make_hrpt_decoder();
+
+class noaa_hrpt_decoder : public gr_sync_block
+{
+ friend noaa_hrpt_decoder_sptr noaa_make_hrpt_decoder();
+ noaa_hrpt_decoder();
+
+ unsigned int d_word_count;
+
+public:
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_NOAA_HRPT_DECODER_H */
diff --git a/gr-noaa/swig/Makefile.am b/gr-noaa/swig/Makefile.am
index 98311eb7bf..cd7686e212 100644
--- a/gr-noaa/swig/Makefile.am
+++ b/gr-noaa/swig/Makefile.am
@@ -53,6 +53,7 @@ noaa_swig_python = \
# additional SWIG files to be installed
noaa_swig_swiginclude_headers = \
noaa_swig.i \
+ noaa_hrpt_decoder.i \
noaa_hrpt_deframer.i \
noaa_hrpt_pll_cf.i \
noaa_hrpt_sync_fb.i
diff --git a/gr-noaa/swig/noaa_hrpt_decoder.i b/gr-noaa/swig/noaa_hrpt_decoder.i
new file mode 100644
index 0000000000..ddf181c280
--- /dev/null
+++ b/gr-noaa/swig/noaa_hrpt_decoder.i
@@ -0,0 +1,32 @@
+/* -*- 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,
+ * Boston, MA 02110-1301, USA.
+ */
+
+GR_SWIG_BLOCK_MAGIC(noaa,hrpt_decoder)
+
+noaa_hrpt_decoder_sptr
+noaa_make_hrpt_decoder();
+
+class noaa_hrpt_decoder : public gr_sync_block
+{
+private:
+ noaa_hrpt_decoder();
+};
diff --git a/gr-noaa/swig/noaa_hrpt_deframer.i b/gr-noaa/swig/noaa_hrpt_deframer.i
index 73106d7262..6914b93e63 100644
--- a/gr-noaa/swig/noaa_hrpt_deframer.i
+++ b/gr-noaa/swig/noaa_hrpt_deframer.i
@@ -25,7 +25,7 @@ GR_SWIG_BLOCK_MAGIC(noaa,hrpt_deframer)
noaa_hrpt_deframer_sptr
noaa_make_hrpt_deframer();
-class noaa_hrpt_deframer : public gr_sync_block
+class noaa_hrpt_deframer : public gr_block
{
private:
noaa_hrpt_deframer();
diff --git a/gr-noaa/swig/noaa_swig.i b/gr-noaa/swig/noaa_swig.i
index 44f2e47235..e6497bc468 100644
--- a/gr-noaa/swig/noaa_swig.i
+++ b/gr-noaa/swig/noaa_swig.i
@@ -23,11 +23,13 @@
%include "gnuradio.i"
%{
+#include <noaa_hrpt_decoder.h>
#include <noaa_hrpt_deframer.h>
#include <noaa_hrpt_pll_cf.h>
#include <noaa_hrpt_sync_fb.h>
%}
+%include "noaa_hrpt_decoder.i"
%include "noaa_hrpt_deframer.i"
%include "noaa_hrpt_pll_cf.i"
%include "noaa_hrpt_sync_fb.i"