GNU Radio's LTE Package
pss_calculator_vcm_impl.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2013 Communications Engineering Lab (CEL) / Karlsruhe Institute of Technology (KIT)
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_LTE_PSS_CALCULATOR_VCM_IMPL_H
22#define INCLUDED_LTE_PSS_CALCULATOR_VCM_IMPL_H
23
25//~ #include <lte/pss_symbol_selector_cvc.h>
26//~ #include <lte/pss_tagger_cc.h>
27#include <lte/correlator.h>
28
29namespace gr {
30 namespace lte {
31
33 {
34 private:
35 static const gr_complex d_C_I;
36 static const float d_PI;
37 int d_fftl;
38 int d_cpl;
39 int d_cpl0;
40 int d_slotl;
41 int d_N_id_2;
42 long d_half_frame_start;
43 float d_corr_val;
44 int d_lock_count;
45 bool d_is_locked;
46 gr_complex d_chu0[63];
47 gr_complex d_chu1[63];
48 gr_complex d_chu2[63];
49
50 pmt::pmt_t d_port_lock;
51 pmt::pmt_t d_port_half_frame_start;
52 pmt::pmt_t d_port_N_id_2;
53
54 std::vector<float> d_corr_vec;
55
56 void zc(gr_complex *zc, int cell_id); // used to generate Zadoff-Chu sequences
57 bool find_pss_symbol(gr_complex *chuX); // prepares the calculation stuff etc.
58 bool tracking(gr_complex *chu);
59 void max_pos(float &max, int &pos, gr_complex *x,gr_complex *y, int len); //finds maximum of one correlation
60
61 inline void set_half_frame_start();
62 inline int calculate_half_frame_start(long pos);
63 inline void extract_pss(gr_complex *chu, const gr_complex *in);
64 // attributes for correlation
65 correlator *d_correlator;
66 gr_complex *d_corr_in1;
67 gr_complex *d_corr_in2;
68 gr_complex *d_corr_out;
69
70 public:
71 pss_calculator_vcm_impl(int fftl, std::string& name);
73
74 // Where all the action really happens
75 int work(int noutput_items,
76 gr_vector_const_void_star &input_items,
77 gr_vector_void_star &output_items);
78 };
79
80 } // namespace lte
81} // namespace gr
82
83#endif /* INCLUDED_LTE_PSS_CALCULATOR_VCM_IMPL_H */
84
This is a helper class to provide Fast Correlation using FFTW3f.
Definition: correlator.h:38
Definition: pss_calculator_vcm_impl.h:33
pss_calculator_vcm_impl(int fftl, std::string &name)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
<+description of block+>
Definition: pss_calculator_vcm.h:39
Definition: bch_crc_check_ant_chooser_bb.h:28