Thursday, June 25, 2015

Re: [Discuss-gnuradio] problem with send() function making OOT

Hi Sanjoy,
Nice project!

> With this, I am actually trying to achieve time sync for X310. With
> separate UHD source and sink--I could not achieve time sync with
> different ports.
That's absolutely possible! Two channels in the same X310 have the same
clock and time source.

For example, generate a Flow graph with GRC with a USRP Source,
configure it to have 2 channels. This will automatically make sure that
these two channels are time-aligned.
If you have a sink in your flow graph, you can do exactly the same:
do the followin in your python file, just before tb.start() gets called:

now = usrp_source0.get_time_now() #or however your source is called
starttime = now + uhd.time_spec(1.5) #1.5 seconds in the future
usrp_source0.set_start_time(starttime)
usrp_sink0.set_start_time(starttime).

The multiple sample streams that now come out of the USRP source and go
into the USRP sink will now start exactly at the same time; that means,
there is (for a single sampling rate/master clock rate/frequency
combination) a static offset between RX and TX, due to the fact that the
TX timestamp applies to the point in time where a sample enters the DSP
chain on the X310, and the RX timestamp to the time it exits the DSP chain.

If you have more than one X310, you will need to synchronize these by
means of hardware (e.g. external PPS) and use multiple addresses as the
USRP block's address.

> The code is from CEL,KIT --Echotimer. I tried it over X310, after using
> the subdev_spec, it worked nicely for SISO. I am trying to use it for
> MIMO. I am not really much good at this coding. I just started learning
> it this month.
Echotimer was originally a tool used to calibrate out the static RX/TX
delay you get for the direct path between the radar TX antenna and RX
antenna. That offset was typically empirically observed and then used as
a parameter.
Now, for MIMO, the situation would be much more complex, because you
wouldn't only have an offset between TX and RX, but also between
different TXes and RXes, if not the USRPs had the ability to be
coherent, based on timed commands (which you use by setting the start time).
You can get the same behaviour for your MIMO case (that is, delay one
stream by a N samples) by just starting the USRP sink N/f_sample later,
using the set_start_time method.

Stefan's Wunsch's adaptation of echotimer in gr-radar has the advantage
that it is a tagged stream block, which is really handy for "bursty"
applications like radar. I don't know if only getting bursts of data is
what you want, or if you'd prefer continuous sample streams like the UHD
sink and source give you.

There's one thing that could use improvement in the echotimer code: If
the set_?x_freq() were done after the time and clock sources had been
set as a timed command (i.e. after calling set_command_time()), then the
SBX daughterboards would always have the same phase relationship after
tuning to the same frequency, which might be really handy in MIMO.

In its wholeness, your block looks a lot better! I'm especially relieved
by seeing the thread.join() methods being used to ensure that the block
waits long enough until samples have been sent and received.

Overall, I think you might want to try using the normal USRP sink and
USRP source, synchronizing them via timed commands (set_start_time) :)
If they give you what you want, then you're better off without
echotimer. If you really want to integrate echotimer into your own OOT
(instead of just relying on installing gr-radar, which would probably be
totally OK), you should make the "namespace ... {" directive match your
OOT's other blocks.


Best regards,
Marcus

On 06/25/2015 11:45 AM, Sanjoy Basak wrote:
> Hi Marcus,
> Thanks for the response. I did not get any notification in my inbox. So
> I put it there.
>
> I am trying to implement MIMO OFDM radar with X310.
> With this, I am actually trying to achieve time sync for X310. With
> separate UHD source and sink--I could not achieve time sync with
> different ports.
>
> The code is from CEL,KIT --Echotimer. I tried it over X310, after using
> the subdev_spec, it worked nicely for SISO. I am trying to use it for
> MIMO. I am not really much good at this coding. I just started learning
> it this month.
>
> I will try to correct the code with the points you mentioned.
> I am putting the the impl.cc code, which is a bit large. But it would be
> really kind if you can go through and find any further problem to
> correct.
>
> best regards
> Sanjoy Basak
> thesis student, IHE, KIT
>
> The subdev spec and others I hardcoded those to check whether works or
> not.
>
> /* -*- c++ -*- */
> /*
> * Copyright 2014 Communications Engineering Lab, KIT.
> *
> * This 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, or (at your option)
> * any later version.
> *
> * This software 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 software; see the file COPYING. If not, write to
> * the Free Software Foundation, Inc., 51 Franklin Street,
> * Boston, MA 02110-1301, USA.
> */
>
> #ifdef HAVE_CONFIG_H
> #include "config.h"
>

No comments:

Post a Comment