diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-05-28 15:41:21 -0700 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-05-29 07:15:17 -0500 |
commit | d4e62f0d9d26107c0b6677308ea83b2f2dfe7da4 (patch) | |
tree | e3bda3905e22d9b8867a4dce657fd774779b5715 /host | |
parent | 983fad664436301c31c3bc8c81b538a41537598b (diff) | |
download | uhd-d4e62f0d9d26107c0b6677308ea83b2f2dfe7da4.tar.gz uhd-d4e62f0d9d26107c0b6677308ea83b2f2dfe7da4.tar.bz2 uhd-d4e62f0d9d26107c0b6677308ea83b2f2dfe7da4.zip |
multi_usrp: Fix get_tx_freq() for RFNoC devices
get_tx_freq(), unlike get_rx_freq(), would not factor in the DSP
frequency. Before, this would happen:
>>> U = uhd.usrp.MultiUSRP("type=x300")
>>> tr = uhd.types.TuneRequest(1e9, 10e6)
>>> res = U.set_tx_freq(tr)
>>> res.clipped_rf_freq
1000000000.0
>>> U.get_tx_freq()
1010000000.0
In other words, the TuneResult object was correct, but the return value
of get_tx_freq() was not. This fixes the issue.
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/usrp/multi_usrp_rfnoc.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/host/lib/usrp/multi_usrp_rfnoc.cpp b/host/lib/usrp/multi_usrp_rfnoc.cpp index 8b85e84ec..823f3547a 100644 --- a/host/lib/usrp/multi_usrp_rfnoc.cpp +++ b/host/lib/usrp/multi_usrp_rfnoc.cpp @@ -1780,8 +1780,14 @@ public: double get_tx_freq(size_t chan) { - auto tx_chain = _get_tx_chan(chan); - return tx_chain.radio->get_tx_frequency(tx_chain.block_chan); + auto& tx_chain = _get_tx_chan(chan); + // extract actual dsp and IF frequencies + const double actual_rf_freq = + tx_chain.radio->get_tx_frequency(tx_chain.block_chan); + const double actual_dsp_freq = + (tx_chain.duc) ? tx_chain.duc->get_freq(tx_chain.block_chan) : 0.0; + // invert the sign on the dsp freq for transmit + return actual_rf_freq - actual_dsp_freq * TX_SIGN; } freq_range_t get_tx_freq_range(size_t chan) |