summaryrefslogtreecommitdiff
path: root/gr-digital/include/digital
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@kit.edu>2013-03-15 02:12:20 -0700
committerJohnathan Corgan <johnathan@corganlabs.com>2013-03-15 02:13:55 -0700
commitf968b36d4ed2b194111585605f9a1b5367638fb3 (patch)
treec5a18a3412aa3a4b2c89ede3a68d08ba7980401f /gr-digital/include/digital
parent86d05c838e2cfeb9a9c73a0e19668a45cc8b333c (diff)
Squash/rebased martin/ofdm-master onto trial merge branch
Conflicts: gr-blocks/include/blocks/CMakeLists.txt
Diffstat (limited to 'gr-digital/include/digital')
-rw-r--r--gr-digital/include/digital/CMakeLists.txt43
-rw-r--r--gr-digital/include/digital/api.h33
-rw-r--r--gr-digital/include/digital/header_payload_demux.h90
-rw-r--r--gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h63
-rw-r--r--gr-digital/include/digital/ofdm_serializer_vcc.h91
-rw-r--r--gr-digital/include/digital/packet_header_default.h101
-rw-r--r--gr-digital/include/digital/packet_header_ofdm.h83
-rw-r--r--gr-digital/include/digital/packet_headergenerator_bb.h57
-rw-r--r--gr-digital/include/digital/packet_headerparser_b.h65
-rw-r--r--gr-digital/include/digital/scale_tags.h58
-rw-r--r--gr-digital/include/digital/tagged_stream_check.h55
-rw-r--r--gr-digital/include/digital/ts_insert_zeros_cc.h55
12 files changed, 794 insertions, 0 deletions
diff --git a/gr-digital/include/digital/CMakeLists.txt b/gr-digital/include/digital/CMakeLists.txt
new file mode 100644
index 0000000000..7926ae3234
--- /dev/null
+++ b/gr-digital/include/digital/CMakeLists.txt
@@ -0,0 +1,43 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+########################################################################
+# generate helper scripts to expand templated files
+########################################################################
+include(GrPython)
+
+########################################################################
+# Install header files
+########################################################################
+install(FILES
+ api.h
+ ofdm_frame_equalizer_vcvc.h
+ ofdm_serializer_vcc.h
+ packet_header_default.h
+ packet_header_ofdm.h
+ packet_headergenerator_bb.h
+ scale_tags.h
+ tagged_stream_check.h
+ ts_insert_zeros_cc.h
+ packet_headerparser_b.h
+ header_payload_demux.h
+ DESTINATION ${GR_INCLUDE_DIR}/gnuradio/digital
+ COMPONENT "digital_devel"
+)
+
diff --git a/gr-digital/include/digital/api.h b/gr-digital/include/digital/api.h
new file mode 100644
index 0000000000..0912f7e0d4
--- /dev/null
+++ b/gr-digital/include/digital/api.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_DIGITAL_API_H
+#define INCLUDED_DIGITAL_API_H
+
+#include <gruel/attributes.h>
+
+#ifdef gnuradio_digital_EXPORTS
+# define DIGITAL_API __GR_ATTR_EXPORT
+#else
+# define DIGITAL_API __GR_ATTR_IMPORT
+#endif
+
+#endif /* INCLUDED_DIGITAL_API_H */
diff --git a/gr-digital/include/digital/header_payload_demux.h b/gr-digital/include/digital/header_payload_demux.h
new file mode 100644
index 0000000000..014e0304a2
--- /dev/null
+++ b/gr-digital/include/digital/header_payload_demux.h
@@ -0,0 +1,90 @@
+/* -*- c++ -*- */
+/* Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_DIGITAL_HEADER_PAYLOAD_DEMUX_H
+#define INCLUDED_DIGITAL_HEADER_PAYLOAD_DEMUX_H
+
+#include <digital/api.h>
+#include <gr_block.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief Header/Payload demuxer.
+ * \ingroup digital
+ *
+ * This block is designed to handle packets from a bursty transmission.
+ * Input 0 takes a continuous transmission of samples.
+ * If used, input 1 is a trigger signal. In this case, a 1 on input 1
+ * is a trigger. Otherwise, a tag with the key specified in \p trigger_tag_key
+ * is used as a trigger (its value is irrelevant).
+ *
+ * Until a trigger signal is detected, all samples are dropped onto the floor.
+ * Once a trigger is detected, a total of \p header_len items are copied to output 0.
+ * The block then stalls until it receives a message on the message port
+ * \p header_data. The message must be a PMT dictionary; all key/value pairs are
+ * copied as tags to the first item of the payload (which is assumed to be the
+ * first item after the header).
+ * The value corresponding to the key specified in \p length_tag_key is read
+ * and taken as the payload length. The payload, together with the header data
+ * as tags, is then copied to output 1.
+ *
+ * If specified, \p guard_interval items are discarded before every symbol.
+ * This is useful for demuxing bursts of OFDM signals.
+ *
+ * Any tags on the input stream are copied to the corresponding output *if* they're
+ * on an item that is propagated. Note that a tag on the header items is copied to the
+ * header stream; that means the header-parsing block must handle these tags if they
+ * should go on the payload.
+ * A special case are tags on items that make up the guard interval. These are copied
+ * to the first item of the following symbol.
+ */
+ class DIGITAL_API header_payload_demux : virtual public gr_block
+ {
+ public:
+ typedef boost::shared_ptr<header_payload_demux> sptr;
+
+ /*!
+ * \param header_len Number of symbols per header
+ * \param items_per_symbol Number of items per symbol
+ * \param guard_interval Number of items between two consecutive symbols
+ * \param length_tag_key Key of the frame length tag
+ * \param trigger_tag_key Key of the trigger tag
+ * \param output_symbols Output symbols (true) or items (false)?
+ * \param itemsize Item size (bytes per item)
+ */
+ static sptr make(
+ int header_len,
+ int items_per_symbol,
+ int guard_interval=0,
+ const std::string &length_tag_key="frame_len",
+ const std::string &trigger_tag_key="",
+ bool output_symbols=false,
+ size_t itemsize=sizeof(gr_complex)
+ );
+ };
+
+ } // namespace digital
+} // namespace gr
+
+#endif /* INCLUDED_DIGITAL_HEADER_PAYLOAD_DEMUX_H */
+
diff --git a/gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h b/gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h
new file mode 100644
index 0000000000..d5d526ddc3
--- /dev/null
+++ b/gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h
@@ -0,0 +1,63 @@
+/* -*- c++ -*- */
+/* Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef INCLUDED_OFDM_FRAME_EQUALIZER_VCVC_H
+#define INCLUDED_OFDM_FRAME_EQUALIZER_VCVC_H
+
+#include <digital_ofdm_equalizer_base.h>
+#include <digital/api.h>
+#include <gr_tagged_stream_block.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief OFDM frame equalizer
+ * \ingroup ofdm
+ *
+ * Performs equalization in one or two dimensions on a tagged OFDM frame.
+ * Input: a tagged series of OFDM symbols.
+ * Output: The same as the input, but equalized.
+ */
+ class DIGITAL_API ofdm_frame_equalizer_vcvc : virtual public gr_tagged_stream_block
+ {
+ public:
+ typedef boost::shared_ptr<ofdm_frame_equalizer_vcvc> sptr;
+
+ /*
+ * \param equalizer The equalizer object that will do the actual work
+ * \param len_tag_key Length tag key
+ * \param propagate_channel_state If true, the channel state after the last symbol
+ * will be added to the first symbol as a tag
+ */
+ static sptr make(
+ digital_ofdm_equalizer_base_sptr equalizer,
+ const std::string &len_tag_key = "frame_len",
+ bool propagate_channel_state=false
+ );
+ };
+
+ } // namespace digital
+} // namespace gr
+
+#endif /* INCLUDED_OFDM_FRAME_EQUALIZER_VCVC_H */
+
diff --git a/gr-digital/include/digital/ofdm_serializer_vcc.h b/gr-digital/include/digital/ofdm_serializer_vcc.h
new file mode 100644
index 0000000000..3893d6674e
--- /dev/null
+++ b/gr-digital/include/digital/ofdm_serializer_vcc.h
@@ -0,0 +1,91 @@
+/* -*- c++ -*- */
+/* Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_DIGITAL_OFDM_SERIALIZER_VCC_H
+#define INCLUDED_DIGITAL_OFDM_SERIALIZER_VCC_H
+
+#include <digital/api.h>
+#include <gr_tagged_stream_block.h>
+#include <digital_ofdm_carrier_allocator_cvc.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief Serializes complex modulations symbols from OFDM sub-carriers
+ * \ingroup ofdm_blk
+ *
+ * This is the inverse block to the carrier_allocator_cvc. It outputs the
+ * complex data symbols as a tagged stream, discarding the pilot symbols.
+ *
+ * If given, two different tags are parsed: The first key (\p len_tag_key)
+ * specifies the number of OFDM symbols in the frame at the input. The
+ * second key (\p packet_len_tag_key) specifies the number of complex symbols
+ * that are coded into this frame. If given, this second key is then used
+ * at the output, otherwise, \p len_tag_key is used.
+ * If both are given, the packet length specifies the maximum number of
+ * output items, and the frame length specifies the exact number of
+ * consumed input items.
+ *
+ * Input: Complex vectors of length \p fft_len
+ * Output: Complex scalars, in the same order as specified in occupied_carriers.
+ */
+ class DIGITAL_API ofdm_serializer_vcc : virtual public gr_tagged_stream_block
+ {
+ public:
+ typedef boost::shared_ptr<ofdm_serializer_vcc> sptr;
+
+ /*!
+ * \param fft_len FFT length
+ * \param occupied_carriers See ofdm_carrier_allocator_cvc.
+ * \param len_tag_key The key of the tag identifying the length of the input frame in OFDM symbols.
+ * \param packet_len_tag_key The key of the tag identifying the number of complex symbols in this packet.
+ * \param symbols_skipped If the first symbol is not allocated as in \p occupied_carriers[0], set this
+ * \param input_is_shifted If the input has the DC carrier on index 0 (i.e. it is not FFT shifted), set this to false
+ */
+ static sptr make(
+ int fft_len,
+ const std::vector<std::vector<int> > &occupied_carriers,
+ const std::string &len_tag_key="frame_len",
+ const std::string &packet_len_tag_key="",
+ int symbols_skipped=0,
+ bool input_is_shifted=true
+ );
+
+ /*!
+ * \param allocator The carrier allocator block of which this shall be the inverse
+ * \param packet_len_tag_key The key of the tag identifying the number of complex symbols in this packet.
+ * \param symbols_skipped If the first symbol is not allocated as in \p occupied_carriers[0], set this
+ * \param input_is_shifted If the input has the DC carrier on index 0 (i.e. it is not FFT shifted), set this to false
+ */
+ static sptr make(
+ const digital_ofdm_carrier_allocator_cvc_sptr &allocator,
+ const std::string &packet_len_tag_key="",
+ int symbols_skipped=0,
+ bool input_is_shifted=true
+ );
+ };
+
+ } // namespace digital
+} // namespace gr
+
+#endif /* INCLUDED_DIGITAL_OFDM_SERIALIZER_VCC_H */
+
diff --git a/gr-digital/include/digital/packet_header_default.h b/gr-digital/include/digital/packet_header_default.h
new file mode 100644
index 0000000000..a4158e728c
--- /dev/null
+++ b/gr-digital/include/digital/packet_header_default.h
@@ -0,0 +1,101 @@
+/* -*- c++ -*- */
+/* Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_DIGITAL_PACKET_HEADER_DEFAULT_H
+#define INCLUDED_DIGITAL_PACKET_HEADER_DEFAULT_H
+
+#include <gr_tags.h>
+#include <digital/api.h>
+#include <boost/enable_shared_from_this.hpp>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief <+description of block+>
+ * \ingroup digital
+ *
+ */
+ class DIGITAL_API packet_header_default : public boost::enable_shared_from_this<gr::digital::packet_header_default>
+ {
+ public:
+ typedef boost::shared_ptr<packet_header_default> sptr;
+
+ packet_header_default(
+ long header_len,
+ const std::string &len_tag_key="packet_len",
+ const std::string &num_tag_key="packet_num",
+ int bits_per_byte=1);
+ ~packet_header_default();
+
+ sptr base() { return shared_from_this(); };
+ sptr formatter() { return shared_from_this(); };
+
+ void set_header_num(unsigned header_num) { d_header_number = header_num; };
+ long header_len() { return d_header_len; };
+ pmt::pmt_t len_tag_key() { return d_len_tag_key; };
+
+ /* \brief Encodes the header information in the given tags into bits and places them into \p out
+ *
+ * Uses the following header format:
+ * Bits 0-11: The packet length (what was stored in the tag with key \p len_tag_key)
+ * Bits 12-27: The header number (counts up everytime this function is called)
+ * Bit 28: Even parity bit
+ * All other bits: Are set to zero
+ *
+ * If the header length is smaller than 29, bits are simply left out. For this
+ * reason, they always start with the LSB.
+ */
+ bool header_formatter(
+ long packet_len,
+ unsigned char *out,
+ const std::vector<gr_tag_t> &tags=std::vector<gr_tag_t>()
+ );
+
+ /* \brief Inverse function to header_formatter().
+ *
+ * Reads the bit stream in \in and writes a corresponding tag into \p tags.
+ *
+ */
+ bool header_parser(
+ const unsigned char *header,
+ std::vector<gr_tag_t> &tags);
+
+ static sptr make(
+ long header_len,
+ const std::string &len_tag_key="packet_len",
+ const std::string &num_tag_key="packet_num",
+ int bits_per_byte=1);
+
+ protected:
+ long d_header_len;
+ pmt::pmt_t d_len_tag_key;
+ pmt::pmt_t d_num_tag_key;
+ int d_bits_per_byte;
+ unsigned d_header_number;
+ unsigned d_mask;
+ };
+
+ } // namespace digital
+} // namespace gr
+
+#endif /* INCLUDED_DIGITAL_PACKET_HEADER_DEFAULT_H */
+
diff --git a/gr-digital/include/digital/packet_header_ofdm.h b/gr-digital/include/digital/packet_header_ofdm.h
new file mode 100644
index 0000000000..6c3453ed1d
--- /dev/null
+++ b/gr-digital/include/digital/packet_header_ofdm.h
@@ -0,0 +1,83 @@
+/* -*- c++ -*- */
+/* Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_DIGITAL_PACKET_HEADER_OFDM_H
+#define INCLUDED_DIGITAL_PACKET_HEADER_OFDM_H
+
+#include <vector>
+#include <digital/api.h>
+#include <digital/packet_header_default.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief Header utility for OFDM signals.
+ * \ingroup ofdm_blk
+ *
+ */
+ class DIGITAL_API packet_header_ofdm : public packet_header_default
+ {
+ public:
+ typedef boost::shared_ptr<packet_header_ofdm> sptr;
+
+ packet_header_ofdm(
+ const std::vector<std::vector<int> > &occupied_carriers,
+ int n_syms,
+ const std::string &len_tag_key="packet_len",
+ const std::string &frame_len_tag_key="frame_len",
+ const std::string &num_tag_key="packet_num",
+ int bits_per_sym=1);
+ ~packet_header_ofdm();
+
+ /* \brief Inverse function to header_formatter().
+ *
+ * Does the same as packet_header_default::header_parser(), but
+ * adds another tag that stores the number of OFDM symbols in the
+ * packet.
+ * Note that there is usually no linear connection between the number
+ * of OFDM symbols and the packet length, because, a packet might
+ * finish mid-OFDM-symbol.
+ */
+ bool header_parser(
+ const unsigned char *header,
+ std::vector<gr_tag_t> &tags);
+
+ static sptr make(
+ const std::vector<std::vector<int> > &occupied_carriers,
+ int n_syms,
+ const std::string &len_tag_key="packet_len",
+ const std::string &frame_len_tag_key="frame_len",
+ const std::string &num_tag_key="packet_num",
+ int bits_per_sym=1);
+
+
+ protected:
+ pmt::pmt_t d_frame_len_tag_key;
+ const std::vector<std::vector<int> > d_occupied_carriers; //! Which carriers/symbols carry data
+ int d_syms_per_set; //! Helper variable: Total number of elements in d_occupied_carriers
+ };
+
+ } // namespace digital
+} // namespace gr
+
+#endif /* INCLUDED_DIGITAL_PACKET_HEADER_OFDM_H */
+
diff --git a/gr-digital/include/digital/packet_headergenerator_bb.h b/gr-digital/include/digital/packet_headergenerator_bb.h
new file mode 100644
index 0000000000..8d92bf84ed
--- /dev/null
+++ b/gr-digital/include/digital/packet_headergenerator_bb.h
@@ -0,0 +1,57 @@
+/* -*- c++ -*- */
+/* Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_PACKET_HEADERGENERATOR_BB_H
+#define INCLUDED_PACKET_HEADERGENERATOR_BB_H
+
+#include <digital/api.h>
+#include <gr_tagged_stream_block.h>
+#include <digital/packet_header_default.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief Generates a header for a tagged, streamed packet.
+ * \ingroup digital
+ *
+ * Input: A tagged stream. The first element must have a tag with the key
+ * specified in len_tag_key, which hold the exact number of elements
+ * in the PDU.
+ * Output: An tagged stream of length header_len. The output is determined
+ * by a header formatter.
+ */
+ class DIGITAL_API packet_headergenerator_bb : virtual public gr_tagged_stream_block
+ {
+ public:
+ typedef boost::shared_ptr<packet_headergenerator_bb> sptr;
+
+ static sptr make(const packet_header_default::sptr &header_formatter);
+ static sptr make(
+ long header_len,
+ const std::string &len_tag_key = "packet_len");
+ };
+
+ } // namespace digital
+} // namespace gr
+
+#endif /* INCLUDED_PACKET_HEADERGENERATOR_BB_H */
+
diff --git a/gr-digital/include/digital/packet_headerparser_b.h b/gr-digital/include/digital/packet_headerparser_b.h
new file mode 100644
index 0000000000..a3db069cbd
--- /dev/null
+++ b/gr-digital/include/digital/packet_headerparser_b.h
@@ -0,0 +1,65 @@
+/* -*- c++ -*- */
+/* Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_DIGITAL_PACKET_HEADERPARSER_B_H
+#define INCLUDED_DIGITAL_PACKET_HEADERPARSER_B_H
+
+#include <digital/api.h>
+#include <gr_sync_block.h>
+#include <digital/packet_header_default.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief Post header metadata as a PMT
+ * \ingroup digital
+ *
+ * In a sense, this is the inverse block to packet_headergenerator_bb.
+ * The difference is, the parsed header is not output as a stream,
+ * but as a message.
+ *
+ * If only a header length is given, this block uses the default header
+ * format.
+ */
+ class DIGITAL_API packet_headerparser_b : virtual public gr_sync_block
+ {
+ public:
+ typedef boost::shared_ptr<packet_headerparser_b> sptr;
+
+ /*!
+ * \param header_formatter Header object. This should be the same as used for
+ * packet_headergenerator_bb.
+ */
+ static sptr make(const gr::digital::packet_header_default::sptr &header_formatter);
+
+ /*!
+ * \param header_len Number of bytes per header
+ * \param len_tag_key Length Tag Key
+ */
+ static sptr make(long header_len, const std::string &len_tag_key);
+ };
+
+ } // namespace digital
+} // namespace gr
+
+#endif /* INCLUDED_DIGITAL_PACKET_HEADERPARSER_B_H */
+
diff --git a/gr-digital/include/digital/scale_tags.h b/gr-digital/include/digital/scale_tags.h
new file mode 100644
index 0000000000..8a9e3efba4
--- /dev/null
+++ b/gr-digital/include/digital/scale_tags.h
@@ -0,0 +1,58 @@
+/* -*- c++ -*- */
+/* Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef INCLUDED_DIGITAL_SCALE_TAGS_H
+#define INCLUDED_DIGITAL_SCALE_TAGS_H
+
+#include <digital_ofdm_equalizer_base.h> // FIXME: Error without this line. No idea why.
+#include <digital/api.h>
+#include <gr_sync_block.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief <+description of block+>
+ * \ingroup block
+ *
+ */
+ class DIGITAL_API scale_tags : virtual public gr_sync_block
+ {
+ public:
+ typedef boost::shared_ptr<scale_tags> sptr;
+
+ /*!
+ * \brief Return a shared_ptr to a new instance of digital::scale_tags.
+ *
+ * To avoid accidental use of raw pointers, digital::scale_tags's
+ * constructor is in a private implementation
+ * class. digital::scale_tags::make is the public interface for
+ * creating new instances.
+ */
+ static sptr make(size_t itemsize, const std::string&, float scale_factor);
+ };
+
+ } // namespace digital
+} // namespace gr
+
+#endif /* INCLUDED_DIGITAL_SCALE_TAGS_H */
+
diff --git a/gr-digital/include/digital/tagged_stream_check.h b/gr-digital/include/digital/tagged_stream_check.h
new file mode 100644
index 0000000000..73b44a5bb9
--- /dev/null
+++ b/gr-digital/include/digital/tagged_stream_check.h
@@ -0,0 +1,55 @@
+/* -*- c++ -*- */
+/* Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef INCLUDED_DIGITAL_TAGGED_STREAM_CHECK_H
+#define INCLUDED_DIGITAL_TAGGED_STREAM_CHECK_H
+
+#include <digital_ofdm_equalizer_base.h> // FIXME: Error without this line. No idea why.
+#include <digital/api.h>
+#include <gr_sync_block.h>
+
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief Checks a tagged stream to make sure it's valid.
+ *
+ * \description
+ * Produces error messages if the tags in a tagged stream aren't where
+ * they should be.
+ *
+ * \ingroup digital
+ *
+ */
+ class DIGITAL_API tagged_stream_check : virtual public gr_sync_block
+ {
+ public:
+ typedef boost::shared_ptr<tagged_stream_check> sptr;
+ static sptr make(size_t itemsize, const std::string &lengthtagname);
+ };
+
+ } // namespace digital
+} // namespace gr
+
+#endif /* INCLUDED_DIGITAL_TAGGED_STREAM_CHECK_H */
+
diff --git a/gr-digital/include/digital/ts_insert_zeros_cc.h b/gr-digital/include/digital/ts_insert_zeros_cc.h
new file mode 100644
index 0000000000..299062eb50
--- /dev/null
+++ b/gr-digital/include/digital/ts_insert_zeros_cc.h
@@ -0,0 +1,55 @@
+/* -*- c++ -*- */
+/* Copyright 2012 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef INCLUDED_DIGITAL_TS_INSERT_ZEROS_CC_H
+#define INCLUDED_DIGITAL_TS_INSERT_ZEROS_CC_H
+
+#include <digital_ofdm_equalizer_base.h> // FIXME: Error without this line. No idea why.
+#include <digital/api.h>
+#include <gr_block.h>
+#include <string>
+
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief Inserts zeros between the packets of a tagged stream.
+ *
+ * \description
+ * Outputs zeros if a packet is not yet ready at the input, otherwise
+ * passes packets through.
+ *
+ * \ingroup digital
+ *
+ */
+ class DIGITAL_API ts_insert_zeros_cc : virtual public gr_block
+ {
+ public:
+ typedef boost::shared_ptr<ts_insert_zeros_cc> sptr;
+ static sptr make(const std::string &lengthtagname);
+ };
+ } // namespace digital
+} // namespace gr
+
+#endif /* INCLUDED_DIGITAL_TS_INSERT_ZEROS_CC_H */
+