Lossless real-time signal acquisition from USRP 2955
4 views (last 30 days)
Show older comments
Hi,
I am trying to receive contiguous real-time signal from USRP-2955 (X310) device. But i observe losses in acquisition. For an example, in the following code i try to receive a signal with a sampling rate of 200kHz for 10 seconds. 200e3 samples is fetched by the code for each time. 200e3 samples corresponds 1 second of signal. So I expect to to fetch 200e3 samples of signal in 1 second to accomplish real-time acquisition. As seen at the output of the code, transfer duration (from USRP to computer) of a frame is about 0.007sn (which is very good), but on the other hand, fetch duration is about 1.6sn (which eventually causes signal loss in reception). And 10 seconds of signal is retrieved in 26 seconds.
Even if i change the value of 'SamplesPerFrame', fetch duration never equals to frameDuration (= rcvr.SamplesPerFrame / Fs).
Am i wrong to think that "X seconds of signal must be fetched in X seconds for real-time acquisition", or is there any other mechanism to achieve real-time acquisition?
Thanks in advance.
rcvr = comm.SDRuReceiver(...
'Platform', 'X310', ...
'IPAddress', '192.168.40.2', ...
'CenterFrequency', 105e6, ...
'Gain', 15, ...
'MasterClockRate', 200.0e6, ...
'DecimationFactor', 1000, ...
'ChannelMapping', 2, ...
'SamplesPerFrame', 200000);
info(rcvr)
Fs = rcvr.MasterClockRate / rcvr.DecimationFactor;
rcvdSignal = complex(zeros(rcvr.SamplesPerFrame,1));
secondsToAcquire = 0;
frameDuration = rcvr.SamplesPerFrame / Fs
len = uint32(0);
tstart = tic;
while secondsToAcquire < 10
tstartFetch = tic; % start time of fetching signal
while len <= 0
tstartTransfer = tic; % start time of transfering signal to computer
[rcvdSignal, len] = step(rcvr); % ask for signal
TransferDuration = toc(tstartTransfer); % stop time of transfering signal to computer
end
FetchDuration = toc(tstartFetch); % stop time of fetching signal
if len > 0
sprintf('Transfer duration: %f sn \n Fetch Duration : %f sn', TransferDuration, FetchDuration)
secondsToAcquire = secondsToAcquire + frameDuration;
len = uint32(0);
end
end
telapsed = toc(tstart)
release(rcvr);
ans =
struct with fields:
Mboard: 'X310'
RXSubdev: 'UBX RX'
TXSubdev: 'UBX TX'
MinimumCenterFrequency: -70000000
MaximumCenterFrequency: 6.0800e+09
MinimumGain: 0
MaximumGain: 37.5000
GainStep: 0.5000
CenterFrequency: 105e+06
LocalOscillatorOffset: -1.1050e+03
Gain: 15
MasterClockRate: 200000000
DecimationFactor: 1000
BasebandSampleRate: 200000
frameDuration =
1
ans =
'Transfer duration: 0.007381 sn
Fetch Duration : 11.182971 sn'
ans =
'Transfer duration: 0.007092 sn
Fetch Duration : 1.630546 sn'
ans =
'Transfer duration: 0.006913 sn
Fetch Duration : 1.637092 sn'
ans =
'Transfer duration: 0.006939 sn
Fetch Duration : 1.636543 sn'
ans =
'Transfer duration: 0.006733 sn
Fetch Duration : 1.685166 sn'
ans =
'Transfer duration: 0.006724 sn
Fetch Duration : 1.668035 sn'
ans =
'Transfer duration: 0.006891 sn
Fetch Duration : 1.657259 sn'
ans =
'Transfer duration: 0.006692 sn
Fetch Duration : 1.663458 sn'
ans =
'Transfer duration: 0.006837 sn
Fetch Duration : 1.675342 sn'
ans =
'Transfer duration: 0.006869 sn
Fetch Duration : 1.678966 sn'
telapsed =
26.1198
0 Comments
Accepted Answer
Karunya Choppara
on 12 Nov 2021
Hi,
The increase in time doesn't indicate data loss during acquisition.
The losses in acquisition will be indicated using the overflow output from the SDRuReceiver System Object.
In R2021b, performance enhancement to USRP System Objects are available, with which data acquisition time will be equal to the frame duration in a step call
See the section - "Improved performance for SDRu receiver System object with data reception time and number of overruns" in the release notes for R2021b https://in.mathworks.com/help/supportpkg/usrpradio/release-notes.html
More Answers (0)
See Also
Categories
Find more on Communications Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!