FreeCalypso > hg > fc-rfcal-tools
comparison autocal/txbasis.c @ 81:83b24a1dfd4a
fc-rfcal-txband: implemented the slope computations after basis run
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 15 Jul 2017 21:34:29 +0000 |
parents | b0da2db4e36b |
children | b0618796d28d |
comparison
equal
deleted
inserted
replaced
80:b0da2db4e36b | 81:83b24a1dfd4a |
---|---|
27 | 27 |
28 for (n = 0; n < num_basis_points; n++) { | 28 for (n = 0; n < num_basis_points; n++) { |
29 do_txpw(TX_APC_DAC, tx_basis[n].apc); | 29 do_txpw(TX_APC_DAC, tx_basis[n].apc); |
30 usleep(20000); | 30 usleep(20000); |
31 meas = tx_power_meas(); | 31 meas = tx_power_meas(); |
32 printf("APC DAC=%d: %.2f dBm\n", tx_basis[n].apc, meas); | 32 printf("APC DAC=%u: %.2f dBm\n", tx_basis[n].apc, meas); |
33 tx_basis[n].vout = dbm_to_vout(meas); | 33 tx_basis[n].vout = dbm_to_vout(meas); |
34 } | 34 } |
35 | 35 |
36 printf("Stopping RF Tx on the DUT\n"); | 36 printf("Stopping RF Tx on the DUT\n"); |
37 do_rfe(STOP_ALL); | 37 do_rfe(STOP_ALL); |
38 return(0); | 38 return(0); |
39 } | 39 } |
40 | |
41 txcal_basis_compute() | |
42 { | |
43 unsigned n; | |
44 | |
45 for (n = 0; n < num_basis_points - 1; n++) { | |
46 if (tx_basis[n+1].vout <= tx_basis[n].vout) { | |
47 fprintf(stderr, | |
48 "error: Vout at APC=%u is not greater than at APC=%u\n", | |
49 tx_basis[n+1].apc, tx_basis[n].apc); | |
50 exit(ERROR_RFTEST); | |
51 } | |
52 tx_basis[n].slope = (tx_basis[n+1].vout - tx_basis[n].vout) / | |
53 (tx_basis[n+1].apc - tx_basis[n].apc); | |
54 } | |
55 return(0); | |
56 } |