discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rate matching between host and SDR


From: Moses Browne Mwakyanjala
Subject: Rate matching between host and SDR
Date: Thu, 6 Jan 2022 16:12:22 +0100

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?

void
USRPDriver::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. 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]