Fixed-point arithmetic

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Fixed-point arithmetic

Etienne Grossmann-6

   Hello,

I saw on the Octave FAQ http://www.gnu.org/software/octave/FAQ.html 
that there is fixed point arithmetic, but I can't figure out how it  
works. Any hints?

   Cheers,

   Etienne


--
http://www.isr.ist.utl.pt/~etienne

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-point arithmetic

David Bateman-2
[hidden email] wrote:

>    Hello,
>
> I saw on the Octave FAQ http://www.gnu.org/software/octave/FAQ.html 
> that there is fixed point arithmetic, but I can't figure out how it  
> works. Any hints?
>
>    Cheers,
>
>    Etienne
>
>
>  
That should probably read integer arithmetic rather than "fixed point
arithmetic" as integer types were introduced in the 2.9.x series.. There
is a fixed point type in octave-forge however

D.


--
David Bateman                                [hidden email]
35 rue Gambetta                              +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-point arithmetic

Etienne Grossmann-6


   Hi David,

thanks for the info; for some reason, I hadn't noticed the "fixed"  
package in my octave-forge svn tree. Maybe because it doesn't appear  
on the sourceforge package index at  
http://octave.sourceforge.net/packages.php? Any way to fix this? I  
originally was looking for a link to the fixed-point package for the  
wiki page on fixed-point arithmetic  
http://wiki.octave.org/wiki.pl?CategoryFixedPoint,

   Cheers,

   Etienne

David Bateman <[hidden email]> (Sun, 11 Jul 2010 00:06:45 +0200) wrote:

> [hidden email] wrote:
>>   Hello,
>>
>> I saw on the Octave FAQ http://www.gnu.org/software/octave/FAQ.html 
>>  that there is fixed point arithmetic, but I can't figure out how  
>> it  works. Any hints?
>>
>>   Cheers,
>>
>>   Etienne
>>
>>
>>
> That should probably read integer arithmetic rather than "fixed  
> point arithmetic" as integer types were introduced in the 2.9.x  
> series.. There is a fixed point type in octave-forge however
>
> D.
>
>
> --
> David Bateman                                [hidden email]
> 35 rue Gambetta                              +33 1 46 04 02 18 (Home)
> 92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)
>
>



--
http://www.isr.ist.utl.pt/~etienne

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-point arithmetic

c.-2

On 11 Jul 2010, at 08:06, [hidden email] wrote:

> thanks for the info; for some reason, I hadn't noticed the "fixed"
> package in my octave-forge svn tree. Maybe because it doesn't appear
> on the sourceforge package index at
> http://octave.sourceforge.net/packages.php?

When we switched to the new individual package release system Søren
prepared releases of most packages but skipped those that didn't work  
on his
system. Packages that were never released do not appear on the website.

> Any way to fix this?

Prepare a release according to the instructions at <http://octave.sourceforge.net/developers.html 
 > in the section "Make a release of your package and publish its  
function reference"

c.
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-point arithmetic

David Bateman-2
c. wrote:

>
> On 11 Jul 2010, at 08:06, [hidden email] wrote:
>
>> thanks for the info; for some reason, I hadn't noticed the "fixed"
>> package in my octave-forge svn tree. Maybe because it doesn't appear
>> on the sourceforge package index at
>> http://octave.sourceforge.net/packages.php?
>
> When we switched to the new individual package release system Søren
> prepared releases of most packages but skipped those that didn't work
> on his
> system. Packages that were never released do not appear on the website.
>
>> Any way to fix this?
>
> Prepare a release according to the instructions at
> <http://octave.sourceforge.net/developers.html> in the section "Make a
> release of your package and publish its function reference"
>
> c.
Yeah, I haven't done it, and I thought Soren didn't because it needed
some work to get it to build with 3.2.0.. I have the version of Octave
installed with my distribution and the development version (ie 3.0.5 and
the tip) which is why I never bother trying to fix this.. (I'm using a
netbook with a 20GB SSD disk for my developments and so having two build
trees and 3 versions of Octave takes a bit of space)

D.


_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-point arithmetic

Chipmuenk
David Bateman-2 wrote
> When we switched to the new individual package release system Søren
> prepared releases of most packages but skipped those that didn't work
> on his
> system. Packages that were never released do not appear on the website.
>
>> Any way to fix this?
>
> Prepare a release according to the instructions at
> <http://octave.sourceforge.net/developers.html> in the section "Make a
> release of your package and publish its function reference"
>
> c.
Yeah, I haven't done it, and I thought Soren didn't because it needed
some work to get it to build with 3.2.0.. I have the version of Octave
installed with my distribution and the development version (ie 3.0.5 and
the tip) which is why I never bother trying to fix this.. (I'm using a
netbook with a 20GB SSD disk for my developments and so having two build
trees and 3 versions of Octave takes a bit of space)

