summaryrefslogtreecommitdiff
path: root/gr-digital/include/digital
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-08-17 22:31:02 -0400
committerTom Rondeau <trondeau@vt.edu>2012-08-17 22:31:02 -0400
commit5a92a70e6e4c9dd3a92055a772e01a9dee2df255 (patch)
tree40411983e1b189dae5cc189a0a734476df4c9170 /gr-digital/include/digital
parent76a6f912706313fdc256b09aa17eeaf275e1fbc4 (diff)
digital: converted OFDM blocks to new style.
Diffstat (limited to 'gr-digital/include/digital')
-rw-r--r--gr-digital/include/digital/CMakeLists.txt12
-rw-r--r--gr-digital/include/digital/ofdm_cyclic_prefixer.h50
-rw-r--r--gr-digital/include/digital/ofdm_frame_acquisition.h82
-rw-r--r--gr-digital/include/digital/ofdm_frame_sink.h61
-rw-r--r--gr-digital/include/digital/ofdm_insert_preamble.h76
-rw-r--r--gr-digital/include/digital/ofdm_mapper_bcv.h58
-rw-r--r--gr-digital/include/digital/ofdm_sampler.h50
7 files changed, 383 insertions, 6 deletions
diff --git a/gr-digital/include/digital/CMakeLists.txt b/gr-digital/include/digital/CMakeLists.txt
index d22f5ad372..d8e17546ed 100644
--- a/gr-digital/include/digital/CMakeLists.txt
+++ b/gr-digital/include/digital/CMakeLists.txt
@@ -106,12 +106,12 @@ install(FILES
metric_type.h
mpsk_receiver_cc.h
mpsk_snr_est_cc.h
-# ofdm_cyclic_prefixer.h
-# ofdm_frame_acquisition.h
-# ofdm_frame_sink.h
-# ofdm_insert_preamble.h
-# ofdm_mapper_bcv.h
-# ofdm_sampler.h
+ ofdm_cyclic_prefixer.h
+ ofdm_frame_acquisition.h
+ ofdm_frame_sink.h
+ ofdm_insert_preamble.h
+ ofdm_mapper_bcv.h
+ ofdm_sampler.h
packet_sink.h
pfb_clock_sync_ccf.h
pfb_clock_sync_fff.h
diff --git a/gr-digital/include/digital/ofdm_cyclic_prefixer.h b/gr-digital/include/digital/ofdm_cyclic_prefixer.h
new file mode 100644
index 0000000000..142afc620d
--- /dev/null
+++ b/gr-digital/include/digital/ofdm_cyclic_prefixer.h
@@ -0,0 +1,50 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004-2006,2011,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_CYCLIC_PREFIXER_H
+#define INCLUDED_DIGITAL_OFDM_CYCLIC_PREFIXER_H
+
+#include <digital/api.h>
+#include <gr_sync_interpolator.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief adds a cyclic prefix vector to an input size long ofdm
+ * symbol(vector) and converts vector to a stream output_size
+ * long.
+ * \ingroup ofdm_blk
+ */
+ class DIGITAL_API ofdm_cyclic_prefixer : virtual public gr_sync_interpolator
+ {
+ public:
+ // gr::digital::ofdm_cyclic_prefixer::sptr
+ typedef boost::shared_ptr<ofdm_cyclic_prefixer> sptr;
+
+ static sptr make(size_t input_size, size_t output_size);
+ };
+
+ } /* namespace digital */
+} /* namespace gr */
+
+#endif /* INCLUDED_DIGITAL_OFDM_CYCLIC_PREFIXER_H */
diff --git a/gr-digital/include/digital/ofdm_frame_acquisition.h b/gr-digital/include/digital/ofdm_frame_acquisition.h
new file mode 100644
index 0000000000..a255aa1801
--- /dev/null
+++ b/gr-digital/include/digital/ofdm_frame_acquisition.h
@@ -0,0 +1,82 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,2007,2011,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_FRAME_ACQUISITION_H
+#define INCLUDED_DIGITAL_OFDM_FRAME_ACQUISITION_H
+
+#include <digital/api.h>
+#include <gr_block.h>
+#include <vector>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief take a vector of complex constellation points in from an
+ * FFT and performs a correlation and equalization.
+ * \ingroup demodulation_blk
+ * \ingroup ofdm_blk
+ *
+ * This block takes the output of an FFT of a received OFDM symbol
+ * and finds the start of a frame based on two known symbols. It
+ * also looks at the surrounding bins in the FFT output for the
+ * correlation in case there is a large frequency shift in the
+ * data. This block assumes that the fine frequency shift has
+ * already been corrected and that the samples fall in the middle
+ * of one FFT bin.
+ *
+ * It then uses one of those known symbols to estimate the channel
+ * response over all subcarriers and does a simple 1-tap
+ * equalization on all subcarriers. This corrects for the phase
+ * and amplitude distortion caused by the channel.
+ */
+ class DIGITAL_API ofdm_frame_acquisition : virtual public gr_block
+ {
+ public:
+ // gr::digital::ofdm_frame_acquisition::sptr
+ typedef boost::shared_ptr<ofdm_frame_acquisition> sptr;
+
+ /*!
+ * Build an OFDM correlator and equalizer.
+ *
+ * \param occupied_carriers The number of subcarriers with data in the received symbol
+ * \param fft_length The size of the FFT vector (occupied_carriers + unused carriers)
+ * \param cplen The length of the cycle prefix
+ * \param known_symbol A vector of complex numbers representing a known symbol at the
+ * start of a frame (usually a BPSK PN sequence)
+ * \param max_fft_shift_len Set's the maximum distance you can look between bins for correlation
+ */
+ static sptr make(unsigned int occupied_carriers, unsigned int fft_length,
+ unsigned int cplen,
+ const std::vector<gr_complex> &known_symbol,
+ unsigned int max_fft_shift_len);
+
+ /*!
+ * \brief Return an estimate of the SNR of the channel
+ */
+ virtual float snr() = 0;
+ };
+
+ } /* namespace digital */
+} /* namespace gr */
+
+#endif /* INCLUDED_DIGITAL_OFDM_FRAME_ACQUISITION_H */
diff --git a/gr-digital/include/digital/ofdm_frame_sink.h b/gr-digital/include/digital/ofdm_frame_sink.h
new file mode 100644
index 0000000000..64590ca980
--- /dev/null
+++ b/gr-digital/include/digital/ofdm_frame_sink.h
@@ -0,0 +1,61 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007,2011,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_FRAME_SINK_H
+#define INCLUDED_DIGITAL_OFDM_FRAME_SINK_H
+
+#include <digital/api.h>
+#include <gr_sync_block.h>
+#include <gr_msg_queue.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief Takes an OFDM symbol in, demaps it into bits of 0's and
+ * 1's, packs them into packets, and sends to to a message queue
+ * sink.
+ * \ingroup sink_blk
+ * \ingroup ofdm_blk
+ *
+ * NOTE: The mod input parameter simply chooses a pre-defined
+ * demapper/slicer. Eventually, we want to be able to pass in a
+ * reference to an object to do the demapping and slicing for a
+ * given modulation type.
+ */
+ class DIGITAL_API ofdm_frame_sink : virtual public gr_sync_block
+ {
+ public:
+ // gr::digital::ofdm_frame_sink::sptr
+ typedef boost::shared_ptr<ofdm_frame_sink> sptr;
+
+ static sptr make(const std::vector<gr_complex> &sym_position,
+ const std::vector<unsigned char> &sym_value_out,
+ gr_msg_queue_sptr target_queue,
+ unsigned int occupied_tones,
+ float phase_gain, float freq_gain);
+ };
+
+ } /* namespace digital */
+} /* namespace gr */
+
+#endif /* INCLUDED_GR_OFDM_FRAME_SINK_H */
diff --git a/gr-digital/include/digital/ofdm_insert_preamble.h b/gr-digital/include/digital/ofdm_insert_preamble.h
new file mode 100644
index 0000000000..05b760ded8
--- /dev/null
+++ b/gr-digital/include/digital/ofdm_insert_preamble.h
@@ -0,0 +1,76 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007,2011,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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef INCLUDED_DIGITAL_OFDM_INSERT_PREAMBLE_H
+#define INCLUDED_DIGITAL_OFDM_INSERT_PREAMBLE_H
+
+#include <digital/api.h>
+#include <gr_block.h>
+#include <vector>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief insert "pre-modulated" preamble symbols before each payload.
+ * \ingroup sync_blk
+ * \ingroup ofdm_blk
+ *
+ * <pre>
+ * input 1: stream of vectors of gr_complex [fft_length]
+ * These are the modulated symbols of the payload.
+ *
+ * input 2: stream of char. The LSB indicates whether the corresponding
+ * symbol on input 1 is the first symbol of the payload or not.
+ * It's a 1 if the corresponding symbol is the first symbol,
+ * otherwise 0.
+ *
+ * N.B., this implies that there must be at least 1 symbol in the payload.
+ *
+ *
+ * output 1: stream of vectors of gr_complex [fft_length]
+ * These include the preamble symbols and the payload symbols.
+ *
+ * output 2: stream of char. The LSB indicates whether the corresponding
+ * symbol on input 1 is the first symbol of a packet (i.e., the
+ * first symbol of the preamble.) It's a 1 if the corresponding
+ * symbol is the first symbol, otherwise 0.
+ * </pre>
+ *
+ * \param fft_length length of each symbol in samples.
+ * \param preamble vector of symbols that represent the pre-modulated preamble.
+ */
+ class DIGITAL_API ofdm_insert_preamble : virtual public gr_block
+ {
+ public:
+ // gr::digital::ofdm_insert_preamble::sptr
+ typedef boost::shared_ptr<ofdm_insert_preamble> sptr;
+
+ static sptr make(int fft_length,
+ const std::vector<std::vector<gr_complex> > &preamble);
+
+ virtual void enter_preamble() = 0;
+ };
+
+ } /* namespace digital */
+} /* namespace gr */
+
+#endif /* INCLUDED_DIGITAL_OFDM_INSERT_PREAMBLE_H */
diff --git a/gr-digital/include/digital/ofdm_mapper_bcv.h b/gr-digital/include/digital/ofdm_mapper_bcv.h
new file mode 100644
index 0000000000..eff2d79930
--- /dev/null
+++ b/gr-digital/include/digital/ofdm_mapper_bcv.h
@@ -0,0 +1,58 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,2007,2011,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_MAPPER_BCV_H
+#define INCLUDED_DIGITAL_OFDM_MAPPER_BCV_H
+
+#include <digital/api.h>
+#include <gr_sync_block.h>
+#include <gr_msg_queue.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief take a stream of bytes in and map to a vector of complex
+ * constellation points suitable for IFFT input to be used in an
+ * ofdm modulator. Abstract class must be subclassed with
+ * specific mapping.
+ * \ingroup modulation_blk
+ * \ingroup ofdm_blk
+ */
+ class DIGITAL_API ofdm_mapper_bcv : virtual public gr_sync_block
+ {
+ public:
+ // gr::digital::ofdm_mapper_bcv::sptr
+ typedef boost::shared_ptr<ofdm_mapper_bcv> sptr;
+
+ static sptr make(const std::vector<gr_complex> &constellation,
+ unsigned msgq_limit,
+ unsigned occupied_carriers,
+ unsigned int fft_length);
+
+ virtual gr_msg_queue_sptr msgq() const = 0;
+ };
+
+ } /* namespace digital */
+} /* namespace gr */
+
+#endif /* INCLUDED_DIGITAL_OFDM_MAPPER_BCV_H */
diff --git a/gr-digital/include/digital/ofdm_sampler.h b/gr-digital/include/digital/ofdm_sampler.h
new file mode 100644
index 0000000000..4d6099a22c
--- /dev/null
+++ b/gr-digital/include/digital/ofdm_sampler.h
@@ -0,0 +1,50 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007,2011,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_SAMPLER_H
+#define INCLUDED_DIGITAL_OFDM_SAMPLER_H
+
+#include <digital/api.h>
+#include <gr_sync_block.h>
+
+namespace gr {
+ namespace digital {
+
+ /*!
+ * \brief does the rest of the OFDM stuff
+ * \ingroup ofdm_blk
+ */
+ class DIGITAL_API ofdm_sampler : virtual public gr_block
+ {
+ public:
+ // gr::digital::ofdm_sampler::sptr
+ typedef boost::shared_ptr<ofdm_sampler> sptr;
+
+ static sptr make(unsigned int fft_length,
+ unsigned int symbol_length,
+ unsigned int timeout);
+ };
+
+ } /* namespace digital */
+} /* namespace gr */
+
+#endif /* INCLUDED_DIGITAL_OFDM_SAMPLER_H */