GNU Radio's GFDM Package
modulator_kernel_cc.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2016 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_MODULATOR_KERNEL_CC_H
23#define INCLUDED_GFDM_MODULATOR_KERNEL_CC_H
24
25#include <complex>
26#include <vector>
27#include <boost/shared_ptr.hpp>
28#include <fftw3.h>
29#include <stdexcept>
30
31namespace gr {
32 namespace gfdm {
33
34
35 /*!
36 * \brief modulate a GFDM block.
37 * This class initializes and performs all operations necessary to modulate a GFDM block.
38 *
39 */
41 {
42 public:
43 typedef std::complex<float> gfdm_complex;
44 typedef boost::shared_ptr<modulator_kernel_cc> sptr;
45
46 modulator_kernel_cc(int n_timeslots, int n_subcarriers, int overlap, std::vector<gfdm_complex> frequency_taps);
48 void generic_work(gfdm_complex* p_out, const gfdm_complex* p_in);
49 int block_size(){return d_n_subcarriers * d_n_timeslots;};
50 std::vector<gfdm_complex> filter_taps();
51
52 private:
53 int d_n_timeslots;
54 int d_n_subcarriers;
55 int d_ifft_len;
56 int d_overlap;
57 gfdm_complex* d_filter_taps;
58
59 fftwf_plan initialize_fft(gfdm_complex* out_buf, gfdm_complex* in_buf, const int fft_size, bool forward);
60 void initialize_taps_vector(gfdm_complex* filter_taps, std::vector<gfdm_complex> frequency_taps, const int n_timeslots);
61
62 gfdm_complex* d_sub_fft_in;
63 gfdm_complex* d_sub_fft_out;
64 fftwf_plan d_sub_fft_plan;
65 gfdm_complex* d_filtered;
66 gfdm_complex* d_ifft_in;
67 gfdm_complex* d_ifft_out;
68 fftwf_plan d_ifft_plan;
69
70 // DEBUG function
71 const void print_vector(const gfdm_complex* v, const int size);
72 static bool complex_compare(gfdm_complex i, gfdm_complex j) { return std::abs(i) < std::abs(j); };
73
74 };
75
76 } // namespace gfdm
77} // namespace gr
78
79#endif /* INCLUDED_GFDM_MODULATOR_KERNEL_CC_H */
80
modulate a GFDM block. This class initializes and performs all operations necessary to modulate a GFD...
Definition: modulator_kernel_cc.h:41
void generic_work(gfdm_complex *p_out, const gfdm_complex *p_in)
modulator_kernel_cc(int n_timeslots, int n_subcarriers, int overlap, std::vector< gfdm_complex > frequency_taps)
boost::shared_ptr< modulator_kernel_cc > sptr
Definition: modulator_kernel_cc.h:44
std::complex< float > gfdm_complex
Definition: modulator_kernel_cc.h:43
int block_size()
Definition: modulator_kernel_cc.h:49
std::vector< gfdm_complex > filter_taps()
Definition: add_cyclic_prefix_cc.h:30