How is data retrieved from USRP when using txUSRP and rxUSRP?

15 views (last 30 days)
I have two USRP boards: txUSRP (for data transmission) and rxUSRP (for data reception).
I set the rxUSRP such that each time it retrieves data of length 2000 samples.
How is data processed by rxUSRP, if a frame of length 19000 samples is sent by the txUSRP? That is, does that mean that the sent frame (19000 samples) is stored in the rxUSRP memory, and each time the rxUSRP delivers data of length 2000 samples to the host PC (meaning that the sent frame will be fully retrieved in 10 times)?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 1 Apr 2024 at 0:00
Edited: MathWorks Support Team on 1 Apr 2024 at 23:40
The "comm.SDRuTransmitter" and "comm.SDRuReceiver" system objects are used to transmit and receive data from USRP in real time.
Real time processing implies that there would not be any intermediate memory involved in the process of transmitting or receiving data, using USRP. The process of transmitting or receiving happens at the specified sample rate.
The concept of frame length, applies only for the frame based processing that happens in MATLAB.
Transmitter and Receiver Sides
  • At the transmitter side, for each "step( )" call, data of size, specified by 'frame length' will be provided to the "comm.SDRuTransmitter" in MATLAB, and the data will be transmitted by the USRP radio at the specified "SampleRate" ("MasterClockRate_OfUSRP/USRPInterpolationFactor").
  • At the receiver side, the data will be received at the specified sample rate from the USRP, using comm.SDRuReceiver, and the data will be available as frames in MATLAB, with the size of each frame specified by the property 'SamplesPerFrame'
Sample Rate defines the rate of data transmission between MATLAB and the USRP radio. Connecting using a SMA cable ensures that, the data is not severely corrupted by the noise. However, there are processing delays involved in this process, that are incurred when the USRP provides the received data to MATLAB. The data length flag at the output of the "step(rx)" for the "comm.SDRuReceiver", should be used to check if the data is valid or not. Please see the information on "dataLen" in documentation page here:
Invalid data means that MATLAB does not have enough samples specified by samples per frame. It does not mean that the transmitted samples are lost. The invalid data should just be discarded, and the signal amplitude fall will be usually observed for invalid data. The transmitted data cannot be immediately received on the next "step( )" call to the receiver. But this does not indicate that there is a loss of the transmitted data. It can be seen as the delay due to the data buffering, at the receiver, in MATLAB. To distinguish the valid and invalid data, the "data_len" flag at the output of the "step( )" for "SDRuReceiver" must be used, see documentation page here:
https://www.mathworks.com/help/supportpkg/usrpradio/ug/apply-conditional-execution.html
To observe the LEDs, you can transmit and receive continuously. A single "step( )" call might be too quick to observe the LED blinking.
Underrun in Transmitter, Overrun in Receiver
  • The "underrun" flag==1 at the transmitter indicates that MATLAB is not able to provide samples to the USRP radio, at the requested sample rate. So the samples are dropped, at the particular sampling intervals.
  • The "overrun" flag==1 at the receiver indicates that MATLAB is not able to receive the samples into the work space, from the USRP radio, at the specified sample rate. So the samples are lost in the process.
More information on this is available in the documentation page:
https://www.mathworks.com/help/supportpkg/usrpradio/ug/detect-underruns-and-overruns.html
Switching to lower sample rates would avoid the under-runs and over-runs. Using the burst mode, the over-runs and under-runs can be avoided, without considering to switch to the lower sample rates. More information on burst mode buffering is available in the documentation page here:
https://www.mathworks.com/help/supportpkg/usrpradio/ug/burst-mode-buffering.html
Examples
We recommend trying out the real time examples like the following:
Please see the m-help regarding the system objects "comm.SDRuTransmitter" and "comm.SDRuReceiver".

More Answers (0)

Categories

Find more on Communications Toolbox in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!