Octave
Matlab, Octave and FreeMat
2008-11-18I will be implementing an LV2 plugin as a school project in the near future. So far I have however only been tinkering around with Matlab-work-alikes in Linux. The plan was to do some fast prototyping before doing the actual coding in C++. The problem is that fast prototyping isn't fast if you use for-loops and Octave or a stable version of FreeMat....
I first tried working with Octave but found out that compared to Matlab, it takes some thousand times more time to perform a function utilizing a for-loop I made for manipulating audio files. This made it unusable for me. I was told to use matrix operations instead of for-loops on IRC, but that kind of messed up the whole idea of fast prototyping of algorithms.
The principal problem with for-loops being slow is the fact the Matlab language is interpreted. However, for-loops can be made fast with JIT. This is where FreeMat kicks in.
FreeMat has a JIT implementation which utilizes the LLVM compiler infrastructure (which seems like an interesting project). There was no FreeMat package in (K)Ubuntu, so I had to compile it myself. FreeMat 3.6 is supposed to have some JIT-functionality, but I just couldn't get it to work. So, next up for trial was the svn version of FreeMat 4 (not released yet), in which I got JIT to work. The speedup with for-loops was very impressive! Though alas, FreeMat 4 still has lots of other bugs and incomplete parts in it for it to be truly useful.
Until FreeMat 4 is out (or Octave gets JIT) I gues I will have to use Matlab over remote X or in our school computer classes (which are fortunately open 24/7)...