How do these timed commands work exactly when using USRP Source together with
USRP Sink? (I need to phase-align RX and TX hence use timed commands at the
same time).
Since they are both internally use the same hardware device (and board) I feel
timed commands sent to both blocks result in some unpredictable results (at
least for me).
For simplicity, consider this simple test setup: Loopback configuration (TX
into RX via 30dB attentuator); transmit a 1MHz baseband signal into USRP Sink.
Then, use just retuning via DSP:
# dsp_freq changes every time this code is called:
#dsp_freq = 0
dsp_freq = 100e3
tune_req_tx = uhd.tune_request()
tune_req_tx.rf_freq_policy = uhd.tune_request.POLICY_MANUAL
tune_req_tx.dsp_freq_policy = uhd.tune_request.POLICY_MANUAL
tune_req_tx.rf_freq = 900e6
tune_req_tx.dsp_freq = -dsp_freq
tune_req_rx = uhd.tune_request()
tune_req_rx.rf_freq_policy = uhd.tune_request.POLICY_MANUAL
tune_req_rx.dsp_freq_policy = uhd.tune_request.POLICY_MANUAL
tune_req_rx.rf_freq = 900e6
tune_req_rx.dsp_freq = dsp_freq
res1 = uhd_usrp_sink_0.set_center_freq( tune_req_tx, 0)
res2 = uhd_usrp_source_0.set_center_freq(tune_req_rx, 0)
This code works exactly as expected ... my received baseband signal always
stays at 1 MHz (the retuning is transparent to my baseband!) but the phase
always changes.
This makes sense because I do not use timed commands and hence the DUC/DDC is
not aligned properly.
Now I change to this code:
tune_req_tx = uhd.tune_request()
tune_req_tx.rf_freq_policy = uhd.tune_request.POLICY_MANUAL
tune_req_tx.dsp_freq_policy = uhd.tune_request.POLICY_MANUAL
tune_req_tx.rf_freq = rf_freq
tune_req_tx.dsp_freq = -dsp_freq
tune_req_rx = uhd.tune_request()
tune_req_rx.rf_freq_policy = uhd.tune_request.POLICY_MANUAL
tune_req_rx.dsp_freq_policy = uhd.tune_request.POLICY_MANUAL
tune_req_rx.rf_freq = rf_freq
tune_req_rx.dsp_freq = dsp_freq
# create timed command:
now = usrp_sink.get_time_now()
uhd_usrp_sink_0.set_command_time(now + uhd.time_spec(0.2))
uhd_usrp_source_0.set_command_time(now + uhd.time_spec(0.2))
res1 = uhd_usrp_sink_0.set_center_freq( tune_req_tx, 0)
res2 = uhd_usrp_source_0.set_center_freq(tune_req_rx, 0)
uhd_usrp_sink_0.clear_command_time()
uhd_usrp_source_0.clear_command_time()
Suddenly my frequency is offset by 100kHz. This makes totally no sense!
As I mentioned above, I assume the reason is that all these timed commands
eventually arrive on the same hardware and maybe overwrite themselves in a way
creating unpredictable behavior.
So, what is the correct way to do it (with USRP Source/Sink blocks in
gnuradio)??
Thanks
Lukas
PS: If it's multiple receiver blocks I can use the same USRP Source block with
Num Channels > 1. I guess that would make live easier. But I have TX+RX to
phase align.
_______________________________________________
USRP-users mailing list
[email protected]
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com