Revision 18abd4db

b/host/docs/calibration.rst
28 28
 * more to come...
29 29

  
30 30
********************************************
31
Basic tool usage
31
Calibration utilities
32 32
********************************************
33

  
34 33
UHD installs the calibration utilities into <install-path>/bin.
35
Run the following from the command line:
34
**Disconnect** any extrernal hardware from the RF antenna ports,
35
and run the following from the command line.
36
Each utility will take several minutes to complete.
36 37
::
37 38

  
38 39
    uhd_cal_rx_iq_balance --verbose --args=<optional device args>
......
43 44
manually choosing the frequency range and step size for the sweeps.
44 45

  
45 46
********************************************
46
Calibration files
47
Calibration data
47 48
********************************************
48 49
Calibration files are stored in the user's home/application directory.
49 50
They can easily be moved from machine to another by copying the "cal" directory.
50 51
Re-running a calibration utility will replace the existing calibration file.
51 52
The old calibration file will be renamed so it may be recovered by the user.
52 53

  
53
 * **Unix:** ${HOME}/.uhd/cal 
54
 * **Windows:** %APPDATA%\.uhd\cal 
54
 * **Unix:** ${HOME}/.uhd/cal/
55
 * **Windows:** %APPDATA%\\.uhd\\cal\\
55 56

  
b/host/lib/usrp/b100/b100_impl.cpp
15 15
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 16
//
17 17

  
18
#include "apply_corrections.hpp"
18 19
#include "b100_impl.hpp"
19 20
#include "b100_ctrl.hpp"
20 21
#include "fpga_regs_standard.h"
......
408 409
        _dboard_iface, _tree->subtree(mb_path / "dboards/A")
409 410
    );
410 411

  
412
    //bind frontend corrections to the dboard freq props
413
    const fs_path db_tx_fe_path = mb_path / "dboards" / "A" / "tx_frontends";
414
    BOOST_FOREACH(const std::string &name, _tree->list(db_tx_fe_path)){
415
        _tree->access<double>(db_tx_fe_path / name / "freq" / "value")
416
            .subscribe(boost::bind(&b100_impl::set_tx_fe_corrections, this, _1));
417
    }
418
    const fs_path db_rx_fe_path = mb_path / "dboards" / "A" / "rx_frontends";
419
    BOOST_FOREACH(const std::string &name, _tree->list(db_rx_fe_path)){
420
        _tree->access<double>(db_rx_fe_path / name / "freq" / "value")
421
            .subscribe(boost::bind(&b100_impl::set_rx_fe_corrections, this, _1));
422
    }
423

  
411 424
    //initialize io handling
412 425
    this->io_init();
413 426

  
......
501 514
    const bool lock = _clock_ctrl->get_locked();
502 515
    return sensor_value_t("Ref", lock, "locked", "unlocked");
503 516
}
517

  
518
void b100_impl::set_rx_fe_corrections(const double lo_freq){
519
    apply_rx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
520
}
521

  
522
void b100_impl::set_tx_fe_corrections(const double lo_freq){
523
    apply_tx_fe_corrections(this->get_tree()->subtree("/mboards/0"), "A", lo_freq);
524
}
b/host/lib/usrp/b100/b100_impl.hpp
125 125
    void clear_fpga_fifo(void);
126 126
    void handle_async_message(uhd::transport::managed_recv_buffer::sptr);
127 127
    uhd::sensor_value_t get_ref_locked(void);
128
    void set_rx_fe_corrections(const double);
129
    void set_tx_fe_corrections(const double);
128 130
};
129 131

  
130 132
#endif /* INCLUDED_b100_IMPL_HPP */
b/host/utils/uhd_cal_rx_iq_balance.cpp
249 249
            result.delta = best_suppression - initial_suppression;
250 250
            results.push_back(result);
251 251
            if (vm.count("verbose")){
252
                std::cout << boost::format("%f MHz: best suppression %fdB, corrected %fdB") % (rx_lo/1e6) % result.best % result.delta << std::endl;
252
                std::cout << boost::format("%f MHz: best suppression %f dB, corrected %f dB") % (rx_lo/1e6) % result.best % result.delta << std::endl;
253 253
            }
254 254
            else std::cout << "." << std::flush;
255 255
        }
b/host/utils/uhd_cal_tx_dc_offset.cpp
246 246
            result.delta = initial_dc_dbrms - lowest_offset;
247 247
            results.push_back(result);
248 248
            if (vm.count("verbose")){
249
                std::cout << boost::format("%f MHz: lowest offset %fdB, corrected %fdB") % (tx_lo/1e6) % result.best % result.delta << std::endl;
249
                std::cout << boost::format("%f MHz: lowest offset %f dB, corrected %f dB") % (tx_lo/1e6) % result.best % result.delta << std::endl;
250 250
            }
251 251
            else std::cout << "." << std::flush;
252 252
        }
b/host/utils/uhd_cal_tx_iq_balance.cpp
251 251
            result.delta = best_suppression - initial_suppression;
252 252
            results.push_back(result);
253 253
            if (vm.count("verbose")){
254
                std::cout << boost::format("%f MHz: best suppression %fdB, corrected %fdB") % (tx_lo/1e6) % result.best % result.delta << std::endl;
254
                std::cout << boost::format("%f MHz: best suppression %f dB, corrected %f dB") % (tx_lo/1e6) % result.best % result.delta << std::endl;
255 255
            }
256 256
            else std::cout << "." << std::flush;
257 257
        }
b/host/utils/usrp_cal_utils.hpp
73 73
static inline std::vector<std::complex<float> > gen_table(void){
74 74
    std::vector<std::complex<float> > wave_table(wave_table_len);
75 75
    for (size_t i = 0; i < wave_table_len; i++){
76
        wave_table[i] = std::polar<float>(1.0, (tau*i)/wave_table_len);
76
        wave_table[i] = std::complex<float>(std::polar(1.0, (tau*i)/wave_table_len));
77 77
    }
78 78
    return wave_table;
79 79
}

Also available in: Unified diff