GNURadio/USRP stream tag execution not as expected

173 Views Asked by At

TL;DR: Using tags on streams to switch the gain of a USRP (especially X310) seems to be executed asynchronously. Help!

Hi,

I'm working with a USRP B210/X310 and I'm trying to send a frame with containing some payload, with synchronization sequences before and after the payload. For interesting measurements bit error rate measurements, I want to get a low SNR for the payload. Since I need a much better SNR for more synchronization, I'm trying to send the synchronization sequence with a high gain, while sending the payload with a much lower gain.

Trying to implement this I encountered some unexpected behavior while using the tagged stream commands for the GNURadio block. So I went back and made the most simple setup, I could imagine: I did create a complex oscillation and tagged it with a gain changing command every 2000 samples. The gain only switches between two values.

Using the USRP B210 the result is close to what I'd expect. The upper plot in this screenshot shows the transmit signal with the tags. The lower plot shows the absolute value of the received signal (so that I'm able to trigger on the gain slope). The screenshot is quite close to the expected behavior, but (this isn't really visible in the screenshot) the duration between the gain switched in the received signal is fluctuating a lot.

Using the USRP X310 the result differs significantly from the expected behavior. (There are no changes in the flowghraph compared to the B210 except the usage of a X310 instead of the B210) I took this screenshot in which one can see, that the time between the gain switching isn't only changing, but also the timing is totally off. It looks as if the USRP would bulk-execute (or at least asynchronously) the commands and wouldn't care for the position of the tag at all.

Any ideas, where to look for/how to remove the error?

Thank you very much in advance!

1

There are 1 best solutions below

0
nickob98 On

Update: I found a way to make it work on the X310 (and in a limited way also for the B210)

If I implement it as a bursty transmission (with tx_sob, tx_eob and tx_time tag) I can calculate the time of the gain change from tx_time and the sample rate and add it to the tx_command tag. This only works for the X310.

For the B210 the time tag doesn‘t work for some reason. But on a bursty transmission the position of the tx_command tag works to some extend (not on the exact sample asked for, but with some delay).