# HG changeset patch # User Mychaela Falconia # Date 1500154469 0 # Node ID 83b24a1dfd4a0430902346718c1359562592b1c7 # Parent b0da2db4e36b33fc66e991082d3586fab726ee61 fc-rfcal-txband: implemented the slope computations after basis run diff -r b0da2db4e36b -r 83b24a1dfd4a autocal/txbandmain.c --- a/autocal/txbandmain.c Sat Jul 15 21:22:38 2017 +0000 +++ b/autocal/txbandmain.c Sat Jul 15 21:34:29 2017 +0000 @@ -120,6 +120,8 @@ upload_tx_calchan(); /* run the basis measurements */ txcal_basis_run(); + /* analytical follow-up */ + txcal_basis_compute(); } diff -r b0da2db4e36b -r 83b24a1dfd4a autocal/txbasis.c --- a/autocal/txbasis.c Sat Jul 15 21:22:38 2017 +0000 +++ b/autocal/txbasis.c Sat Jul 15 21:34:29 2017 +0000 @@ -29,7 +29,7 @@ do_txpw(TX_APC_DAC, tx_basis[n].apc); usleep(20000); meas = tx_power_meas(); - printf("APC DAC=%d: %.2f dBm\n", tx_basis[n].apc, meas); + printf("APC DAC=%u: %.2f dBm\n", tx_basis[n].apc, meas); tx_basis[n].vout = dbm_to_vout(meas); } @@ -37,3 +37,20 @@ do_rfe(STOP_ALL); return(0); } + +txcal_basis_compute() +{ + unsigned n; + + for (n = 0; n < num_basis_points - 1; n++) { + if (tx_basis[n+1].vout <= tx_basis[n].vout) { + fprintf(stderr, + "error: Vout at APC=%u is not greater than at APC=%u\n", + tx_basis[n+1].apc, tx_basis[n].apc); + exit(ERROR_RFTEST); + } + tx_basis[n].slope = (tx_basis[n+1].vout - tx_basis[n].vout) / + (tx_basis[n+1].apc - tx_basis[n].apc); + } + return(0); +}