[USRP-users] set_rx_lo_source repeat

2018-03-15 Thread Андрей 1 via USRP-users

HelloEarlier I already wrote about big times for the example of
twinrx_freq_hopping
http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2018-February/027782.htmlCan
anyone analyze the source code(rx_samples_c in the attachment) and say why it
turns out such a strange result (TestTwinRX) when called set_rx_lo_source.

Thank you
/*
 * Copyright 2015 Ettus Research LLC
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 */

#include 

#include "getopt.h"

#include 
#include 
#include 
#include 

#define EXECUTE_OR_GOTO(label, ...) \
if(__VA_ARGS__){ \
return_code = EXIT_FAILURE; \
goto label; \
}

#define MIN(x,y) (((x) < (y)) ? (x):(y))

void print_help(void){
fprintf(stderr, "rx_samples_c - A simple RX example using UHD's C API\n\n"

"Options:\n"
"-a (device args)\n"
"-f (frequency in Hz)\n"
"-r (sample rate in Hz)\n"
"-g (gain)\n"
"-n (number of samples to receive)\n"
"-o (output filename, default = \"out.dat\")\n"
"-v (enable verbose prints)\n"
"-h (print this help message)\n");
};

#define spb 1024
#define fcount 11

size_t ACTIVE_CHAN = 0;
size_t UNUSED_CHAN = 1;

uhd_usrp_handle usrp;
uhd_rx_streamer_handle streamer;
uhd_rx_metadata_handle metadata;

double f1 = 100e+6;
double f2 = 110e+6;
double fs = 1e+6;

double receive_interval = 50e-3;

size_t recv_spb;

double rf_freqs[fcount];
float data[fcount*spb*2]; // 100..110 freq range

uhd_error set_device_subspec(uhd_usrp_handle h,
   const char* markup)
{
uhd_error e;
uhd_subdev_spec_handle spec;

e = uhd_subdev_spec_make(,markup);
if (e == UHD_ERROR_NONE)
e = uhd_usrp_set_rx_subdev_spec(h,spec,0);
uhd_subdev_spec_free();

return e;
}

uhd_error init_device_stream(uhd_usrp_handle h,
 uhd_rx_streamer_handle sh)
{
uhd_stream_args_t stream_args = {
.cpu_format = "fc32",
.otw_format = "sc16",
.args = "",
.channel_list = _CHAN,
.n_channels = 1
};

return uhd_usrp_get_rx_stream(h,_args,sh);
}

uhd_error set_device_freq(uhd_usrp_handle h,
  double freq,
  size_t chan)
{
uhd_tune_request_t tune_request = {
.target_freq = freq,
.rf_freq_policy = UHD_TUNE_REQUEST_POLICY_AUTO,
.dsp_freq_policy = UHD_TUNE_REQUEST_POLICY_AUTO,
};
uhd_tune_result_t tune_result;

return uhd_usrp_set_rx_freq(h,_request,chan,_result);
}

uhd_error init_commands(uhd_usrp_handle h,
uhd_rx_streamer_handle sh,
int n)
{
uhd_error e;

e = uhd_usrp_set_time_now(h,0,0,0);
if (e != UHD_ERROR_NONE) return e;

uhd_stream_cmd_t stream_cmd = {
.stream_mode = UHD_STREAM_MODE_NUM_SAMPS_AND_DONE,
.num_samps = spb,
.stream_now = false
};

double command_time = 0;

for(int i=0; i

[USRP-users] set_rx_lo_source

2018-03-15 Thread Андрей 1 via USRP-users

Hello
I duplicated the attachment with the source code.Derek can you see what's 
wrong.I
can understand what the maximum speed of perestroika I can get with TwinRX.
Thank you
___
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com


Re: [USRP-users] set_rx_lo_source

2018-03-02 Thread Derek Kozel via USRP-users
Hello,

Setting the LO source does not tune the synthesizers so the actual command
duration should be very short. How are you measuring the durations?

I looked at why the twinrx_freq_hopping demo is not built by default on
Windows and it is because of an optional feature which requires a library
which Windows does not include, Curses. By removing the ascii_art_dft.hpp
include and the write_fft_to_file function the example should compile and
run with no other changes on Windows. Doing this would be a good test as it
would help isolate if there is a performance issue or an issue with how the
API is being used in your current test program. The example is very
carefully constructed so that there are minimal delays and so commands are
already queued on the FPGA before their scheduled execution time.

If you have a custom C program could you share the code? It would be useful
to see the order of operations.

Regards,
Derek


On Tue, Feb 27, 2018 at 3:08 PM, Андрей 1 via USRP-users <
usrp-users@lists.ettus.com> wrote:

>
> Hello
>
> 
>
> In the previous post(twinrx_freq_hopping example
> ),
> I wrote that I could not get time in 5 ms for example twinrx_freq_hopping.
> I measure the commands execute time  in the recieve loop and found with
> surprise that the set_rx_lo_source function for the first time worked 0 ms
> and the next time more than 40 ms.
> It is because of this that a large tuning time in the frequency range is
> obtained.
> Can someone explain to me why this can happen?
>
>
> Thank you
>
>
> ___
> USRP-users mailing list
> 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


[USRP-users] set_rx_lo_source

2018-02-27 Thread Андрей 1 via USRP-users

Hello
In the previous post(twinrx_freq_hopping example), I wrote that I could not get
time in 5 ms for example twinrx_freq_hopping.I measure the commands execute time
in the recieve loop and found with surprise that the set_rx_lo_source function
for the first time worked 0 ms and the next time more than 40 ms.It is because 
of
this that a large tuning time in the frequency range is obtained.Can someone
explain to me why this can happen?

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