Noise correction and amp freq removed

pull/34/head
erikkaashoek 3 years ago
parent ae9a7dcd51
commit 20d5c3e6f9

@ -1172,7 +1172,7 @@ static DSTATUS Stat = STA_NOINIT; // Disk Status
static uint8_t CardType = 0; // Type 0:MMC, 1:SDC, 2:Block addressing
// Debug functions, 0 to disable
#define DEBUG 0
#define DEBUG 1
int shell_printf(const char *fmt, ...);
#define DEBUG_PRINT(...) do { if (DEBUG) shell_printf(__VA_ARGS__); } while (0)
#if DEBUG == 1

@ -327,7 +327,7 @@ marker_to_value(const int i)
if (markers[i].mtype & M_NOISE){
v = v - logf(actual_rbw_x10*100.0) * (10.0/logf(10.0))
#ifdef TINYSA4
+ SI4463_noise_correction_x10/10.0 + (linear_averaging ? 0.0 : log_averaging_correction);
+ ((float)SI4463_noise_correction_x10)/10.0 + (linear_averaging ? 0.0 : log_averaging_correction);
#endif
;
}

@ -1737,15 +1737,15 @@ static const RBW_t RBW_choices[] =
#else
#define NOISE_BASE_CORRECTION 7 // 7
{SI4463_RBW_02kHz, 10,2, NOISE_BASE_CORRECTION + 2}, //
{SI4463_RBW_1kHz, 15,10, NOISE_BASE_CORRECTION + -12},//
{SI4463_RBW_02kHz, 10,2, NOISE_BASE_CORRECTION + 0}, //
{SI4463_RBW_1kHz, 15,10, NOISE_BASE_CORRECTION + -5},//
{SI4463_RBW_3kHz, 10,30, NOISE_BASE_CORRECTION + -5},//
{SI4463_RBW_10kHz, 14,100,NOISE_BASE_CORRECTION + 0}, //
{SI4463_RBW_30kHz, 0,300, NOISE_BASE_CORRECTION + 0},//
{SI4463_RBW_100kHz, 0,1000,NOISE_BASE_CORRECTION + -2},//
{SI4463_RBW_10kHz, 14,100,NOISE_BASE_CORRECTION + -2}, //
{SI4463_RBW_30kHz, 0,300, NOISE_BASE_CORRECTION + -2},//
{SI4463_RBW_100kHz, 0,1000,NOISE_BASE_CORRECTION + -1},//
{SI4463_RBW_300kHz, 0,3000,NOISE_BASE_CORRECTION}, // 300k must have RSSI correction = 0
{SI4463_RBW_600kHz, 5,6000,NOISE_BASE_CORRECTION + -0},//
{SI4463_RBW_850kHz, 8,8500,NOISE_BASE_CORRECTION + 3},//
{SI4463_RBW_600kHz, 5,6000,NOISE_BASE_CORRECTION + -2},//
{SI4463_RBW_850kHz, 8,8500,NOISE_BASE_CORRECTION + 2},//
#endif
};

@ -1785,9 +1785,10 @@ validate:
nf_gain = 0.00001; // almost zero
goto noise_figure;
case M_NF_AMPLIFIER: // noise figure
// reset_settings(setting.mode);
#if 0
reset_settings(setting.mode);
set_refer_output(-1);
#endif
kp_help_text = "Amplifier Gain ";
float old_gain = setting.external_gain;
ui_mode_keypad(KM_EXT_GAIN);
@ -1798,7 +1799,7 @@ validate:
markers[0].mtype = M_NOISE | M_AVER; // Not tracking
set_extra_lna(true);
set_attenuation(0);
if (data != M_NF_VALIDATE) {
if (data == M_NF_TINYSA) {
kp_help_text = "Noise center frequency";
ui_mode_keypad(KM_CENTER);
set_marker_frequency(0, uistat.value);
@ -4347,40 +4348,38 @@ redraw_cal_status:
// lcd_printf(x, y, "%4f", value(setting.trigger_level)/setting.unit_scale);
y = add_quick_menu(y,(menuitem_t *)menu_trigger);
}
#ifndef TINYSA4
// Mode
ili9341_set_foreground(level_is_calibrated() ? LCD_BRIGHT_COLOR_GREEN : LCD_BRIGHT_COLOR_RED);
ili9341_drawstring_7x13(MODE_LOW(setting.mode) ? "LOW" : "HIGH", x, y);
y += YSTEP + YSTEP/2 ;
#endif
// Compact status string
// ili9341_set_background(LCD_FG_COLOR);
ili9341_set_foreground(LCD_FG_COLOR);
y += YSTEP + YSTEP/2 ;
strncpy(buf," ",BLEN-1);
if (setting.auto_attenuation)
buf[0] = 'a';
else
buf[0] = 'A';
if (setting.auto_IF)
buf[1] = 'f';
buf[0] = 'f';
else
buf[1] = 'F';
if (setting.auto_reflevel)
buf[2] = 'r';
else
buf[2] = 'R';
buf[0] = 'F';
if (S_IS_AUTO(setting.agc))
buf[3] = 'g';
buf[1] = 'g';
else if (S_STATE(setting.agc))
buf[3] = 'G';
buf[1] = 'G';
if (S_IS_AUTO(setting.lna))
buf[4] = 'n';
buf[2] = 'n';
else if (S_STATE(setting.lna))
buf[4] = 'N';
buf[2] = 'N';
if (S_IS_AUTO(setting.below_IF))
buf[5] = 'b';
buf[3] = 'b';
else if (S_STATE(setting.below_IF))
buf[5] = 'B';
buf[3] = 'B';
#ifdef TINYSA4
if (S_IS_AUTO(setting.spur_removal))
buf[4] = 's';
else if (S_STATE(setting.spur_removal))
buf[4] = 'S';
#endif
ili9341_drawstring(buf, x, y);
// Version

Loading…
Cancel
Save

Powered by TurnKey Linux.