Path: news.mathworks.com!not-for-mail
From: "Kevin " <kedecuyp@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Signal processing blockset and the IQMath library
Date: Thu, 28 Feb 2008 15:29:06 +0000 (UTC)
Organization: Universite libre de Bruxelles
Lines: 30
Message-ID: <fq6k02$r42$1@fred.mathworks.com>
Reply-To: "Kevin " <kedecuyp@mathworks.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1204212546 27778 172.30.248.37 (28 Feb 2008 15:29:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 28 Feb 2008 15:29:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1210415
Xref: news.mathworks.com comp.soft-sys.matlab:454329



Hello everyone,

I've been toying with the Target for C2000 toolbox, just to
see what can be done with.

I'm quite disapointed by the fact that Simulink forces the
use of floating point numbers in many blocks.
I'm sure there's a way to force Simulink to do everything in
fixed point numbers, but I just can't see how.

For example, I've created a filter using the signal
processing toolbox. The results are stored as fixed point
variables, but every multiplication is made using floating
point operations.
So in the C Code, I get something like

tmp = floor(ldexp(DMC_P.b3_Gain *
ldexp((real_T)rtb_BodyDelay3, (int16_T)
      -16L), (int16_T)16L) + 0.5);
    rtb_b3 = (int32_T)(tmp <= 2.147483647E+009 ? tmp >=
-2.147483648E+009 ? tmp :
                       -2.147483648E+009 : 2.147483647E+009);

Which is quite complicated, especially when you know that
the IQMath library is way faster.

So, can I force Simulink to do fixed point operations?
Better yet: is there a way to use Iqmath in conjunction with
the signal processing toolbox without manually replacing
every "Gain" block with by an Iqmath equivalent?