1 /* -*- c++ -*- */ 2 /* 3 * Copyright 2015 Free Software Foundation, Inc. 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 #ifndef INCLUDED_DTV_DVBT2_PAPRTR_CC_IMPL_H 22 #define INCLUDED_DTV_DVBT2_PAPRTR_CC_IMPL_H 23 24 #include "../dvb/dvb_defines.h" 25 26 #include <gnuradio/dtv/dvbt2_paprtr_cc.h> 27 #include <gnuradio/fft/fft.h> 28 29 #define MAX_CARRIERS 27841 30 #define MAX_FFTSIZE 32768 31 #define MAX_PAPRTONES 288 32 33 enum dvbt2_carrier_type_t { 34 DATA_CARRIER = 1, 35 P2PILOT_CARRIER, 36 P2PAPR_CARRIER, 37 TRPAPR_CARRIER, 38 SCATTERED_CARRIER, 39 CONTINUAL_CARRIER 40 }; 41 42 namespace gr { 43 namespace dtv { 44 45 class dvbt2_paprtr_cc_impl : public dvbt2_paprtr_cc 46 { 47 private: 48 int num_symbols; 49 int fft_size; 50 int left_nulls; 51 int right_nulls; 52 int pilot_pattern; 53 int carrier_mode; 54 int papr_mode; 55 int version_num; 56 double v_clip; 57 int num_iterations; 58 const int* papr_map; 59 const int* p2_papr_map; 60 const int* tr_papr_map; 61 int p2_carrier_map[MAX_CARRIERS]; 62 int data_carrier_map[MAX_CARRIERS]; 63 int fc_carrier_map[MAX_CARRIERS]; 64 gr_complex* ones_freq; 65 gr_complex* ones_time; 66 gr_complex* c; 67 gr_complex* ctemp; 68 float* magnitude; 69 gr_complex* r; 70 gr_complex* rNew; 71 gr_complex* v; 72 float alphaLimit[MAX_PAPRTONES]; 73 float alphaLimitMax[MAX_PAPRTONES]; 74 int N_P2; 75 int N_FC; 76 int K_EXT; 77 int C_PS; 78 int N_TR; 79 int dx; 80 int dy; 81 int shift; 82 void init_pilots(int); 83 84 fft::fft_complex* papr_fft; 85 int papr_fft_size; 86 87 const static int p2_papr_map_1k[10]; 88 const static int p2_papr_map_2k[18]; 89 const static int p2_papr_map_4k[36]; 90 const static int p2_papr_map_8k[72]; 91 const static int p2_papr_map_16k[144]; 92 const static int p2_papr_map_32k[288]; 93 const static int tr_papr_map_1k[10]; 94 const static int tr_papr_map_2k[18]; 95 const static int tr_papr_map_4k[36]; 96 const static int tr_papr_map_8k[72]; 97 const static int tr_papr_map_16k[144]; 98 const static int tr_papr_map_32k[288]; 99 100 public: 101 dvbt2_paprtr_cc_impl(dvbt2_extended_carrier_t carriermode, 102 dvbt2_fftsize_t fftsize, 103 dvbt2_pilotpattern_t pilotpattern, 104 dvb_guardinterval_t guardinterval, 105 int numdatasyms, 106 dvbt2_papr_t paprmode, 107 dvbt2_version_t version, 108 float vclip, 109 int iterations, 110 unsigned int vlength); 111 ~dvbt2_paprtr_cc_impl(); 112 113 int work(int noutput_items, 114 gr_vector_const_void_star& input_items, 115 gr_vector_void_star& output_items); 116 }; 117 118 } // namespace dtv 119 } // namespace gr 120 121 #endif /* INCLUDED_DTV_DVBT2_PAPRTR_CC_IMPL_H */ 122