Thanks Marcus. I was referring to application level packets. Is there a way to double check how much is transition time for frequency hopping so that we can accordingly factor that in, in our code?
Thanks Kailash On Fri, Aug 23, 2019 at 8:42 PM Marcus D. Leech <patchvonbr...@gmail.com> wrote: > On 08/23/2019 12:39 AM, kailash kumar wrote: > > Hi Marcus, > > Please find below code for reference. I have removed few sync primates for > readability. > > // Receive callback for loopback mode > void receive_cb(unsigned char *_payload, unsigned int len) { > recvBytes += len; > } > > // Periodic Timer - 1 sec > static void pSigHandler(int signo) { > drv->SetTxFrequency(582.0e6); > drv->SetRxFrequency(582.0e6); > > fprintf(stderr, "sentBytes %d recvBytes %d\n", sentBytes, recvBytes); > bcontinue = true; > startTime = drv->GetTxTime(); > } > > int main(int argc,char **argv) { > // RFDriver abstracts uhd::usrp::multi_usrp::sptr, > uhd::tx_streamer::sptr & uhd::rx_streamer::sptr > drv = new RFDriver(); > drv->SetTxFrequency(562.0e6); > drv->SetRxFrequency(562.0e6); > > // B210 > drv->SetDevString(std::string("serial=312908B")); > drv->SetTxGain(40.0); // uhd::tx_streamer::sptr->set_tx_freq(_tx_freq); > drv->SetRxGain(20.0); // uhd::rx_streamer::sptr->set_rx_freq(_rx_freq); > drv->SetTxSoftGain(-12.0); // powf(10.0f, _tx_gain_soft/20.0f); -> > Software Gain multiplier > > // Init OFDM : bandwidth = 1000e3f, number of subcarriers = 64, cyclic > prefix length = 8, taper length = 2 > // Start Rx -> > usrp_rx->issue_stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS); > drv->InitTxRX(); > > // 1 sec timer to flip frequency > signal(SIGALRM, pSigHandler); > struct itimerval tv; > tv.it_value.tv_sec = 1; > tv.it_value.tv_usec = 0; > tv.it_interval.tv_sec = 1; > tv.it_interval.tv_usec = 0; > setitimer(ITIMER_REAL, &tv, NULL); > > startTime = uhd::tx_streamer::sptr->get_time_now().get_real_secs(); > > for (int i = 0; i < 5000; ++i) { > double diff = uhd::tx_streamer::sptr->get_time_now().get_real_secs() - > startTime; > // If deadline check is disabled, then we are transmitting for entire > duration > bool deadline = std::isgreaterequal(diff, 0.95F); // check if we have > 50 ms left > if (deadline) { > while(!bcontinue) { // This is set on 1 sec timer expiration > sched_yield(); > } > bcontinue = false; > } > drv->SendPayload((unsigned char *)data, n); > } > } > > Thanks > Kailash > > On Fri, Aug 23, 2019 at 9:05 AM Marcus D. Leech via USRP-users < > usrp-users@lists.ettus.com> wrote: > >> On 08/22/2019 11:09 PM, kailash kumar via USRP-users wrote: >> > Hi, >> > >> > I am testing frequency hopping in a loopback mode on B210 using >> > external RF loopback cable. >> > For First slot Tx/Rx is done at freq 562 Mhz. Subsequent slot is at >> > 582 Mhz. >> > I have observed Rx packet loss when Tx is done for entire slot duration. >> > >> > Please let me know if this is expected or if some configuration >> > is required for this. >> > >> > [INFO] [UHD] linux; GNU C++ version 9.1.1 20190716 >> > gcc-9-branch@273504; Boost_106800; UHD_3.13.1.HEAD-0-gbbce3e45 >> > [INFO] [B200] Detected Device: B210 >> > >> > Slot duration - 1 second >> > Rx gain : 20.000000 >> > Tx soft gain : -12.000000 >> > Tx gain : 40.000000 >> > >> > Testing results: >> > sentBytes 7225 recvBytes 7225 -> After sparing 50ms in 1st Tx slot at >> > freq 562 MHz. >> > sentBytes 7390 recvBytes 7390 -> Rest bytes in next Tx slot at freq >> > 582 Mhz. >> > sentBytes 7390 recvBytes 7390 -> No more Tx >> > sentBytes 7390 recvBytes 7390 >> > sentBytes 7390 recvBytes 7390 >> > >> > sentBytes 7390 recvBytes 7375 -> Utilize fully 1st Tx slot at freq 562 >> > MHz. Rx drop observed. >> > sentBytes 7390 recvBytes 7375 -> No more Tx/Rx at 582 Mhz. >> > sentBytes 7390 recvBytes 7375 >> > >> > Thanks & Regards >> > Kailash >> > >> Your description of the problem assumes the reader knows intimately the >> details of exactly what you're doing. We don't. >> >> We need to see code snippets that demonstrate your problem, or a >> much-more detailed description. >> >> >> This doesn't help all that much. > > When you say "drops packets" are you referring to application-layer data > packets, or dropped samples? > > One can expect some issues during frequency transition because there will > always always be transients of some sort in the sample > stream, because, well, that's just how analog hardware behaves when > you're changing frequencies. > > > >
_______________________________________________ USRP-users mailing list USRP-users@lists.ettus.com http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com