Harmonic mode repaired

SI443_RBW_update
erikkaashoek 4 years ago
parent fa712b0536
commit aceef9f6fc

@ -978,6 +978,8 @@ config_t config = {
.lna_level_offset = 100, .lna_level_offset = 100,
.low_level_output_offset = 100.0, // Uncalibrated .low_level_output_offset = 100.0, // Uncalibrated
.high_level_output_offset = 0, // Uncalibrated, but checking code is not yet present .high_level_output_offset = 0, // Uncalibrated, but checking code is not yet present
.harmonic_level_offset = -11.5,
.shift_level_offset = -1.5,
.correction_frequency = .correction_frequency =
{ {
{ 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low in { 10000, 100000, 1000000, 5000000, 15000000, 30000000, 145000000, 400000000, 720000000, 800000000, 800000001, 1519000000, 1527000000, 3000000000, 3500000000, 4000000000, 4500000000, 5000000000, 5500000000, 6000000000 }, // low in

@ -1528,6 +1528,10 @@ static void trace_print_value_string( // Only used at one place
step = step*10; step = step*10;
} }
} }
#ifdef TINYSA4
if (freq >= 1000000000)
digits += 3;
#endif
plot_printf(ptr2, sizeof(buf2) - 9, "%9.*QHz", digits, freq); plot_printf(ptr2, sizeof(buf2) - 9, "%9.*QHz", digits, freq);
} }
const char *format; const char *format;

@ -83,6 +83,9 @@ int linear_averaging = true;
static freq_t old_freq[5] = { 0, 0, 0, 0,0}; static freq_t old_freq[5] = { 0, 0, 0, 0,0};
static freq_t real_old_freq[5] = { 0, 0, 0, 0,0}; static freq_t real_old_freq[5] = { 0, 0, 0, 0,0};
static long real_offset = 0; static long real_offset = 0;
#ifdef __ULTRA__
static int LO_harmonic;
#endif
void clear_frequency_cache(void) void clear_frequency_cache(void)
{ {
@ -1762,7 +1765,7 @@ pureRSSI_t get_frequency_correction(freq_t f) // Frequency dependent RSSI c
if (setting.mode == M_LOW && ultra && f > ultra_threshold) { if (setting.mode == M_LOW && ultra && f > ultra_threshold) {
c = CORRECTION_LOW_ULTRA; c = CORRECTION_LOW_ULTRA;
if ( f > ULTRA_MAX_FREQ) { if ( f > ULTRA_MAX_FREQ) {
cv += float_TO_PURE_RSSI(8.5); // +9dB correction. cv -= float_TO_PURE_RSSI(config.harmonic_level_offset); // +10.5dB correction.
} }
if (setting.extra_lna) if (setting.extra_lna)
c += 1; c += 1;
@ -1988,7 +1991,9 @@ void set_freq(int V, freq_t freq) // translate the requested frequency into a
// ----------------------------- set mixer drive -------------------------------------------- // ----------------------------- set mixer drive --------------------------------------------
int target_drive = setting.lo_drive; int target_drive = setting.lo_drive;
if (target_drive & 0x04){ // Automatic mixer drive if (target_drive & 0x04){ // Automatic mixer drive
if (freq-970000000 < 600000000ULL) // below 100MHz if (LO_harmonic)
target_drive = 3;
else if (freq-970000000 < 600000000ULL) // below 100MHz
target_drive = 0; target_drive = 0;
else if (freq-970000000 < 1200000000ULL) // below 1.2GHz else if (freq-970000000 < 1200000000ULL) // below 1.2GHz
target_drive = 1; target_drive = 1;
@ -2851,9 +2856,6 @@ static int LO_shifted;
static int LO_mirrored; static int LO_mirrored;
static int LO_shifting; static int LO_shifting;
#endif #endif
#ifdef __ULTRA__
static int LO_harmonic;
#endif
static void calculate_static_correction(void) // Calculate the static part of the RSSI correction static void calculate_static_correction(void) // Calculate the static part of the RSSI correction
{ {
@ -4146,8 +4148,8 @@ again: // Spur redu
#ifdef TINYSA4 #ifdef TINYSA4
if (LO_shifting) if (LO_shifting)
pureRSSI -= float_TO_PURE_RSSI(config.shift_level_offset); pureRSSI -= float_TO_PURE_RSSI(config.shift_level_offset);
if (LO_harmonic) // if (LO_harmonic)
pureRSSI -= float_TO_PURE_RSSI(config.harmonic_level_offset); // pureRSSI -= float_TO_PURE_RSSI(config.harmonic_level_offset);
#endif #endif
if (RSSI < pureRSSI) // Take max during subscanning if (RSSI < pureRSSI) // Take max during subscanning

Loading…
Cancel
Save

Powered by TurnKey Linux.