preamble_channel_estimator_cc.h
Go to the documentation of this file.
/* -*- c++ -*- */
/*
* Copyright 2017 Johannes Demel.
*
* This 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.
*
* This software 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 software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_GFDM_PREAMBLE_CHANNEL_ESTIMATOR_CC_H
#define INCLUDED_GFDM_PREAMBLE_CHANNEL_ESTIMATOR_CC_H
//#include <gfdm/api.h>
#include <complex>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <fftw3.h>
#include <stdexcept>
#include "gfdm_kernel_utils.h"
namespace gr {
namespace gfdm {
/*!
* \brief <+description+>
*
*/
class preamble_channel_estimator_cc : public gfdm_kernel_utils
{
public:
typedef boost::shared_ptr<preamble_channel_estimator_cc> sptr;
preamble_channel_estimator_cc(int timeslots, int fft_len, int active_subcarriers, bool is_dc_free, int which_estimator, std::vector<gfdm_complex> preamble);
~preamble_channel_estimator_cc();
void estimate_preamble_channel(gfdm_complex* fd_preamble_channel, const gfdm_complex* rx_preamble);
int fft_len(){ return d_fft_len;};
int timeslots(){ return d_timeslots;};
int frame_len(){return d_timeslots * d_fft_len;};
int active_subcarriers(){ return d_active_subcarriers;};
bool is_dc_free(){ return d_is_dc_free;};
std::vector<float> preamble_filter_taps();
void filter_preamble_estimate(gfdm_complex* filtered, const gfdm_complex* estimate);
void interpolate_frame(gfdm_complex* frame_estimate, const gfdm_complex* estimate);
void estimate_frame(gfdm_complex* frame_estimate, const gfdm_complex* rx_preamble);
void prepare_for_zf(gfdm_complex* transformed_frame, const gfdm_complex* frame_estimate);
private:
int d_timeslots;
int d_fft_len;
int d_active_subcarriers;
bool d_is_dc_free;
int d_which_estimator;
gfdm_complex* d_preamble_fft_in;
gfdm_complex* d_preamble_fft_out;
fftwf_plan d_preamble_fft_plan;
gfdm_complex* d_inv_freq_preamble0;
gfdm_complex* d_inv_freq_preamble1;
gfdm_complex* d_intermediate_channel_estimate;
void initialize_inv_freq_preamble(gfdm_complex* p_out, const gfdm_complex* p_preamble_part);
void estimate_fftlen_preamble_channel(gfdm_complex* p_out, const gfdm_complex* rx_samples, const gfdm_complex* fd_ref_samples);
int d_n_gaussian_taps;
float* d_gaussian_taps;
void initialize_gaussian_filter(float* taps, const float sigma_sq, const int n_taps);
gfdm_complex* d_filter_intermediate;
gfdm_complex* d_preamble_estimate;
gfdm_complex* d_filtered_estimate;
gfdm_complex* d_one_reference;
};
} // namespace gfdm
} // namespace gr
#endif /* INCLUDED_GFDM_PREAMBLE_CHANNEL_ESTIMATOR_CC_H */
gr::gfdm::gfdm_kernel_utils
<+description+>
Definition gfdm_kernel_utils.h:40
gr::gfdm::gfdm_kernel_utils::gfdm_complex
std::complex< float > gfdm_complex
Definition gfdm_kernel_utils.h:42
gr::gfdm::preamble_channel_estimator_cc
<+description+>
Definition preamble_channel_estimator_cc.h:43
gr::gfdm::preamble_channel_estimator_cc::estimate_frame
void estimate_frame(gfdm_complex *frame_estimate, const gfdm_complex *rx_preamble)
gr::gfdm::preamble_channel_estimator_cc::~preamble_channel_estimator_cc
~preamble_channel_estimator_cc()
gr::gfdm::preamble_channel_estimator_cc::frame_len
int frame_len()
Definition preamble_channel_estimator_cc.h:53
gr::gfdm::preamble_channel_estimator_cc::preamble_channel_estimator_cc
preamble_channel_estimator_cc(int timeslots, int fft_len, int active_subcarriers, bool is_dc_free, int which_estimator, std::vector< gfdm_complex > preamble)
gr::gfdm::preamble_channel_estimator_cc::prepare_for_zf
void prepare_for_zf(gfdm_complex *transformed_frame, const gfdm_complex *frame_estimate)
gr::gfdm::preamble_channel_estimator_cc::is_dc_free
bool is_dc_free()
Definition preamble_channel_estimator_cc.h:55
gr::gfdm::preamble_channel_estimator_cc::fft_len
int fft_len()
Definition preamble_channel_estimator_cc.h:51
gr::gfdm::preamble_channel_estimator_cc::estimate_preamble_channel
void estimate_preamble_channel(gfdm_complex *fd_preamble_channel, const gfdm_complex *rx_preamble)
gr::gfdm::preamble_channel_estimator_cc::active_subcarriers
int active_subcarriers()
Definition preamble_channel_estimator_cc.h:54
gr::gfdm::preamble_channel_estimator_cc::preamble_filter_taps
std::vector< float > preamble_filter_taps()
gr::gfdm::preamble_channel_estimator_cc::sptr
boost::shared_ptr< preamble_channel_estimator_cc > sptr
Definition preamble_channel_estimator_cc.h:45
gr::gfdm::preamble_channel_estimator_cc::interpolate_frame
void interpolate_frame(gfdm_complex *frame_estimate, const gfdm_complex *estimate)
gr::gfdm::preamble_channel_estimator_cc::timeslots
int timeslots()
Definition preamble_channel_estimator_cc.h:52
gr::gfdm::preamble_channel_estimator_cc::filter_preamble_estimate
void filter_preamble_estimate(gfdm_complex *filtered, const gfdm_complex *estimate)
gfdm_kernel_utils.h
gr
Definition add_cyclic_prefix_cc.h:30