Hi Nate,
Nate wrote:
> Hi Luke,
>
> There is an example of setting timed commands in a custom block for the
> TwinRX in gr-doa here:
>
> https://github.com/EttusResearch/gr-doa/blob/master/python/twinrx_usrp_source.py#L101-L121
>
> You can do this with the standard UHD source/sink blocks, by first making
> your flowgraph, then generate the .py in GRC,
> then open up that .py file and modify it to add the timed command calls.
>
> If you modify the GRC and regenerate the .py, it'll overwrite your changes.
Thanks a lot! That makes sense.
Unfortunately I did not mention that I have a special case too: My TX is at
fcenter and my RX is at 2*fcenter.
The code which is generated by GRC looks like this (currently I have one TX and
two RX):
def set_fcenter(self, fcenter):
self.fcenter = fcenter
self.uhd_usrp_sink_0.set_center_freq(self.fcenter, 0)
self.uhd_usrp_source_0.set_center_freq(2*self.fcenter, 0)
self.uhd_usrp_source_0.set_center_freq(2*self.fcenter, 1)
Hence the code in your link does not 100% apply. However, I modified it as
follows:
def set_fcenter(self, fcenter):
self.fcenter = fcenter
tune_resp = self.uhd_usrp_sink_0.set_center_freq(fcenter, 0)
tune_req_tx = uhd.tune_request(rf_freq=fcenter,
rf_freq_policy=uhd.tune_request.POLICY_MANUAL,
dsp_freq=tune_resp.actual_dsp_freq,
dsp_freq_policy=uhd.tune_request.POLICY_MANUAL)
tune_req_rx = uhd.tune_request(rf_freq=2*fcenter,
rf_freq_policy=uhd.tune_request.POLICY_MANUAL,
dsp_freq=2*tune_resp.actual_dsp_freq,
dsp_freq_policy=uhd.tune_request.POLICY_MANUAL)
self.uhd_usrp_source_0.set_center_freq(tune_req_rx, 0)
self.uhd_usrp_source_0.set_center_freq(tune_req_rx, 1)
# Synchronize the tuned channels
now = self.uhd_usrp_sink_0.get_time_now()
self.uhd_usrp_sink_0.set_command_time(now + uhd.time_spec(0.01))
self.uhd_usrp_source_0.set_command_time(now + uhd.time_spec(0.01))
self.uhd_usrp_sink_0.set_center_freq(tune_req_tx, 0)
self.uhd_usrp_source_0.set_center_freq(tune_req_rx, 0)
self.uhd_usrp_source_0.set_center_freq(tune_req_rx, 1)
self.uhd_usrp_source_0.clear_command_time()
So I think I need two tune_request objects because I have two different
frequencies.
However, this does not work: Now my downconverted signal seems to be frequency
shifted by roughly 5kHz.
Do you have an idea how to fix this for my scenario?
Thanks again,
Luke
_______________________________________________
USRP-users mailing list
[email protected]
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com