From 3f361b624cee3e97c2af15e5056d687a5249b484 Mon Sep 17 00:00:00 2001 From: c vw Date: Wed, 22 Dec 2021 11:12:26 +0100 Subject: [PATCH] Removed "smooth scaling" of TX IQ samples for HermesLite2 since this is not compatible with PURESIGNAL. --- transmitter.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/transmitter.c b/transmitter.c index 5feb5c7..c3a2b76 100644 --- a/transmitter.c +++ b/transmitter.c @@ -1248,40 +1248,6 @@ static void full_tx_buffer(TRANSMITTER *tx) { gain=gain*(double)tx->drive_level*0.00392; } } - if (protocol == ORIGINAL_PROTOCOL && radio->device == DEVICE_HERMES_LITE2 && !transmitter->puresignal) { - // - // The HermesLite2 is built around the AD9866 modem chip. The TX level can - // be adjusted from 0.0 to -7.5 dB in 0.5 db steps, and these settings are - // encoded in the top 4 bits of the HPSDR "drive level". - // - // In old_protocol.c, the TX attenuator is set according to the drive level, - // here we only apply a (mostly small) additional damping of the IQ samples - // to achieve a smooth drive level adjustment. - // However, if the drive level requires an attenuation *much* larger than - // 7.5 dB we have to damp significantly at this place, which may affect IMD. - // - // NOTE: When doing adaptive pre-distortion (PURESIGNAL), IQ scaling cannot - // be used because the the TX ADC samples reported back also never - // reach their "SetPK" amplitude and PURESIGNAL does not jump in - // - int power; - double f,g; - if(tune && !tx->tune_use_drive) { - f=sqrt((double)tx->tune_percent * 0.01); - power=(int)((double)tx->drive_level*f); - } else { - power=tx->drive_level; - } - g=-15.0; - if (power > 0) { - f = 40.0 * log10((double) power / 255.0); // 2* attenuation in dB - g= ceil(f); // 2* attenuation rounded to half-dB steps - if (g < -15.0) g=-15.0; // nominal TX attenuation - gain=gain*pow(10.0,0.05*(f-g)); - } else { - gain=0.0; - } - } if (txflag == 0 && protocol == NEW_PROTOCOL) { // -- 2.45.2