From d0e795c862b2806b3c60bf8f4cc9365be0ad3fe1 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 18 Aug 2017 14:23:39 +0200 Subject: Add not-compiled-in magnitude polynomial for DPD --- src/MemlessPoly.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/MemlessPoly.cpp') diff --git a/src/MemlessPoly.cpp b/src/MemlessPoly.cpp index 6686c41..515e2bd 100644 --- a/src/MemlessPoly.cpp +++ b/src/MemlessPoly.cpp @@ -136,6 +136,11 @@ static void apply_coeff( */ /* Make sure to adapt NUM_COEFS when you change this */ + +#if 1 + // Complex polynomial, all operations are on complex values. + // Usually this is the representation we use when speaking + // about the real-valued passband signal that the PA receives. out[i] = coefs[0] + in[i] * ( coefs[1] + in[i] * @@ -143,6 +148,19 @@ static void apply_coeff( ( coefs[3] + in[i] * ( coefs[4] + in[i] * ( coefs[5] + in[i] ))))); +#else + // Polynomial on the magnitude only. All but one multiplication are + // on real values. This is what is usually used in papers for the + // baseband representation of the signal. + const float mag = std::abs(in[i]); + out[i] = in[i] * + mag * (coefs[0] + + mag * (coefs[1] + + mag * (coefs[2] + + mag * (coefs[3] + + mag * (coefs[4] + + mag * coefs[5] ))))); +#endif } } -- cgit v1.2.3