<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164781</link>
    <title>MATLAB Central Newsreader - Signal processing blockset and the IQMath library</title>
    <description>Feed for thread: Signal processing blockset and the IQMath library</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 28 Feb 2008 15:29:06 -0500</pubDate>
      <title>Signal processing blockset and the IQMath library</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164781#417994</link>
      <author>Kevin </author>
      <description>Hello everyone,&lt;br&gt;
&lt;br&gt;
I've been toying with the Target for C2000 toolbox, just to&lt;br&gt;
see what can be done with.&lt;br&gt;
&lt;br&gt;
I'm quite disapointed by the fact that Simulink forces the&lt;br&gt;
use of floating point numbers in many blocks.&lt;br&gt;
I'm sure there's a way to force Simulink to do everything in&lt;br&gt;
fixed point numbers, but I just can't see how.&lt;br&gt;
&lt;br&gt;
For example, I've created a filter using the signal&lt;br&gt;
processing toolbox. The results are stored as fixed point&lt;br&gt;
variables, but every multiplication is made using floating&lt;br&gt;
point operations.&lt;br&gt;
So in the C Code, I get something like&lt;br&gt;
&lt;br&gt;
tmp = floor(ldexp(DMC_P.b3_Gain *&lt;br&gt;
ldexp((real_T)rtb_BodyDelay3, (int16_T)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-16L), (int16_T)16L) + 0.5);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rtb_b3 = (int32_T)(tmp &amp;lt;= 2.147483647E+009 ? tmp &amp;gt;=&lt;br&gt;
-2.147483648E+009 ? tmp :&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-2.147483648E+009 : 2.147483647E+009);&lt;br&gt;
&lt;br&gt;
Which is quite complicated, especially when you know that&lt;br&gt;
the IQMath library is way faster.&lt;br&gt;
&lt;br&gt;
So, can I force Simulink to do fixed point operations?&lt;br&gt;
Better yet: is there a way to use Iqmath in conjunction with&lt;br&gt;
the signal processing toolbox without manually replacing&lt;br&gt;
every &quot;Gain&quot; block with by an Iqmath equivalent?</description>
    </item>
    <item>
      <pubDate>Fri, 29 Feb 2008 22:06:38 -0500</pubDate>
      <title>Re: Signal processing blockset and the IQMath library</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164781#418371</link>
      <author>Praetorian</author>
      <description>On Feb 28, 8:29 am, &quot;Kevin &quot; &amp;lt;kedec...@mathworks.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hello everyone,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I've been toying with the Target for C2000 toolbox, just to&lt;br&gt;
&amp;gt; see what can be done with.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I'm quite disapointed by the fact that Simulink forces the&lt;br&gt;
&amp;gt; use of floating point numbers in many blocks.&lt;br&gt;
&amp;gt; I'm sure there's a way to force Simulink to do everything in&lt;br&gt;
&amp;gt; fixed point numbers, but I just can't see how.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; For example, I've created a filter using the signal&lt;br&gt;
&amp;gt; processing toolbox. The results are stored as fixed point&lt;br&gt;
&amp;gt; variables, but every multiplication is made using floating&lt;br&gt;
&amp;gt; point operations.&lt;br&gt;
&amp;gt; So in the C Code, I get something like&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; tmp = floor(ldexp(DMC_P.b3_Gain *&lt;br&gt;
&amp;gt; ldexp((real_T)rtb_BodyDelay3, (int16_T)&lt;br&gt;
&amp;gt;       -16L), (int16_T)16L) + 0.5);&lt;br&gt;
&amp;gt;     rtb_b3 = (int32_T)(tmp &amp;lt;= 2.147483647E+009 ? tmp &amp;gt;=&lt;br&gt;
&amp;gt; -2.147483648E+009 ? tmp :&lt;br&gt;
&amp;gt;                        -2.147483648E+009 : 2.147483647E+009);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Which is quite complicated, especially when you know that&lt;br&gt;
&amp;gt; theIQMathlibrary is way faster.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; So, can I force Simulink to do fixed point operations?&lt;br&gt;
&amp;gt; Better yet: is there a way to useIqmathin conjunction with&lt;br&gt;
&amp;gt; the signal processing toolbox without manually replacing&lt;br&gt;
&amp;gt; every &quot;Gain&quot; block with by anIqmathequivalent?&lt;br&gt;
&lt;br&gt;
Kevin,&lt;br&gt;
The reason Simulink is generating float math is because you haven't&lt;br&gt;
set the port data types for the blocks. Also, if you're using ERT you&lt;br&gt;
should pick the fixed point specific flavor of ert.tlc (the same may&lt;br&gt;
exist even in case of GRT). I work on a very large scale model&lt;br&gt;
generating code for the TI 2812 and all of our code is in fixed point,&lt;br&gt;
including that generated by default Simulink blocks such as the gain&lt;br&gt;
block. Also, if you have the TI C2000 toolbox there are blocks in&lt;br&gt;
there that make use of IQ math. And a new feature of R2007b (I haven't&lt;br&gt;
used it yet) is Target Function Replacement where apparently there is&lt;br&gt;
an API for specifying hardware specific instructions in place of&lt;br&gt;
generic math operations. So using that you should be able to have the&lt;br&gt;
Gain block generate IQ math code instead of Simulink's fixed point&lt;br&gt;
math multiplication.&lt;br&gt;
&lt;br&gt;
HTH,&lt;br&gt;
Ashish.</description>
    </item>
    <item>
      <pubDate>Tue, 04 Mar 2008 14:11:23 -0500</pubDate>
      <title>Re: Signal processing blockset and the IQMath library</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164781#418916</link>
      <author>Antonin Ancelle</author>
      <description>Hi Kevin,&lt;br&gt;
