Hi everyone, I'm experimenting with a C++ standalone USRP transmitter using the function shown below. The data is generated by another function called Modulate() which "posts" the modulated IQ samples to this function. The transmitter works very well for burst transmissions (individual packets). I was wondering how to do transmission in a continuous way. I mean, the Modulate() function depends on the CPU clock while the actual transmission is dictated by the rate of the USRP. I did try to send blocks of samples (10,000) continuously and the USRP was reporting underruns. How do I make sure my functions run at the same rate as the USRP?
voidUSRPDriver::TransmitIQ(std::vector<std::complex<float> > fcpxIQ){ //assert(1 ==0); if(m_bDeviceUp){ if(DEBUG) std::cout << "USRPDriver::" << __func__ << "Transmitting IQ Frame Size = " << fcpxIQ.size() << std::endl; // setup metadata for the first packet uhd::tx_metadata_t md; md.start_of_burst = false; md.end_of_burst = false; md.has_time_spec = false; md.time_spec = uhd::time_spec_t(1.5); // the first call to send() will block this many seconds before sending: double timeout = 10.0; // timeout (delay before transmit + padding) tx_stream->send(&fcpxIQ[0], fcpxIQ.size(), md, timeout); fcpxIQ.clear(); } } Regards, Moses.