GNU Radio's DPD Package
RLS_postdistorter_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2020 Alekh Gupta
4  *
5  * SPDX-License-Identifier: GPL-3.0-or-later
6  */
7 
8 #ifndef INCLUDED_DPD_RLS_POSTDISTORTER_IMPL_H
9 #define INCLUDED_DPD_RLS_POSTDISTORTER_IMPL_H
10 
11 #include <dpd/RLS_postdistorter.h>
12 #include <armadillo>
13 using namespace arma;
14 
15 namespace gr {
16 namespace dpd {
17 
19 {
20 private:
21  // Nothing to declare in this block.
22  std::vector<int> d_dpd_params;
23  gr_complexd d_pa_input, pa_input, error;
24  gr_complexd pa_input_smooth, pa_output_smooth;
25  gr_complexd sr1[10], sr2[10];
26  bool d_ack_predistorter_updated, ack_predistorter_updated;
27  const int K_a, L_a, K_b, M_b, L_b, M, M_bar;
28  const int sreg_len = 50;
29  gr_complex sreg[50];
30  const gr_complex* ptr_sreg = sreg;
31  std::vector<gr_complexd> taps;
32 
33  int iteration, d_iter_limit;
34 
35  // Fast-RLS parameter declaration
36  double lambda, one_over_sqrt_lambda, eta, inv_sqrt_gamma_iMinus1;
37  cx_mat g_vec_iMinus1, g_vec_i, L_bar_iMinus1, w_i, w_iMinus1, A_mat, B_mat, g;
38  cx_fcolvec yy_cx_fcolvec;
39  cx_frowvec yy_cx_frowvec;
40  cx_fmat y;
41 
42 public:
43  RLS_postdistorter_impl(const std::vector<int>& dpd_params, int iter_limit);
45  // Decides closeness to zero or null
46  bool almost_equal(double a, double b, double tol);
47  // Givens rotation utility
48  void givens_rotate(const cx_mat& in, cx_mat& out);
49  // Hyperbolics givens rotation utility
50  void hgivens_rotate(const cx_mat& in, cx_mat& out);
51  // Extract g-vec after hyperbolics and givens rotation
52  void extract_g_vecs(cx_mat& g,
53  cx_mat& g_vec_iMinus1,
54  cx_mat& g_vec_i,
55  int K_a,
56  int L_a,
57  int K_b,
58  int M_b,
59  int L_b,
60  int M,
61  int M_bar);
62  // Extract calibrated PA_output in a shift-structured GMP vector
63  void extract_postdistorted_y(
64  cx_fmat& y_in, cx_fmat& y, int K_a, int L_a, int K_b, int M_b, int L_b, int M);
65  // Use hyperbolics and givens rotation accordingly
66  void apply_rotations(const cx_mat& A, cx_mat& B);
67  // Genrates shift-structured GMP vector
68  void gen_GMPvector(const gr_complex* const in,
69  int item,
70  int K_a,
71  int L_a,
72  int K_b,
73  int M_b,
74  int L_b,
75  cx_fcolvec& GMP_vector);
76  // Where all the action really happens
77  int work(int noutput_items,
78  gr_vector_const_void_star& input_items,
79  gr_vector_void_star& output_items);
80 };
81 
82 } // namespace dpd
83 } // namespace gr
84 
85 #endif /* INCLUDED_DPD_RLS_POSTDISTORTER_IMPL_H */
RLS based Algorithm implemented to estimate the coefficients of the behaviorial model (GMP) of the Po...
Definition: RLS_postdistorter.h:37
Definition: gain_phase_calibrate.h:14
Definition: RLS_postdistorter_impl.h:18