&lt;br&gt;
You can enable TFL (Target Function Library) if you open the configset of &lt;br&gt;
your model (Ctrl+E) and go to:&lt;br&gt;
Real-Time Workshop -&amp;gt; Interface -&amp;gt; Target Function Library. (requires RTW &lt;br&gt;
Embedded Coder)&lt;br&gt;
Pick &quot;TI C28x&quot;, this should replace most of the basic fixed-point operations &lt;br&gt;
with IQMath calls, even inside Signal Processing blocks.&lt;br&gt;
TFL was introduced for C2000 in R2007b, more replacement are available in &lt;br&gt;
the brand new R2008a release available since the 1st of march 2008.&lt;br&gt;
&lt;br&gt;
I hope it helps,&lt;br&gt;
&lt;br&gt;
Antonin.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&quot;Praetorian&quot; &amp;lt;ashish.sadanandan@gmail.com&amp;gt; wrote in message &lt;br&gt;
news:d7287b5d-f1a3-41ec-a645-3e8d35231b5f@u10g2000prn.googlegroups.com...&lt;br&gt;
&amp;gt; On Feb 28, 8:29 am, &quot;Kevin &quot; &amp;lt;kedec...@mathworks.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt; Hello everyone,&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; I've been toying with the Target for C2000 toolbox, just to&lt;br&gt;
&amp;gt;&amp;gt; see what can be done with.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; I'm quite disapointed by the fact that Simulink forces the&lt;br&gt;
&amp;gt;&amp;gt; use of floating point numbers in many blocks.&lt;br&gt;
&amp;gt;&amp;gt; I'm sure there's a way to force Simulink to do everything in&lt;br&gt;
&amp;gt;&amp;gt; fixed point numbers, but I just can't see how.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; For example, I've created a filter using the signal&lt;br&gt;
&amp;gt;&amp;gt; processing toolbox. The results are stored as fixed point&lt;br&gt;
&amp;gt;&amp;gt; variables, but every multiplication is made using floating&lt;br&gt;
&amp;gt;&amp;gt; point operations.&lt;br&gt;
&amp;gt;&amp;gt; So in the C Code, I get something like&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; tmp = floor(ldexp(DMC_P.b3_Gain *&lt;br&gt;
&amp;gt;&amp;gt; ldexp((real_T)rtb_BodyDelay3, (int16_T)&lt;br&gt;
&amp;gt;&amp;gt;       -16L), (int16_T)16L) + 0.5);&lt;br&gt;
&amp;gt;&amp;gt;     rtb_b3 = (int32_T)(tmp &amp;lt;= 2.147483647E+009 ? tmp &amp;gt;=&lt;br&gt;
&amp;gt;&amp;gt; -2.147483648E+009 ? tmp :&lt;br&gt;
&amp;gt;&amp;gt;                        -2.147483648E+009 : 2.147483647E+009);&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Which is quite complicated, especially when you know that&lt;br&gt;
&amp;gt;&amp;gt; theIQMathlibrary is way faster.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; So, can I force Simulink to do fixed point operations?&lt;br&gt;
&amp;gt;&amp;gt; Better yet: is there a way to useIqmathin conjunction with&lt;br&gt;
&amp;gt;&amp;gt; the signal processing toolbox without manually replacing&lt;br&gt;
&amp;gt;&amp;gt; every &quot;Gain&quot; block with by anIqmathequivalent?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Kevin,&lt;br&gt;
&amp;gt; The reason Simulink is generating float math is because you haven't&lt;br&gt;
&amp;gt; set the port data types for the blocks. Also, if you're using ERT you&lt;br&gt;
&amp;gt; should pick the fixed point specific flavor of ert.tlc (the same may&lt;br&gt;
&amp;gt; exist even in case of GRT). I work on a very large scale model&lt;br&gt;
&amp;gt; generating code for the TI 2812 and all of our code is in fixed point,&lt;br&gt;
&amp;gt; including that generated by default Simulink blocks such as the gain&lt;br&gt;
&amp;gt; block. Also, if you have the TI C2000 toolbox there are blocks in&lt;br&gt;
&amp;gt; there that make use of IQ math. And a new feature of R2007b (I haven't&lt;br&gt;
&amp;gt; used it yet) is Target Function Replacement where apparently there is&lt;br&gt;
&amp;gt; an API for specifying hardware specific instructions in place of&lt;br&gt;
&amp;gt; generic math operations. So using that you should be able to have the&lt;br&gt;
&amp;gt; Gain block generate IQ math code instead of Simulink's fixed point&lt;br&gt;
&amp;gt; math multiplication.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; HTH,&lt;br&gt;
&amp;gt; Ashish. </description>
    </item>
  </channel>
</rss>

