Hello,
I developped some algorithm performing numerical analysis on a signal. For ease of development, it was done under Octave. The platform where it will be used lacks the required abilities in terms of CPU speed, memory, and so on. I'm searching some way to port the code to C/C++ with minimum effort. In terms of Octave use, the used primitives are: dynamic memory allocation and a few functions like filter(), mean(), median(), ... The platform as specific gcc and g++ compilers, but lacks fortran support. Did someone already perform such tasks ? Is it possible to easily extract a small subset of Octave libraries to interface and ease the porting ? Regards Pascal |
Hello Pascal,
Have you looked at the Octave source ? Octave is a complex piece of software, with overload operators and functions, I don't think it would be a simple task to strip Octave that way. Maybe I would be simpler for you to rewrite your software and use a numerical analysis library, then compile it with striping/static options, to get a smaller executable, plus because Octave scripts are interpreted, you would get a considerable improvement over octave... Thats my opinion, hope it helped .. Regards, Mario On Wed, Nov 23, 2011 at 1:25 PM, CdeMills <[hidden email]> wrote: > Hello, > I developped some algorithm performing numerical analysis on a signal. For > ease of development, it was done under Octave. The platform where it will be > used lacks the required abilities in terms of CPU speed, memory, and so on. > I'm searching some way to port the code to C/C++ with minimum effort. > > In terms of Octave use, the used primitives are: dynamic memory allocation > and a few functions like filter(), mean(), median(), ... The platform as > specific gcc and g++ compilers, but lacks fortran support. > > Did someone already perform such tasks ? Is it possible to easily extract a > small subset of Octave libraries to interface and ease the porting ? > > Regards > > Pascal > > > > -- > View this message in context: http://octave.1599824.n4.nabble.com/octave-code-embedded-device-tp4099557p4099557.html > Sent from the Octave - General mailing list archive at Nabble.com. > _______________________________________________ > Help-octave mailing list > [hidden email] > https://mailman.cae.wisc.edu/listinfo/help-octave > Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave |
Hello Mario, For the first question: I already produced some patches for the Octave system, so yes I know Octave source complexity :-) For the second proposition: good idea, but which one, and where to find it ? Best regards Pascal |
>> Maybe I would be simpler for you to rewrite your software and use a
>> numerical analysis library, then compile it with striping/static >> options, to get a smaller executable, plus because Octave scripts are >> interpreted, you would get a considerable improvement over octave... I suspect that one gets considerable speed improvements over Octave only if the Octave script heavily relies on looping, i.e. if the code is not vectorised. -- Francesco Potortì (ricercatore) Voice: +39.050.315.3058 (op.2111) ISTI - Area della ricerca CNR Mobile: +39.348.8283.107 via G. Moruzzi 1, I-56124 Pisa Fax: +39.050.315.2040 (entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it _______________________________________________ Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave |
In reply to this post by CdeMills
Take at look a those,
http://en.wikipedia.org/wiki/List_of_numerical_libraries This one seems to have FFT I believe you would need that http://en.wikipedia.org/wiki/GNU_Scientific_Library But maybe someone else could give you a better response, since I have no practical experience with those. Regards, Mário On Wed, Nov 23, 2011 at 2:55 PM, CdeMills <[hidden email]> wrote: > > Mário Costa wrote >> >> Hello Pascal, >> >> Have you looked at the Octave source ? >> Octave is a complex piece of software, with overload operators and >> functions, I don't think it would be a simple task to strip Octave >> that way. >> >> Maybe I would be simpler for you to rewrite your software and use a >> numerical analysis library, then compile it with striping/static >> options, to get a smaller executable, plus because Octave scripts are >> interpreted, you would get a considerable improvement over octave... >> >> > > Hello Mario, > > For the first question: I already produced some patches for the Octave > system, so yes I know Octave source complexity :-) > For the second proposition: good idea, but which one, and where to find it ? > > Best regards > > Pascal > > > -- > View this message in context: http://octave.1599824.n4.nabble.com/octave-code-embedded-device-tp4099557p4099926.html > Sent from the Octave - General mailing list archive at Nabble.com. > _______________________________________________ > Help-octave mailing list > [hidden email] > https://mailman.cae.wisc.edu/listinfo/help-octave > Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave |
----- Original Message ----- > From: Mário Costa <[hidden email]> > To: CdeMills <[hidden email]> > Cc: [hidden email] > Sent: Wednesday, November 23, 2011 7:25 PM > Subject: Re: octave code => embedded device > >T ake at look a those, > > http://en.wikipedia.org/wiki/List_of_numerical_libraries > > This one seems to have FFT I believe you would need that > > http://en.wikipedia.org/wiki/GNU_Scientific_Library > > But maybe someone else could give you a better response, since I have > no practical experience with those. > > Regards, > Mário > > Default choice of FFT is FFTW: fftw.org . Octave uses it. Regards, Sergei. _______________________________________________ Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave |
In reply to this post by CdeMills
I have used Octave to develop some simple FIR/IIR filters for use in embedded applications which are easy enough to implement in C. Trying to use Octave code may create more problems than it solves. I'm no software expert but as an electronics engineer I can offer some advice;
Unless your embedded device is running an Operating System (uCLinux, perhaps) which handles memory allocation for you then I would definetly try to avoid dynamic memory allocation. You could write your own memory manager but for all but the simplest cases you could really get bogged down in that. If your target platform is "bare metal" (ARM EABI, perhaps) then try to allocate memory buffers once at the start of the program, can you share buffers to reduce memory requirements? If your filter can be implemented as FIR/IIR operating on vectors then filter(), mean(), median() should not be too difficult to implement in C without using Octave code. Ofcourse, using Octave code would also make your embedded application subject to GPL. But you knew that.. |
EE speaks to EE ... the device is linux based, the development kit comes with a sandbox containing a cross-compiling gcc. The application being subject to GPL is a plus, the project has been funded by public money. Thanks for the hints Pascal |
In reply to this post by Penfold
----- Original Message ----- > From: Penfold <[hidden email]> > To: [hidden email] > Cc: > Sent: Thursday, November 24, 2011 11:42 AM > Subject: Re: octave code => embedded device > > I have used Octave to develop some simple FIR/IIR filters for use in embedded > applications which are easy enough to implement in C. Trying to use Octave > code may create more problems than it solves. I'm no software expert but as > an electronics engineer I can offer some advice; For "typical" filters one can use this: http://uazu.net/fiview/ . There is an LGPL part of the package which can be used in closed source applications. AFAIR the underlying engine allows to also easily extract filter coefficients. Regards, Sergei. _______________________________________________ Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave |
Free forum by Nabble | Edit this page |