MATLAB Answers

How to extract two signals from two different USRP devices connected with MIMO expansion cable?

7 views (last 30 days)
I am working tith Matlab2020a and USRP Support Package. I want to present a concept of diversity in mobile communications, therefore I am using two N210 USRP devices (SBX motherboard) and Rx port on each of them. Two USRP devices are connected with MIMO expansion cable. Both of USRP's have static IP address '' and my computer network IP address is set to ''.
Problem that I am facing is not being able to extract two signals, one from every USRP. When I call the findsdru command:
connectedRadios = findsdru;
I get structure 1x2 where I can see that both of USRP's are connected successfully. When I tried connecting one USRP device, using the command comm.SDRuReceiver I was able to get received signal x1 from the receiving anntena. I did that in the following way:
connectedRadios = findsdru;
if strncmp(connectedRadios(1).Status, 'Success', 7)
radioFound = true;
platform = connectedRadios(1).Platform;
switch connectedRadios(1).Platform
case {'B200','B210'}
address = connectedRadios(1).SerialNum;
case {'N200/N210/USRP2','X300','X310','N300','N310','N320/N321'}
address = connectedRadios(1).IPAddress;
radioFound = false;
address = '';
platform = 'N200/N210/USRP2';
fmRxParams = getParamsSdruFMExamples(platform)
switch platform
case {'B200','B210'}
radio1 = comm.SDRuReceiver(...
'Platform', platform, ...
'SerialNum', address, ...
'MasterClockRate', fmRxParams.RadioMasterClockRate);
case {'X300','X310','N300','N310','N320/N321'}
radio1 = comm.SDRuReceiver(...
'Platform', platform, ...
'IPAddress', address, ...
'MasterClockRate', fmRxParams.RadioMasterClockRate);
case {'N200/N210/USRP2'}
radio1 = comm.SDRuReceiver(...
'Platform', platform, ...
'IPAddress', address);
radio1 = comm.SDRuReceiver('');
radio1.CenterFrequency = 500000000;
radio1.Gain = fmRxParams.RadioGain;
radio1.DecimationFactor = fmRxParams.RadioDecimationFactor;
radio1.SamplesPerFrame = fmRxParams.RadioFrameLength;
radio1.OutputDataType = 'single'
hwInfo = info(radio1)
fmBroadcastDemod = comm.FMBroadcastDemodulator(...
'SampleRate', fmRxParams.RadioSampleRate, ...
'FrequencyDeviation', fmRxParams.FrequencyDeviation, ...
'FilterTimeConstant', fmRxParams.FilterTimeConstant, ...
'AudioSampleRate', fmRxParams.AudioSampleRate, ...
'PlaySound', true, ...
'BufferSize', fmRxParams.BufferSize, ...
'Stereo', true);
if radioFound
% Loop until the example reaches the target stop time, which is 10
% seconds.
timeCounter = 0;
while timeCounter < fmRxParams.StopTime
[x1, len] = step(radio1);
if len > 0
% FM demodulation
step(fmBroadcastDemod, x1);
% Update counter
timeCounter = timeCounter + fmRxParams.AudioFrameTime;
Now, I would like to get signal x2 in the same way from the second USRP, but I don't know how. Am I supposed to change the IP address of one of the USRP's or I can manage this problem using the Matlab functions.

Accepted Answer

More Answers (0)

Community Treasure Hunt

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

Start Hunting!