D.


_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Hi all,

I am using the "fixed" package for some time now to demonstrate the effects of fixpoint coefficients and arithmetics in digital filters to my students. It seems to me that this hidden gem of the octave packages is slowly falling into oblivion as it is no longer actively maintained and hence no longer appears at octave-forge.

This is quite a pity, as this package is quite powerful in my opinion. As far as I know, there is no other open source software supporting fixpoint arithmetics. The only obvious alternative is Matlab's Fixpoint Toolbox but of course Mathworks is aware of this fact: I cannot affort to provide licenses for all of my students.

Admittedly, this package is quite complex and maybe the purpose of this package is not immediately clear. Its syntax is also incompatible to the Matlab fixpoint toolbox (as it was developed at the same time) which makes this package even more seem like a dead end. But everyone who has tried to develop a digital fixpoint filter for a microcontroller or an FPGA knows how important it is to take quantizing / truncation effects into account.

I am not a programmer but I could help rejuvenating the toolbox by providing ideas, applications, documentations and examples. I also have access to Matlab with the Fixpoint Toolbox to run comparisons.

Please don't let this package rot away in some repository.

Cheers,

Christian

Reply | Threaded
Open this post in threaded view
|

Re: Fixed-point arithmetic

Jordi Gutiérrez Hermoso-2
On 18 April 2011 07:39, Chipmuenk <[hidden email]> wrote:

>
> David Bateman-2 wrote:
>>
>>> When we switched to the new individual package release system
>>> Søren prepared releases of most packages but skipped those that
>>> didn't work on his system. Packages that were never released do
>>> not appear on the website.
>>>
>>>> Any way to fix this?
>>>
>>> Prepare a release according to the instructions at
>>> &lt;http://octave.sourceforge.net/developers.html&gt; in the
>>> section "Make a release of your package and publish its function
>>> reference"
>>>
>>> c. Yeah, I haven't done it, and I thought Soren didn't because it
>> needed some work to get it to build with 3.2.0.. I have the version
>> of Octave installed with my distribution and the development
>> version (ie 3.0.5 and the tip) which is why I never bother trying
>> to fix this.. (I'm using a netbook with a 20GB SSD disk for my
>> developments and so having two build trees and 3 versions of Octave
>> takes a bit of space)

> I am using the "fixed" package for some time now to demonstrate the
> effects of fixpoint coefficients and arithmetics in digital filters
> to my students.
[snip]
> I am not a programmer but I could help rejuvenating the toolbox by
> providing ideas, applications, documentations and examples. I also
> have access to Matlab with the Fixpoint Toolbox to run comparisons.
>
> Please don't let this package rot away in some repository.

Can you secure funding for its development? That's most likely to
attract a maintainer. If the package is as unique as you say, perhaps
this will look attractive in a grant proposal.

- Jordi G. H.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-point arithmetic

David Bateman-2
In reply to this post by Chipmuenk

Le 18 avr. 2011 à 14:39, Chipmuenk a écrit :

Hi all,

I am using the "fixed" package for some time now to demonstrate the effects
of fixpoint coefficients and arithmetics in digital filters to my students.
It seems to me that this hidden gem of the octave packages is slowly falling
into oblivion as it is no longer actively maintained and hence no longer
appears at octave-forge.

Yeah I've been a bit slack. I haven't released any packages in octave-forge since octave-forge went to individual package releases and I'm not sure sure of the process. I've been confining my efforts with octave to the core functionality. Add to that that I don't need this package actually and my dev machine upped and died, I'm not sure I'm likely to do anything in the near future.



This is quite a pity, as this package is quite powerful in my opinion. As
far as I know, there is no other open source software supporting fixpoint
arithmetics. The only obvious alternative is Matlab's Fixpoint Toolbox but
of course Mathworks is aware of this fact: I cannot affort to provide
licenses for all of my students.


Not quite true. GMP supports fixed point and the matlab code is based on GMP (see http://gmplib.org/manual/). Laurent and I chose not to use GMP with the fixed point code for Octave and base it on 32 or 64 bit integers. In this way the code is much faster than the matlab code, though it can't handle large integers. The reality in communication systems is that more than 16 bits are rarely used, so frankly speed is the key here so I still think this choice was the right one.


Admittedly, this package is quite complex and maybe the purpose of this
package is not immediately clear. Its syntax is also incompatible to the
Matlab fixpoint toolbox (as it was developed at the same time) which makes
this package even more seem like a dead end. But everyone who has tried to
develop a digital fixpoint filter for a microcontroller or an FPGA knows how
important it is to take quantizing / truncation effects into account.

Its not compatible as it was written before matlab released their fixed point package, if it was in parallel I might have tried to copy their interface ;-). Its faster than the matlab fixed point code, so I hardly think its a dead end.

