On 04/18/2019 04:02 PM, Rob Kossler wrote:
Ok. I couldn't seem to duplicate with the stock "rx_samples_to_file", but with the following minor mods, I see some of the bad behavior. This sure looks like a UHD bug to me.

I simply added timed commands around the set_rx_freq() function (see snippet below as well as attached source code). Is this the correct way to do it? If so, then I believe there is a bug because I get changing spectra just by changing the LO offset.

  uhd::time_spec_t cmd_time = usrp->get_time_now()+0.1;
usrp->set_command_time(cmd_time);
usrp->set_rx_freq(tune_request, channel);  // this line not modified
usrp->clear_command_time();

My command line was
rx_samples_to_file --nsamps 500000 --rate 50e6 --freq 2450e6 --lo-offset -10e6

If I change just the LO offset (always keeping "--freq 2450e6"), the known CW tone that I supply as an input signal moves around the spectrum.

This is the correct spectrum achieved with --lo-offset 0. Note the CW tone at 5 MHz which is correct because my sig gen is transmitting at 2455 MHz.
image.png

This is the spectrum received with --lo-offset -10e6. Note that the tone (which did not change from the example above) shows up at 15 MHz instead of the correct location at 5 MHz.
image.png
Rob

OK, so what happens if you use a *positive* LO offset?




On Thu, Apr 18, 2019 at 1:53 PM Rob Kossler <rkoss...@nd.edu <mailto:rkoss...@nd.edu>> wrote:

    I do see in the documentation that the tune result "target_rf_freq"
    will match the tune request "rf_freq", which it does in my example
    below.  So, I suppose the output shown is as expected for my request.
    Unfortunately, this doesn't solve my problem of the actual spectrum
    being wrong.  I may have to construct a test case to show that the
    problem is in UHD....

    On Thu, Apr 18, 2019 at 1:50 PM Marcus D. Leech via USRP-users
    <usrp-users@lists.ettus.com <mailto:usrp-users@lists.ettus.com>>
    wrote:
    >
    > On 04/18/2019 01:44 PM, Rob Kossler via USRP-users wrote:
    >
    > Hi,
    > I am seeing some strange (and unrepeatable) behavior with an
    X310/UBX-160 and the multi_usrp->set_rx_freq() function.  I call
    this function with a tune_request that I create with a desired
    target frequency & lo_offset. The output below shows a "pp_string"
    of the request and the result (for the request, I had to create my
    own "pp_string" function but for the result, I used the existing
    Ettus function).
    >
    > I can tell from the resulting spectrum (not provided) that the
    frequencies / offsets are often not getting set correctly because
    I have a CW tone at a known frequency coming in.  But, what I am
    presently interested in is the output shown below.   In this
    example, I requested a target frequency of 2450 MHz with a 5 MHz
    LO offset.  The tune request looks like I would expect.  However,
    for the tune result, shouldn't the "Target RF freq" match the
    "Target freq" from the request (i.e., 2450 MHz rather than 2455 MHz)?
    > Rob
    >
    > // This is essentially the code executed
    > tune_request_t tune_req(2450e6,5e6);
    > tune_result_t tune_res = usrp->set_rx_freq(tune_req,0);
    >
    > // here is the output showing to_pp_string()
    > Tune request
    >     RF Policy:   M
    >     Target freq: 2450.000000 (MHz)
    >     RF freq:     2455.000000 (MHz)
    >     DSP Policy:  A
    >     DSP freq:    0.000000 (MHz)
    >     args:
    >
    > Tune Result:
    >     Target RF  Freq: 2455.000000 (MHz)
    >     Actual RF  Freq: 2455.006105 (MHz)
    >     Target DSP Freq: 5.006105 (MHz)
    >     Actual DSP Freq: 5.006105 (MHz)
    >
    > The "Target RF Frequency" is the frequency setting of the LO,
    which if you are requesting a 5MHz LO offset, will be somewhere
    around 5MHz away from
    >   your target "sky" frequency.  The DSP arranges to "mop up" the
    difference.
    >
    >
    > _______________________________________________
    > USRP-users mailing list
    > USRP-users@lists.ettus.com <mailto:USRP-users@lists.ettus.com>
    > http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com


_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to