diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-08-18 14:23:39 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-08-18 14:23:39 +0200 |
commit | d0e795c862b2806b3c60bf8f4cc9365be0ad3fe1 (patch) | |
tree | e9c6ae0eed0ae2f5d25dfc77d7c09de5fdc3c982 /src | |
parent | e9a84050dec5f941fadd8c53b4f672609885f463 (diff) | |
download | dabmod-d0e795c862b2806b3c60bf8f4cc9365be0ad3fe1.tar.gz dabmod-d0e795c862b2806b3c60bf8f4cc9365be0ad3fe1.tar.bz2 dabmod-d0e795c862b2806b3c60bf8f4cc9365be0ad3fe1.zip |
Add not-compiled-in magnitude polynomial for DPD
Diffstat (limited to 'src')
-rw-r--r-- | src/MemlessPoly.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
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 } } |