[prev in list] [next in list] [prev in thread] [next in thread]
List: usrp-users
Subject: Re: [USRP-users] Matlab R2015 USRP RADIO toolbox MIMO - Rx/Tx at the same time
From: Ethem Sozer via USRP-users <usrp-users () lists ! ettus ! com>
Date: 2016-01-28 14:57:41
Message-ID: 1f6fe4e8de014e23a2d27b84bac90c44 () ex13amer-00-ls ! ad ! mathworks ! com
[Download RAW message or body]
[Attachment #2 (text/plain)]
Hi Jonas,
Unfortunately, a Simulink model also runs on a single thread. But you are correct \
about using MATLAB Function Block to bring MATLAB code into Simulink. Regards,
Ethem
From: USRP-users [mailto:usrp-users-bounces@lists.ettus.com] On Behalf Of Schild \
Jonas via USRP-users
Sent: Thursday, January 28, 2016 3:46 AM
To: usrp-users@lists.ettus.com
Subject: Re: [USRP-users] Matlab R2015 USRP RADIO toolbox MIMO - Rx/Tx at the same \
time
Hi John
I think the problem is with MATLAB itself. You should should try Simulink. They have \
receiver and transmitting objects for the USRP. You can easily insert a MATLAB \
function block and put your existing processing code inside, so you don't have to \
adapt all of it to Simulink.
Regards,
Jonas
Berner Fachhochschule
Institut für Risiko- und Extremwertanalyse
Jonas Schild
El. Ing. BSc
___________________________________________________________
Jlcoweg 1, CH-3400 Burgdorf
Telefon direkt +41 34 426 69 24
jonas.schild@bfh.ch<mailto:jonas.schild@bfh.ch>
irex.ti.bfh.ch<http://www.forschung.ti.bfh.ch/imc>
From: USRP-users [mailto:usrp-users-bounces@lists.ettus.com] On Behalf Of Johnathan \
Rodgers via USRP-users
Sent: Mittwoch, 27. Januar 2016 17:24
To: usrp-users@lists.ettus.com<mailto:usrp-users@lists.ettus.com>
Subject: [USRP-users] Matlab R2015 USRP RADIO toolbox MIMO - Rx/Tx at the same time
Dear all,
In Matlab, I'm trying to transmit and receive at the same time with one X300 (MIMO \
capability) but the code below is sequential (sdruFRSFullDuplexTransceiver_TxRx.m). \
Is it possible to do step(radioTx, data_tx) and step(radioRx) in parallel? Or is \
there another way with the C++ API? Thanks in advance.
Cheers,
John
%% Discover Radio
connectedRadios = findsdru;
if strncmp(connectedRadios(1).Status, 'Success', 7)
radioFound = true;
platform = connectedRadios(1).Platform;
switch connectedRadios(1).Platform
case {'X300','X310'}
address = connectedRadios(1).IPAddress;
end
end
%% Initialization
% Transmitter Initialization
rfTxFreq = 2e9; % RF Transmitter Center Frequency (Hz)
paramsTx = configureFDTx(platform, rfTxFreq);
% Receiver Initialization
rfRxFreq = 2e9; % RF Receiver Center Frequency (Hz)
paramsRx = configureFDRx(platform, rfRxFreq);
%% Waveform to transmit
hwav = phased.RectangularWaveform(‘PulseWidth',1e-4);
% Set up transmitter radio object to use the found radio
switch platform
case {'X300','X310'}
radioTx = comm.SDRuTransmitter(...
'Platform', platform, ...
'IPAddress', address, ...
'CenterFrequency', \
paramsTx.CenterFrequency,... 'ChannelMapping', 1)
end
% Set up receiver radio object to use the found radio
switch platform
case {'X300','X310'}
radioRx = comm.SDRuReceiver(...
'Platform', platform, ...
'IPAddress', address, ...
'CenterFrequency', \
paramsRx.CenterFrequency,...
'SampleRate', \
paramsRx.FrontEndSampleRate, ... 'ChannelMapping', 2)
end
%% Stream Processing Loop
% Perform stream processing if a radio is found.
data=[];
if radioFound
% Loop until the example reaches the target stop time.
timeCounter = 0;
while timeCounter < 10%in seconds
% Transmitter stream processing
data_tx = step(hwav); % Generate waveform
step(radioTx, data_tx); % Transmit to USRP(R) radio
% Receiver stream processing
[data_rx, len_rx] = step(radioRx);
data=[data data_rx];
timeCounter = timeCounter + paramsRx.USRPFrameTime;
end
end
[Attachment #3 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Lucida Sans Unicode";
panose-1:2 11 6 2 3 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi \
Jonas,<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Unfortunately, \
a Simulink model also runs on a single thread. But you are correct about using MATLAB \
Function Block to bring MATLAB code into Simulink.<o:p></o:p></span></p> <p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Ethem<o:p></o:p></span></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif"> USRP-users \
[mailto:usrp-users-bounces@lists.ettus.com] <b>On Behalf Of </b>Schild Jonas via \
USRP-users<br> <b>Sent:</b> Thursday, January 28, 2016 3:46 AM<br>
<b>To:</b> usrp-users@lists.ettus.com<br>
<b>Subject:</b> Re: [USRP-users] Matlab R2015 USRP RADIO toolbox MIMO - Rx/Tx at the \
same time<o:p></o:p></span></p> </div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="DE-CH" \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi \
John<o:p></o:p></span></p> <p class="MsoNormal"><span lang="DE-CH" \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I \
think the problem is with MATLAB itself. You should should try Simulink. They have \
receiver and transmitting objects for the USRP. You can easily insert a MATLAB \
function block and put your existing processing code inside, so you don't have to \
adapt all of it to Simulink.<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Jonas<o:p></o:p></span></p>
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE-CH" \
style="font-size:7.5pt;font-family:"Lucida Sans \
Unicode",sans-serif;color:#1F497D">Berner Fachhochschule</span><span \
lang="DE-CH" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><br>
</span><span lang="DE-CH" style="font-size:7.5pt;font-family:"Lucida Sans \
Unicode",sans-serif;color:#1F497D">Institut für Risiko- und \
Extremwertanalyse<br> Jonas Schild<br>
El. Ing. BSc<br>
___________________________________________________________<br>
<br>
Jlcoweg 1, CH-3400 Burgdorf</span><span lang="DE-CH" \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><br>
</span><span lang="DE-CH" style="font-size:7.5pt;font-family:"Lucida Sans \
Unicode",sans-serif;color:#1F497D">Telefon direkt +41 34 426 69 \
24</span><span lang="DE-CH" \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><br>
</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><a \
href="mailto:jonas.schild@bfh.ch"><span lang="DE-CH" \
style="font-size:7.5pt;font-family:"Lucida Sans \
Unicode",sans-serif;color:blue">jonas.schild@bfh.ch</span></a></span><span \
lang="DE-CH" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><br>
</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><a \
href="http://www.forschung.ti.bfh.ch/imc"><span lang="DE-CH" \
style="font-size:7.5pt;font-family:"Lucida Sans \
Unicode",sans-serif;color:blue">irex.ti.bfh.ch</span></a></span><span \
lang="DE-CH" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE-CH" \
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span \
style="font-size:11.0pt;font-family:"Calibri",sans-serif"> USRP-users [<a \
href="mailto:usrp-users-bounces@lists.ettus.com">mailto:usrp-users-bounces@lists.ettus.com</a>]
<b>On Behalf Of </b>Johnathan Rodgers via USRP-users<br>
<b>Sent:</b> Mittwoch, 27. Januar 2016 17:24<br>
<b>To:</b> <a href="mailto:usrp-users@lists.ettus.com">usrp-users@lists.ettus.com</a><br>
<b>Subject:</b> [USRP-users] Matlab R2015 USRP RADIO toolbox MIMO - Rx/Tx at the \
same time<o:p></o:p></span></p> <p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Dear all,<br>
In Matlab, I'm trying to transmit and receive at the same time with one X300 (MIMO \
capability) but the code below is sequential (sdruFRSFullDuplexTransceiver_TxRx.m). \
Is it possible to do step(radioTx, data_tx) and step(radioRx) in parallel?<br> Or is \
there another way with the C++ API?<br> Thanks in advance.<br>
Cheers,<br>
John<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">%% Discover Radio<br>
connectedRadios = findsdru;<br>
if strncmp(connectedRadios(1).Status, 'Success', 7)<br>
radioFound = true;<br>
platform = connectedRadios(1).Platform;<br>
switch connectedRadios(1).Platform<br>
case {'X300','X310'}<br>
address = \
connectedRadios(1).IPAddress;<br> end<br>
end<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">%% Initialization<br>
% Transmitter Initialization<br>
rfTxFreq = 2e9; % RF \
Transmitter Center Frequency (Hz)<br> \
paramsTx = \
configureFDTx(platform, rfTxFreq);<br> % Receiver Initialization<br>
rfRxFreq = 2e9; % RF \
Receiver Center Frequency (Hz)<br> \
paramsRx = \
configureFDRx(platform, rfRxFreq);<o:p></o:p></p> </div>
<div>
<p class="MsoNormal">%% Waveform to transmit<br>
hwav = phased.RectangularWaveform(‘PulseWidth',1e-4);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">% Set up transmitter radio object to use the found radio<br>
switch platform<br>
case {'X300','X310'}<br>
radioTx = comm.SDRuTransmitter(...<br>
&n \
bsp; \
'Platform', \
platform, ...<br> &n \
bsp; \
'IPAddress', address, \
...<br> \
\
'CenterFrequency', paramsTx.CenterFrequency,...<br> \
&n \
bsp; \
'ChannelMapping', 1)<br> end<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">% Set up receiver radio object to use the found radio<br>
switch platform<br>
case {'X300','X310'}<br>
radioRx = comm.SDRuReceiver(...<br>
&n \
bsp; \
'Platform', \
platform, ...<br> &n \
bsp; \
'IPAddress', address, \
...<br> \
\
'CenterFrequency', paramsRx.CenterFrequency,...<br> \
&n \
bsp; \
'SampleRate', \
paramsRx.FrontEndSampleRate, ...<br> \
&n \
bsp; \
'ChannelMapping', 2)<br> end<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">%% Stream Processing Loop<br>
% Perform stream processing if a radio is found.<br>
data=[];<br>
if radioFound<br>
% Loop until the example reaches the target stop time.<br>
timeCounter = 0;<br>
while timeCounter < 10%in seconds<br>
% Transmitter stream processing<br>
data_tx = step(hwav); % Generate \
waveform <br> step(radioTx, data_tx); % \
Transmit to USRP(R) radio<br> <br>
% Receiver stream processing<br>
[data_rx, len_rx] = step(radioRx);<br>
data=[data data_rx];<br>
timeCounter = timeCounter + \
paramsRx.USRPFrameTime;<br> end<br>
end<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>
_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
--===============9214412760251896163==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic