Running Wavelab 8.02 on octave
Installing
On Linux
(Tested on Debian GNU/Linux, Octave 2.1.50 through 57, WaveLab802)(Tested on Mandrake, Octave 2.1.50 through 57, WaveLab802)
First of all, untar source:
cd /path/to/destination/dir
tar xvfz /path/to/downloads/WaveLab802.tar.Z
Then edit WaveLab802/WavePath.m:
- In line 23 set ''/path/to/destination/dir/WaveLab802'' instead of ''pwd''.
- In line 26 change PATHNAMESEPARATOR = '\'; to PATHNAMESEPARATOR = '\\';
For single-user installation add ''WavePath.m'' to your ''~/.octaverc'':
echo "source('/path/to/wavelab/WavePath.m');" >> ~/.octaverc
Issues
reverse.m octave overload (18/08/2003)
Solution 1 (from L. Jacques): Recall Wavelab/Orthogonal/reverse.m by, for instance, ./Orthogonal/filtreverse.m for "filter reverse" and modify Wavelab/Orthogonal/aconv.m (and all the files using it -- grep list in WavelabIssueOne) in consequence.Solution 2 (from P. Kienzle): The problem is that m-files in the path do not override built-in functions (or oct-files for that matter). In this particular case you could rename Wavelab's reverse to something like Wavelab_reverse, and use [dispatch] from [octave-forge] (which allows overloading of functions under octave) to call Wavelab_reverse instead of reverse when it receives a matrix. Something like:
dispatch("reverse","Wavelab_reverse","matrix");
Long term as octave grows, it would be nice if there were a way to limit functions to a private name space of a package, ignoring any definitions available elsewhere.
MEX file problem
Most of the WaveLab? mex functions compile with the mex compiler in octave-forge. You need to modify MEXsource/installMEX to change -V4 to -DV4 to do so. DL_LDFLAGS must also be set (see "Patching InstallMEX?.m" below). Whether the resulting oct-file produce the correct results is left as an exercise for the reader, but please post the results of any tests.
All functions specified in installMEX build. The only file which definitely can't build is QuadInt?_Ave.c (it was generated from the matlab compiler), but it isn't referenced anywhere, nor is it built in installMEX.
Moving the mex files is not necessary and will fail since they are called oct files in octave. Just be sure to add the MEXsource directory before the others on your LOADPATH.
Patching InstallMEX.m
Change
for file={'CPAnalysis' 'WPAnalysis ...
to
files={'CPAnalysis' 'WPAnalysis ...
for filenum = 1:length(files)
file = files(filenum);
...
Make the same change further on in the file.
Replace
disp(sprintf('%s.c',file));
eval(sprintf('mex -V4 %s.c',file));
with
disp([file '.c']);
if exist('OCTAVE_VERSION')
system(['DL_LDFLAGS="-shared -Wl,-Bsymbolic" mex -DV4 ' file '.c']);
else
mex(strcat(file, '.c'))
end
Optional: replace lines like
!mv CPAnalysis.mex* ../Packets/One-D
with lines like
system('mv CPAnalysis.oct* ../Packets/One-D');
Example
octave:1> startup % load wavelab
octave:2> I = imread('lena256.jpg'); % load an image
octave:3> qmf = MakeONFilter('Symmlet', 8); % create a quadrature mirror
% filter of the desired type
octave:4> [n,J] = dyadlength(I); % get the dyadic length of the first
% row of I
octave:5> FWT2_PO(I, J-1, qmf); % do the forward wavelet transform
% (2 levels)