[USRP-users] Configuration Simulink

Mike McLernon Mike.McLernon at mathworks.com
Tue Nov 9 11:12:42 EST 2010

Hi Jorge,

Good questions - see some answers below . . .

From: Jorge Miguel [mailto:jmiggal at gmail.com]
Sent: Monday, November 08, 2010 3:34 PM
To: Mike McLernon; usrp-users at lists.ettus.com
Subject: [USRP-users] Configuration Simulink

Dear Mike,

I am getting started with the USRP2 blocks from Matlab 2010b along with the USRP2 basic receiver and XCVR2450 transceiver.
I read your post "Configuration Simulink". I still have some questions:

>>4. You should try to run with Rapid Accelerator instead of Normal mode.  Be aware that some scopes do not plot data when run in Rapid Accelerator mode, but scopes >>inevitably slow down a model in any case.

Question1)Why only try? Is there any case we are not allowed to run in rapid accelerator mode?

In some cases, scopes do not plot data in Rapid Accelerator (RA) mode.  That could be a reason to avoid RA.  Also, it's always better to use good modeling techniques to speed up your model, and not simply rely on RA.  That being said, RA is a very useful technique that you should take advantage of if you can.

>>9. If the model generates code, the Solver setting should be Fixed-step/discrete.  The tasking mode should be SingleTasking.

Q2) What do you mean by "If the model generates code"? I thought that it has always to be executed in discrete fixed-step. However when executing variable step I got less lost packages, how can it be possible?

If you are using RA, you can use a variable step/discrete solver.  If you are generating a standalone executable, you need to set the solver to fixed-step/discrete.  Also, for a multirate model, a variable step solver polls the Simulink engine less frequently than a fixed step solver, so the VS solver will run faster.

Q3) My goal is to build a radar application within USRP2 and Simulink. Since I cannot skip any information from the receiver part (in order not to miss any target) simulink has to be running in real time, Isn´t it?


Q4) Does it help to use the real time workshop of simulink? I do not know how it works....Is this what you mean by "generating code"? Precompile code and then execute the pre-compiled code? Does the same workspace have more performance using this technique? Woull it be interesting for my radar application?

You can use Real-Time Workshop to generate a standalone executable that does not require Simulink.  However, when you use Rapid Accelerator, you are also creating an executable that eliminates much of the Simulink overhead.  For your application, since you are receiving data real-time, I believe that you will want to have Simulink in the loop.

Q5) When I recieve data from the USRP2 and I use the Spectrum Scope I always see a great DC component (frequency 0). I do not understand where does it come from. Do you have any idea?

A couple of thoughts:

1.       Are you simply receiving data from the USRP?  Are you processing it at all?

2.       Store the Spectrum Scope input data into a workspace variable and do some post-processing in MATLAB.  Try some histogramming to see if the signal has anything besides the DC component.

3.       What is your input data?  A sine wave?  If so, it is possible that the frequency offset of your USRP2 LO is erroneously landing the sine wave at 0 Hz.  We have seen phenomena like that before.


Many thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/attachments/20101109/60fd44cc/attachment-0002.html>

More information about the USRP-users mailing list