GNU Radio's GFDM Package
preamble_channel_estimator_cc.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2017 Johannes Demel.
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21
22#ifndef INCLUDED_GFDM_PREAMBLE_CHANNEL_ESTIMATOR_CC_H
23#define INCLUDED_GFDM_PREAMBLE_CHANNEL_ESTIMATOR_CC_H
24
25//#include <gfdm/api.h>
26
27#include <complex>
28#include <vector>
29#include <boost/shared_ptr.hpp>
30#include <fftw3.h>
31#include <stdexcept>
32
33#include "gfdm_kernel_utils.h"
34
35namespace gr {
36 namespace gfdm {
37
38 /*!
39 * \brief <+description+>
40 *
41 */
43 {
44 public:
45 typedef boost::shared_ptr<preamble_channel_estimator_cc> sptr;
46
47 preamble_channel_estimator_cc(int timeslots, int fft_len, int active_subcarriers, bool is_dc_free, int which_estimator, std::vector<gfdm_complex> preamble);
49
50 void estimate_preamble_channel(gfdm_complex* fd_preamble_channel, const gfdm_complex* rx_preamble);
51 int fft_len(){ return d_fft_len;};
52 int timeslots(){ return d_timeslots;};
53 int frame_len(){return d_timeslots * d_fft_len;};
54 int active_subcarriers(){ return d_active_subcarriers;};
55 bool is_dc_free(){ return d_is_dc_free;};
56 std::vector<float> preamble_filter_taps();
57
58 void filter_preamble_estimate(gfdm_complex* filtered, const gfdm_complex* estimate);
59
60 void interpolate_frame(gfdm_complex* frame_estimate, const gfdm_complex* estimate);
61
62 void estimate_frame(gfdm_complex* frame_estimate, const gfdm_complex* rx_preamble);
63
64 void prepare_for_zf(gfdm_complex* transformed_frame, const gfdm_complex* frame_estimate);
65
66 private:
67 int d_timeslots;
68 int d_fft_len;
69 int d_active_subcarriers;
70 bool d_is_dc_free;
71 int d_which_estimator;
72
73 gfdm_complex* d_preamble_fft_in;
74 gfdm_complex* d_preamble_fft_out;
75 fftwf_plan d_preamble_fft_plan;
76
77 gfdm_complex* d_inv_freq_preamble0;
78 gfdm_complex* d_inv_freq_preamble1;
79 gfdm_complex* d_intermediate_channel_estimate;
80 void initialize_inv_freq_preamble(gfdm_complex* p_out, const gfdm_complex* p_preamble_part);
81 void estimate_fftlen_preamble_channel(gfdm_complex* p_out, const gfdm_complex* rx_samples, const gfdm_complex* fd_ref_samples);
82
83 int d_n_gaussian_taps;
84 float* d_gaussian_taps;
85 void initialize_gaussian_filter(float* taps, const float sigma_sq, const int n_taps);
86
87 gfdm_complex* d_filter_intermediate;
88 gfdm_complex* d_preamble_estimate;
89 gfdm_complex* d_filtered_estimate;
90 gfdm_complex* d_one_reference;
91
92
93
94 };
95
96 } // namespace gfdm
97} // namespace gr
98
99#endif /* INCLUDED_GFDM_PREAMBLE_CHANNEL_ESTIMATOR_CC_H */
100
<+description+>
Definition: gfdm_kernel_utils.h:40
std::complex< float > gfdm_complex
Definition: gfdm_kernel_utils.h:42
<+description+>
Definition: preamble_channel_estimator_cc.h:43
void estimate_frame(gfdm_complex *frame_estimate, const gfdm_complex *rx_preamble)
int frame_len()
Definition: preamble_channel_estimator_cc.h:53
preamble_channel_estimator_cc(int timeslots, int fft_len, int active_subcarriers, bool is_dc_free, int which_estimator, std::vector< gfdm_complex > preamble)
void prepare_for_zf(gfdm_complex *transformed_frame, const gfdm_complex *frame_estimate)
bool is_dc_free()
Definition: preamble_channel_estimator_cc.h:55
int fft_len()
Definition: preamble_channel_estimator_cc.h:51
void estimate_preamble_channel(gfdm_complex *fd_preamble_channel, const gfdm_complex *rx_preamble)
int active_subcarriers()
Definition: preamble_channel_estimator_cc.h:54
std::vector< float > preamble_filter_taps()
boost::shared_ptr< preamble_channel_estimator_cc > sptr
Definition: preamble_channel_estimator_cc.h:45
void interpolate_frame(gfdm_complex *frame_estimate, const gfdm_complex *estimate)
int timeslots()
Definition: preamble_channel_estimator_cc.h:52
void filter_preamble_estimate(gfdm_complex *filtered, const gfdm_complex *estimate)
Definition: add_cyclic_prefix_cc.h:30