I am not a programmer but I could help rejuvenating the toolbox by providing
ideas, applications, documentations and examples. I also have access to
Matlab with the Fixpoint Toolbox to run comparisons.

Some Ideas I alright had were

- Adapt the code for NDArrays so more Octave code could be used with the package.
- Add different overflow and rounding options. The ones that are used in the code were the ones that were used in the CMOS process I was developing for.

Frankly I don't think its a good idea to make this package matlab compatible, unless we want to use GMP as well.

Please don't let this package rot away in some repository.

I'd rather it didn't and will get around to fixing it some time, as I have a certain desire to see my code used, but I can't guarantee to be quick and would be happy to see someone else get the fixed point package working with 3.4.0

David


_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-point arithmetic

Chipmuenk
David Bateman-2 wrote
Le 18 avr. 2011 à 14:39, Chipmuenk a écrit :
>

Not quite true. GMP supports fixed point and the matlab code is based on GMP (see http://gmplib.org/manual/). Laurent and I chose not to use GMP with the fixed point code for Octave and base it on 32 or 64 bit integers. In this way the code is much faster than the matlab code, though it can't handle large integers. The reality in communication systems is that more than 16 bits are rarely used, so frankly speed is the key here so I still think this choice was the right one.
Sorry, I wasn't aware of GMP. In my opinion (or at least for my application ;-) ), FPGA-multiplier blocks define the wordlengths that are commonly used in FPGA-based signal processing. At the moment, these blocks usually have input wordlengths of 18 or 25 bits, so 32 bit integers are too small in most cases, but 64 bit should do.

David Bateman-2 wrote
Its not compatible as it was written before matlab released their fixed point package, if it was in parallel I might have tried to copy their interface ;-). Its faster than the matlab fixed point code, so I hardly think its a dead end.
I did not want to imply that the package is bad or slow (I like using it), I'm just afraid that a package that has "disappeared from the radar" might attract less and less users. Combine it with a completely different interface from Matlab (unfortunately, compatibility _is_ important to many users), and I think the danger of becoming extinct is for real.

David Bateman-2 wrote
Some Ideas I alright had were

- Adapt the code for NDArrays so more Octave code could be used with the package.
- Add different overflow and rounding options. The ones that are used in the code were the ones that were used in the CMOS process I was developing for.
Different overflow, rounding and saturation options were also the first things that came to my mind.

David Bateman-2 wrote
Frankly I don't think its a good idea to make this package matlab compatible, unless we want to use GMP as well.
Compatibility is certainly not a "must", but I think making it available via octave-forge is, and some simple DSP examples would also help (I am willing to help with the latter).

Christian


Reply | Threaded
Open this post in threaded view
|

Re: Fixed-point arithmetic

Chipmuenk
In reply to this post by Jordi Gutiérrez Hermoso-2
Jordi Gutiérrez Hermoso-2 wrote
Can you secure funding for its development? That's most likely to
attract a maintainer. If the package is as unique as you say, perhaps
this will look attractive in a grant proposal.

- Jordi G. H.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
I guess I could find some funding, but most likely only for "local" work, i.e. at our university in Munich. However, I don't have the know-how to tutor such a work. But if someone with the necessary background is interested, feel free to contact me.

Christian
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-point arithmetic

andy robson
This post was updated on .
In reply to this post by David Bateman-2
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Fixed-point arithmetic

Jordi Gutiérrez Hermoso-2
On 17 April 2013 10:25, andy robson <[hidden email]> wrote:
> Can someone send me the source code of fixed point library. I'd like to try
> to get it working in a new release of octave.

You can download all of Octave-Forge here:

    http://hg.octave.org/forge/archive/tip.zip

The fixed package will be under main/fixed. I've managed to make it
compile with newer Octave, but I didn't make a release since it fails
all or most of the tests.

These are the changes I've made to it since the last release:

    http://hg.octave.org/forge/rev/2deb6b24d293
    http://hg.octave.org/forge/rev/7b7cd174847c
    http://hg.octave.org/forge/rev/df50d0ae107f
    http://hg.octave.org/forge/rev/d84d2fea3c90
    http://hg.octave.org/forge/rev/58d36e8880db

Sorry, they're out of order. If you have hg installed, you can do

    hg clone http://hg.octave.org/forge/

to get the full hg archive and inside the forge repo do

    hg log -pv main/fixed

to see the changes in order.

Good luck.

- Jordi G. H.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave