<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
- <timestamp>Sun Nov 1 18:39:07 2009</timestamp>
+ <timestamp>Mon Nov 2 07:06:57 2009</timestamp>
<block>
<key>options</key>
<param>
<value>0</value>
</param>
</block>
- <block>
- <key>gr_binary_slicer_fb</key>
- <param>
- <key>id</key>
- <value>gr_binary_slicer_fb_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(112, 537)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
<block>
<key>gr_file_sink</key>
<param>
</param>
</block>
<block>
- <key>noaa_hrpt_bit_sync</key>
+ <key>gr_binary_slicer_fb</key>
<param>
<key>id</key>
- <value>noaa_hrpt_bit_sync_0</value>
+ <value>gr_binary_slicer_fb_0</value>
</param>
<param>
<key>_enabled</key>
</param>
<param>
<key>_coordinate</key>
- <value>(330, 537)</value>
+ <value>(112, 537)</value>
</param>
<param>
<key>_rotation</key>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
- <connection>
- <source_block_id>gr_binary_slicer_fb_0</source_block_id>
- <sink_block_id>noaa_hrpt_bit_sync_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
<connection>
<source_block_id>cs2cf</source_block_id>
<sink_block_id>agc</sink_block_id>
<sink_key>0</sink_key>
</connection>
<connection>
- <source_block_id>noaa_hrpt_bit_sync_0</source_block_id>
+ <source_block_id>gr_binary_slicer_fb_0</source_block_id>
<sink_block_id>noaa_hrpt_deframer_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
##################################################
# Gnuradio Python Flow Graph
# Title: Demod Hrpt File
-# Generated: Sun Nov 1 18:39:07 2009
+# Generated: Mon Nov 2 07:06:57 2009
##################################################
from gnuradio import eng_notation
self.gr_clock_recovery_mm_xx_0 = gr.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset)
self.gr_file_sink_0 = gr.file_sink(gr.sizeof_short*1, output_filename)
self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000)
- self.noaa_hrpt_bit_sync_0 = noaa.hrpt_bit_sync()
self.noaa_hrpt_decoder_0 = noaa.hrpt_decoder()
self.noaa_hrpt_deframer_0 = noaa.hrpt_deframer()
self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset)
self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.gr_binary_slicer_fb_0, 0))
self.connect((self.gr_moving_average_xx_0, 0), (self.gr_clock_recovery_mm_xx_0, 0))
self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0))
- self.connect((self.gr_binary_slicer_fb_0, 0), (self.noaa_hrpt_bit_sync_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.noaa_hrpt_decoder_0, 0))
- self.connect((self.noaa_hrpt_bit_sync_0, 0), (self.noaa_hrpt_deframer_0, 0))
+ self.connect((self.gr_binary_slicer_fb_0, 0), (self.noaa_hrpt_deframer_0, 0))
def set_decim(self, decim):
self.decim = decim
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
- <timestamp>Sun Nov 1 19:26:11 2009</timestamp>
+ <timestamp>Mon Nov 2 08:30:47 2009</timestamp>
<block>
<key>options</key>
<param>
<value>0</value>
</param>
</block>
- <block>
- <key>noaa_hrpt_deframer</key>
- <param>
- <key>id</key>
- <value>deframer</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(762, 975)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
<block>
<key>gr_file_sink</key>
<param>
<value>0</value>
</param>
</block>
- <block>
- <key>noaa_hrpt_bit_sync</key>
- <param>
- <key>id</key>
- <value>noaa_hrpt_bit_sync_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(571, 975)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>gr_binary_slicer_fb</key>
- <param>
- <key>id</key>
- <value>gr_binary_slicer_fb_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(393, 975)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
<block>
<key>virtual_source</key>
<param>
<value>0</value>
</param>
</block>
- <connection>
- <source_block_id>noaa_hrpt_bit_sync_0</source_block_id>
- <sink_block_id>deframer</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>gr_binary_slicer_fb_0</source_block_id>
- <sink_block_id>noaa_hrpt_bit_sync_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
+ <block>
+ <key>gr_binary_slicer_fb</key>
+ <param>
+ <key>id</key>
+ <value>gr_binary_slicer_fb_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(393, 975)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>noaa_hrpt_deframer</key>
+ <param>
+ <key>id</key>
+ <value>deframer</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(762, 975)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
<connection>
<source_block_id>virtual_source_0</source_block_id>
<sink_block_id>gr_binary_slicer_fb_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
+ <connection>
+ <source_block_id>gr_binary_slicer_fb_0</source_block_id>
+ <sink_block_id>deframer</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
</flow_graph>
##################################################
# Gnuradio Python Flow Graph
# Title: USRP HRPT Receiver
-# Generated: Sun Nov 1 19:26:11 2009
+# Generated: Mon Nov 2 08:30:47 2009
##################################################
from gnuradio import eng_notation
self.gr_file_source_0 = gr.file_source(gr.sizeof_short*1, input_filename, False)
self.gr_interleaved_short_to_complex_0 = gr.interleaved_short_to_complex()
self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000)
- self.noaa_hrpt_bit_sync_0 = noaa.hrpt_bit_sync()
self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset)
self.rx_fft = fftsink2.fft_sink_c(
self.displays.GetPage(0).GetWin(),
##################################################
# Connections
##################################################
- self.connect((self.noaa_hrpt_bit_sync_0, 0), (self.deframer, 0))
- self.connect((self.gr_binary_slicer_fb_0, 0), (self.noaa_hrpt_bit_sync_0, 0))
self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.gr_binary_slicer_fb_0, 0))
self.connect((self.deframer, 0), (self.frame_sink, 0))
self.connect((self.deframer, 0), (self.decoder, 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.gr_binary_slicer_fb_0, 0), (self.deframer, 0))
def set_input_filename(self, input_filename):
self.input_filename = input_filename
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
- <timestamp>Sun Nov 1 19:28:12 2009</timestamp>
+ <timestamp>Mon Nov 2 08:31:09 2009</timestamp>
<block>
<key>options</key>
<param>
<value>0</value>
</param>
</block>
- <block>
- <key>noaa_hrpt_deframer</key>
- <param>
- <key>id</key>
- <value>deframer</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(762, 975)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
<block>
<key>gr_file_sink</key>
<param>
<value>0</value>
</param>
</block>
- <block>
- <key>noaa_hrpt_bit_sync</key>
- <param>
- <key>id</key>
- <value>noaa_hrpt_bit_sync_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(571, 975)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>gr_binary_slicer_fb</key>
- <param>
- <key>id</key>
- <value>gr_binary_slicer_fb_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(393, 975)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
<block>
<key>virtual_source</key>
<param>
<value>0</value>
</param>
</block>
- <connection>
- <source_block_id>noaa_hrpt_bit_sync_0</source_block_id>
- <sink_block_id>deframer</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>gr_binary_slicer_fb_0</source_block_id>
- <sink_block_id>noaa_hrpt_bit_sync_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
+ <block>
+ <key>gr_binary_slicer_fb</key>
+ <param>
+ <key>id</key>
+ <value>gr_binary_slicer_fb_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(393, 975)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>noaa_hrpt_deframer</key>
+ <param>
+ <key>id</key>
+ <value>deframer</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(762, 975)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
<connection>
<source_block_id>virtual_source_0</source_block_id>
<sink_block_id>gr_binary_slicer_fb_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
+ <connection>
+ <source_block_id>gr_binary_slicer_fb_0</source_block_id>
+ <sink_block_id>deframer</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
</flow_graph>
##################################################
# Gnuradio Python Flow Graph
# Title: USRP HRPT Receiver
-# Generated: Sun Nov 1 19:28:13 2009
+# Generated: Mon Nov 2 08:31:10 2009
##################################################
from gnuradio import eng_notation
self.gr_binary_slicer_fb_0 = gr.binary_slicer_fb()
self.gr_clock_recovery_mm_xx_0 = gr.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset)
self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000)
- self.noaa_hrpt_bit_sync_0 = noaa.hrpt_bit_sync()
self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset)
self.rx_fft = fftsink2.fft_sink_c(
self.displays.GetPage(0).GetWin(),
##################################################
# Connections
##################################################
- self.connect((self.noaa_hrpt_bit_sync_0, 0), (self.deframer, 0))
- self.connect((self.gr_binary_slicer_fb_0, 0), (self.noaa_hrpt_bit_sync_0, 0))
self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.gr_binary_slicer_fb_0, 0))
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.usrp_source, 0), (self.agc, 0))
self.connect((self.agc, 0), (self.rx_fft, 0))
+ self.connect((self.gr_binary_slicer_fb_0, 0), (self.deframer, 0))
def set_config_filename(self, config_filename):
self.config_filename = config_filename
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
- <timestamp>Sun Nov 1 19:32:32 2009</timestamp>
+ <timestamp>Mon Nov 2 08:31:35 2009</timestamp>
<block>
<key>options</key>
<param>
<value>0</value>
</param>
</block>
- <block>
- <key>noaa_hrpt_deframer</key>
- <param>
- <key>id</key>
- <value>deframer</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(815, 673)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
<block>
<key>gr_file_sink</key>
<param>
</param>
</block>
<block>
- <key>noaa_hrpt_bit_sync</key>
+ <key>virtual_source</key>
<param>
<key>id</key>
- <value>noaa_hrpt_bit_sync_0</value>
+ <value>virtual_source_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
+ <param>
+ <key>stream_id</key>
+ <value>baseband</value>
+ </param>
<param>
<key>_coordinate</key>
- <value>(624, 673)</value>
+ <value>(226, 669)</value>
</param>
<param>
<key>_rotation</key>
</param>
</block>
<block>
- <key>gr_binary_slicer_fb</key>
+ <key>noaa_hrpt_decoder</key>
<param>
<key>id</key>
- <value>gr_binary_slicer_fb_0</value>
+ <value>decoder</value>
</param>
<param>
<key>_enabled</key>
</param>
<param>
<key>_coordinate</key>
- <value>(446, 673)</value>
+ <value>(1027, 623)</value>
</param>
<param>
<key>_rotation</key>
</param>
</block>
<block>
- <key>virtual_source</key>
+ <key>gr_binary_slicer_fb</key>
<param>
<key>id</key>
- <value>virtual_source_0</value>
+ <value>gr_binary_slicer_fb_0</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
- <param>
- <key>stream_id</key>
- <value>baseband</value>
- </param>
<param>
<key>_coordinate</key>
- <value>(226, 669)</value>
+ <value>(446, 673)</value>
</param>
<param>
<key>_rotation</key>
</param>
</block>
<block>
- <key>noaa_hrpt_decoder</key>
+ <key>noaa_hrpt_deframer</key>
<param>
<key>id</key>
- <value>decoder</value>
+ <value>deframer</value>
</param>
<param>
<key>_enabled</key>
</param>
<param>
<key>_coordinate</key>
- <value>(1027, 623)</value>
+ <value>(815, 673)</value>
</param>
<param>
<key>_rotation</key>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
- <connection>
- <source_block_id>noaa_hrpt_bit_sync_0</source_block_id>
- <sink_block_id>deframer</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>gr_binary_slicer_fb_0</source_block_id>
- <sink_block_id>noaa_hrpt_bit_sync_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
<connection>
<source_block_id>virtual_source_0</source_block_id>
<sink_block_id>gr_binary_slicer_fb_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
+ <connection>
+ <source_block_id>gr_binary_slicer_fb_0</source_block_id>
+ <sink_block_id>deframer</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
</flow_graph>
##################################################
# Gnuradio Python Flow Graph
# Title: Usrp Rx Hrpt Nogui
-# Generated: Sun Nov 1 19:32:32 2009
+# Generated: Mon Nov 2 08:31:35 2009
##################################################
from gnuradio import eng_notation
self.gr_binary_slicer_fb_0 = gr.binary_slicer_fb()
self.gr_clock_recovery_mm_xx_0 = gr.clock_recovery_mm_ff(sps/2.0, clock_alpha**2/4.0, 0.5, clock_alpha, max_clock_offset)
self.gr_moving_average_xx_0 = gr.moving_average_ff(hs, 1.0/hs, 4000)
- self.noaa_hrpt_bit_sync_0 = noaa.hrpt_bit_sync()
self.pll = noaa.hrpt_pll_cf(pll_alpha, pll_alpha**2/4.0, max_carrier_offset)
self.usrp_source = grc_usrp.simple_source_c(which=0, side=side, rx_ant="RXA")
self.usrp_source.set_decim_rate(decim)
self.connect((self.agc, 0), (self.pll, 0))
self.connect((self.pll, 0), (self.gr_moving_average_xx_0, 0))
self.connect((self.gr_moving_average_xx_0, 0), (self.gr_clock_recovery_mm_xx_0, 0))
- self.connect((self.noaa_hrpt_bit_sync_0, 0), (self.deframer, 0))
- self.connect((self.gr_binary_slicer_fb_0, 0), (self.noaa_hrpt_bit_sync_0, 0))
self.connect((self.gr_clock_recovery_mm_xx_0, 0), (self.gr_binary_slicer_fb_0, 0))
self.connect((self.deframer, 0), (self.frame_sink, 0))
self.connect((self.deframer, 0), (self.decoder, 0))
+ self.connect((self.gr_binary_slicer_fb_0, 0), (self.deframer, 0))
def set_config_filename(self, config_filename):
self.config_filename = config_filename
grcblocksdir = $(grc_blocksdir)
dist_grcblocks_DATA = \
- noaa_hrpt_bit_sync.xml \
noaa_hrpt_decoder.xml \
noaa_hrpt_deframer.xml \
noaa_hrpt_pll_cf.xml
+++ /dev/null
-<?xml version="1.0"?>
-<block>
- <name>HRPT Bit Sync</name>
- <key>noaa_hrpt_bit_sync</key>
- <category>NOAA</category>
- <import>from gnuradio import noaa</import>
- <make>noaa.hrpt_bit_sync()</make>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
libgnuradio-noaa.la
libgnuradio_noaa_la_SOURCES = \
- noaa_hrpt_bit_sync.cc \
noaa_hrpt_decoder.cc \
noaa_hrpt_deframer.cc \
noaa_hrpt_pll_cf.cc
libgnuradio_noaa_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0
grinclude_HEADERS = \
- noaa_hrpt_bit_sync.h \
noaa_hrpt_decoder.h \
noaa_hrpt_deframer.h \
noaa_hrpt_pll_cf.h
\ No newline at end of file
+++ /dev/null
-/* -*- 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_bit_sync.h>
-#include <gr_io_signature.h>
-#include <iostream>
-
-noaa_hrpt_bit_sync_sptr
-noaa_make_hrpt_bit_sync()
-{
- return gnuradio::get_initial_sptr(new noaa_hrpt_bit_sync());
-}
-
-noaa_hrpt_bit_sync::noaa_hrpt_bit_sync()
- : gr_block("noaa_hrpt_bit_sync",
- gr_make_io_signature(1, 1, sizeof(char)),
- gr_make_io_signature(1, 1, sizeof(char))),
- d_mid_bit(true),
- d_last_bit(0)
-{
-}
-
-int
-noaa_hrpt_bit_sync::general_work(int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
-{
- int ninputs = ninput_items[0];
- const char *in = (const char *)input_items[0];
- char *out = (char *)output_items[0];
-
- int i = 0, j = 0;
- while (i < ninputs && j < noutput_items) {
- char bit = in[i++];
- char diff = bit^d_last_bit;
- d_last_bit = bit;
-
- if (d_mid_bit && diff) {
- out[j++] = bit;
- d_mid_bit = false;
- }
- else
- d_mid_bit = true;
- }
-
- consume_each(i);
- return j;
-}
+++ /dev/null
-/* -*- 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_BIT_SYNC_H
-#define INCLUDED_NOAA_HRPT_BIT_SYNC_H
-
-#include <gr_block.h>
-
-class noaa_hrpt_bit_sync;
-typedef boost::shared_ptr<noaa_hrpt_bit_sync> noaa_hrpt_bit_sync_sptr;
-
-noaa_hrpt_bit_sync_sptr
-noaa_make_hrpt_bit_sync();
-
-class noaa_hrpt_bit_sync : public gr_block
-{
- friend noaa_hrpt_bit_sync_sptr noaa_make_hrpt_bit_sync();
- noaa_hrpt_bit_sync();
-
- bool d_mid_bit;
- unsigned char d_last_bit;
-
- public:
- int general_work(int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
-};
-
-#endif /* INCLUDED_NOAA_HRPT_BIT_SYNC_H */
gr_make_io_signature(1, 1, sizeof(short)))
{
set_output_multiple(6); // room for writing full sync when received
+ d_mid_bit = true;
+ d_last_bit = 0;
enter_idle();
}
int i = 0, j = 0;
while (i < ninputs && j < noutput_items) {
char bit = in[i++];
-
- switch (d_state) {
- case ST_IDLE:
- d_shifter = (d_shifter << 1) | bit; // MSB transmitted first
-
- if ((d_shifter & 0x0FFFFFFFFFFFFFFFLL) == HRPT_MINOR_FRAME_SYNC) {
- fprintf(stderr, "SYNC #%i", frames_seen++);
- out[j++] = SYNC1;
- out[j++] = SYNC2;
- out[j++] = SYNC3;
- out[j++] = SYNC4;
- out[j++] = SYNC5;
- out[j++] = SYNC6;
- enter_synced();
- }
- break;
-
- case ST_SYNCED:
- d_word = (d_word << 1) | bit; // MSB transmitted first
- if (--d_bit_count == 0) {
- out[j++] = d_word;
- d_word = 0;
- d_bit_count = HRPT_BITS_PER_WORD;
- if (--d_word_count == 0) {
- fprintf(stderr, "...done\n");
- enter_idle();
+ char diff = bit^d_last_bit;
+ d_last_bit = bit;
+
+ // Wait for transition if not synced, otherwise, alternate bits
+ if (d_mid_bit && (diff | (d_state == ST_SYNCED))) {
+ switch (d_state) {
+ case ST_IDLE:
+ d_shifter = (d_shifter << 1) | bit; // MSB transmitted first
+
+ if ((d_shifter & 0x0FFFFFFFFFFFFFFFLL) == HRPT_MINOR_FRAME_SYNC) {
+ fprintf(stderr, "SYNC #%i", frames_seen++);
+ out[j++] = SYNC1;
+ out[j++] = SYNC2;
+ out[j++] = SYNC3;
+ out[j++] = SYNC4;
+ out[j++] = SYNC5;
+ out[j++] = SYNC6;
+ enter_synced();
}
+ break;
+
+ case ST_SYNCED:
+ d_word = (d_word << 1) | bit; // MSB transmitted first
+ if (--d_bit_count == 0) {
+ out[j++] = d_word;
+ d_word = 0;
+ d_bit_count = HRPT_BITS_PER_WORD;
+ if (--d_word_count == 0) {
+ fprintf(stderr, "...done\n");
+ enter_idle();
+ }
+ }
+ break;
+
+ default:
+ throw std::runtime_error("noaa_hrpt_deframer: bad state\n");
}
- break;
- default:
- throw std::runtime_error("noaa_hrpt_deframer: bad state\n");
+ d_mid_bit = false;
+ }
+ else {
+ d_mid_bit = true;
}
}
noaa_hrpt_deframer();
unsigned int d_state;
+ bool d_mid_bit;
+ unsigned char d_last_bit;
unsigned int d_bit_count;
unsigned int d_word_count;
unsigned long long d_shifter; // 60 bit sync word
# additional SWIG files to be installed
noaa_swig_swiginclude_headers = \
- noaa_hrpt_bit_sync.i \
noaa_hrpt_decoder.i \
noaa_hrpt_deframer.i \
noaa_hrpt_pll_cf.i
+++ /dev/null
-/* -*- 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_bit_sync)
-
-noaa_hrpt_bit_sync_sptr
-noaa_make_hrpt_bit_sync();
-
-class noaa_hrpt_bit_sync : public gr_sync_block
-{
-private:
- noaa_hrpt_bit_sync();
-};
%include "gnuradio.i"
%{
-#include <noaa_hrpt_bit_sync.h>
#include <noaa_hrpt_decoder.h>
#include <noaa_hrpt_deframer.h>
#include <noaa_hrpt_pll_cf.h>
%}
-%include "noaa_hrpt_bit_sync.i"
%include "noaa_hrpt_decoder.i"
%include "noaa_hrpt_deframer.i"
%include "noaa_hrpt_pll_cf.i"