diff options
author | Martin Braun <martin.braun@kit.edu> | 2013-04-19 12:58:35 +0200 |
---|---|---|
committer | Martin Braun <martin.braun@kit.edu> | 2013-05-11 13:50:34 +0200 |
commit | 7be24afbf8857a5e827fb536a80d7a83e7b6aa31 (patch) | |
tree | c76cafea7b2d33b0f0de615242d2d48004bc4f79 /gr-digital/include | |
parent | 728c6e2138d5eb4f0814dcd3d03c65e628746eab (diff) |
digital: OFDM passes all tests
Diffstat (limited to 'gr-digital/include')
-rw-r--r-- | gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h | 18 | ||||
-rw-r--r-- | gr-digital/include/digital/ofdm_serializer_vcc.h | 7 | ||||
-rw-r--r-- | gr-digital/include/digital_ofdm_chanest_vcvc.h | 4 | ||||
-rw-r--r-- | gr-digital/include/digital_ofdm_equalizer_base.h | 4 | ||||
-rw-r--r-- | gr-digital/include/digital_ofdm_equalizer_static.h | 10 | ||||
-rw-r--r-- | gr-digital/include/digital_ofdm_sync_sc_cfb.h | 9 |
6 files changed, 37 insertions, 15 deletions
diff --git a/gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h b/gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h index 262a9b430..cd1b943f4 100644 --- a/gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h +++ b/gr-digital/include/digital/ofdm_frame_equalizer_vcvc.h @@ -34,9 +34,19 @@ namespace gr { * \brief OFDM frame equalizer * \ingroup ofdm_blk * - * Performs equalization in one or two dimensions on a tagged OFDM frame. + * This does two things: + * First, it removes the coarse carrier offset. If a tag is found on the first + * item with the key 'ofdm_sync_carr_offset', this is interpreted as the coarse + * frequency offset in number of carriers. + * Next, it performs equalization in one or two dimensions on a tagged OFDM frame. + * The actual equalization is done by a ofdm_frame_equalizer object, outside of + * the block. + * + * Note that the tag with the coarse carrier offset is not removed. Blocks + * downstream from this block must not attempt to also correct this offset. + * * Input: a tagged series of OFDM symbols. - * Output: The same as the input, but equalized. + * Output: The same as the input, but equalized and frequency-corrected. */ class DIGITAL_API ofdm_frame_equalizer_vcvc : virtual public gr_tagged_stream_block { @@ -45,6 +55,7 @@ namespace gr { /*! * \param equalizer The equalizer object that will do the actual work + * \param cp_len Length of the cyclic prefix in samples (required to correct the frequency offset) * \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 @@ -53,7 +64,8 @@ namespace gr { */ static sptr make( digital_ofdm_equalizer_base_sptr equalizer, - const std::string &len_tag_key = "frame_len", + int cp_len, + const std::string &len_tag_key="frame_len", bool propagate_channel_state=false, int fixed_frame_len=0 ); diff --git a/gr-digital/include/digital/ofdm_serializer_vcc.h b/gr-digital/include/digital/ofdm_serializer_vcc.h index 3893d6674..fde2458b6 100644 --- a/gr-digital/include/digital/ofdm_serializer_vcc.h +++ b/gr-digital/include/digital/ofdm_serializer_vcc.h @@ -45,6 +45,9 @@ namespace gr { * output items, and the frame length specifies the exact number of * consumed input items. * + * It is possible to correct a carrier offset in this function by passing + * another tag with said offset. + * * Input: Complex vectors of length \p fft_len * Output: Complex scalars, in the same order as specified in occupied_carriers. */ @@ -59,6 +62,7 @@ namespace gr { * \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 carr_offset_key When this block should correct a carrier offset, specify the tag key of the offset here (not necessary if following an ofdm_frame_equalizer_vcvc) * \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( @@ -67,6 +71,7 @@ namespace gr { const std::string &len_tag_key="frame_len", const std::string &packet_len_tag_key="", int symbols_skipped=0, + const std::string &carr_offset_key="", bool input_is_shifted=true ); @@ -74,12 +79,14 @@ namespace gr { * \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 carr_offset_key When this block should correct a carrier offset, specify the tag key of the offset here (not necessary if following an ofdm_frame_equalizer_vcvc) * \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, + const std::string &carr_offset_key="", bool input_is_shifted=true ); }; diff --git a/gr-digital/include/digital_ofdm_chanest_vcvc.h b/gr-digital/include/digital_ofdm_chanest_vcvc.h index 73516cd50..afea16994 100644 --- a/gr-digital/include/digital_ofdm_chanest_vcvc.h +++ b/gr-digital/include/digital_ofdm_chanest_vcvc.h @@ -74,7 +74,9 @@ digital_make_ofdm_chanest_vcvc ( * 'ofdm_sync_carr_offset' (integer), the coarse frequency offset as number of carriers, * and 'ofdm_sync_eq_taps' (complex vector). * Any tags attached to the synchronisation symbols are attached to the first data - * symbol. All other tags are propagated normally. + * symbol. All other tags are propagated as expected. + * + * Note: The vector on ofdm_sync_eq_taps is already frequency-corrected, whereas the rest is not. * * This block assumes the frequency offset is even (i.e. an integer multiple of 2). * diff --git a/gr-digital/include/digital_ofdm_equalizer_base.h b/gr-digital/include/digital_ofdm_equalizer_base.h index a8697835f..2fc5cf52c 100644 --- a/gr-digital/include/digital_ofdm_equalizer_base.h +++ b/gr-digital/include/digital_ofdm_equalizer_base.h @@ -42,14 +42,12 @@ class DIGITAL_API digital_ofdm_equalizer_base : public boost::enable_shared_from { protected: int d_fft_len; - int d_carr_offset; public: digital_ofdm_equalizer_base(int fft_len); ~digital_ofdm_equalizer_base(); virtual void reset() = 0; - void set_carrier_offset(int offset) { d_carr_offset = offset; }; virtual void equalize( gr_complex *frame, int n_sym, @@ -71,7 +69,7 @@ class DIGITAL_API digital_ofdm_equalizer_1d_pilots : public digital_ofdm_equaliz //! If \p d_occupied_carriers[k][l] is true, symbol k, carrier l is carrying data. // (this is a different format than occupied_carriers!) std::vector<bool> d_occupied_carriers; - //! If \p d_pilot_carriers[k][l] is true, symbol k, carrier l is carrying data. + //! If \p d_pilot_carriers[k][l] is true, symbol k, carrier l is carrying a pilot symbol. // (this is a different format than pilot_carriers!) std::vector<std::vector<bool> > d_pilot_carriers; //! If \p d_pilot_carriers[k][l] is true, d_pilot_symbols[k][l] is its tx'd value. diff --git a/gr-digital/include/digital_ofdm_equalizer_static.h b/gr-digital/include/digital_ofdm_equalizer_static.h index 03ffd441e..dd8d48aad 100644 --- a/gr-digital/include/digital_ofdm_equalizer_static.h +++ b/gr-digital/include/digital_ofdm_equalizer_static.h @@ -70,11 +70,11 @@ class DIGITAL_API digital_ofdm_equalizer_static : public digital_ofdm_equalizer_ public: digital_ofdm_equalizer_static( int fft_len, - const std::vector<std::vector<int> > &occupied_carriers = std::vector<std::vector<int> >(), - const std::vector<std::vector<int> > &pilot_carriers = std::vector<std::vector<int> >(), - const std::vector<std::vector<gr_complex> > &pilot_symbols = std::vector<std::vector<gr_complex> >(), - int symbols_skipped = 0, - bool input_is_shifted = true); + const std::vector<std::vector<int> > &occupied_carriers, + const std::vector<std::vector<int> > &pilot_carriers, + const std::vector<std::vector<gr_complex> > &pilot_symbols, + int symbols_skipped, + bool input_is_shifted); ~digital_ofdm_equalizer_static(); /*! \brief Divide the input signal with the current channel state. diff --git a/gr-digital/include/digital_ofdm_sync_sc_cfb.h b/gr-digital/include/digital_ofdm_sync_sc_cfb.h index f58be3df5..26cf5b3de 100644 --- a/gr-digital/include/digital_ofdm_sync_sc_cfb.h +++ b/gr-digital/include/digital_ofdm_sync_sc_cfb.h @@ -30,9 +30,12 @@ typedef boost::shared_ptr<digital_ofdm_sync_sc_cfb> digital_ofdm_sync_sc_cfb_spt /*! \param fft_len FFT length * \param cp_len Length of the guard interval (cyclic prefix) in samples + * \param use_even_carriers If true, the carriers in the sync preamble are occupied such + * that the even carriers are used (0, 2, 4, ...). If you use all + * carriers, that would include the DC carrier, so be careful. */ DIGITAL_API digital_ofdm_sync_sc_cfb_sptr -digital_make_ofdm_sync_sc_cfb (int fft_len, int cp_len); +digital_make_ofdm_sync_sc_cfb (int fft_len, int cp_len, bool use_even_carriers=false); /*! * \brief Schmidl & Cox synchronisation for OFDM @@ -68,8 +71,8 @@ digital_make_ofdm_sync_sc_cfb (int fft_len, int cp_len); class DIGITAL_API digital_ofdm_sync_sc_cfb : public gr_hier_block2 { private: - friend DIGITAL_API digital_ofdm_sync_sc_cfb_sptr digital_make_ofdm_sync_sc_cfb (int fft_len, int cp_len); - digital_ofdm_sync_sc_cfb(int fft_len, int cp_len); + friend DIGITAL_API digital_ofdm_sync_sc_cfb_sptr digital_make_ofdm_sync_sc_cfb (int fft_len, int cp_len, bool use_even_carriers); + digital_ofdm_sync_sc_cfb(int fft_len, int cp_len, bool use_even_carriers); public: ~digital_ofdm_sync_sc_cfb(); |