octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Easy Wavelet capability added to Octave core software


From: Marc Normandin
Subject: Re: Easy Wavelet capability added to Octave core software
Date: Sun, 10 Aug 2008 16:10:52 -0400
User-agent: Thunderbird 2.0.0.16 (X11/20080724)

PattiMichelle wrote:
> Marc Normandin wrote:
>> PattiMichelle wrote:
>>   
>>> I'm trying to begin to use Octave - I'm definitely a newbie - but it's
>>> lacking wavelet capability.  WaveLab is available for MatLab and I've
>>> hear Octave is very close syntactically, so I'm hoping that adding
>>> WaveLab to Octave can be added to the todo list.  (It's difficult for an
>>> Octave newbie to navigate getting a Matlab toolkit to work with
>>> Octave.)  Wavelets really are becoming important tools to have available
>>> and WaveLab appears to be written/used by some of the heavyweights in
>>> the wavelet biz.
>>>
>>> http://www-stat.stanford.edu/~wavelab/
>>>
>>> Thank You,
>>> Patti Sheaffer
>>>     
>>
>> Not to split hairs, but it appears that WaveLab is written to work in
>> Matlab, but is not part of it.  Inclusion of WaveLab (or some other
>> wavelet functionality) in Octave proper would offer additional utility
>> to the base system, but would come at some cost (size of the base
>> package, maintenance and support of WaveLab code, etc.).  Is WaveLab
>> important enough to include in the core program?  The commercial
>> alternative appears to think not...
>>
>> This page is a bit dated, but may offer some helpful information.
>>
>>   http://wiki.octave.org/wiki.pl?WavelabOnOctave
>>
>> Does that help any?  Are there specific errors that you're encountering
>> while installing/using WaveLab in Octave?
>>
>> Please note that I haven't used WaveLab, so I can't vouch for it's
>> Octave compatibility.
>>
>>   
> Thank you very much for the reply, Mark.  You're right about WaveLab -
> and it not being part of Matlab is why I thought adding it to Octave
> would be almost a no-braner (i.e., free,  high quality, and Matlab
> compatable) way to add wavelets to Octave.  Matlab has written its own
> wavelet tool box and which couldn't be easily added to Octave.  The
> folks who wrote WaveLab are some of the heavyweights in the wavelet biz
> so it's not inconsequential code. 
>
> I'm a working scientist (The Aerospace Corporation) and my reading of
> the literature shows wavelets over the last decade have become at least
> as important as Fourier spectral analysis.  I think it's important to
> get some wavelets onto Octave as soon as possible.   (Even Scilab has a
> wavelet toolkit, but I'm attracted to Octave because of the Matlab
> syntax compatibility.)  I guess if it could be got running (with online
> help?) I could contribute to a wiki or help somehow in
> maintaining/publishing?  I currently contrib on a few packages for
> SourceForge (bacula and apcupsd) and the sbarnin openSuSE repo.

I don't dispute the importance of wavelets, the quality of the WaveLab
code, or the reputation of its authors.  I think all of these points
have significant merit: wavelets have garnered significant attention
across many disciples, WaveLab was developed and is still used despite
the existence of Matlab's wavelet toolbox, and the WaveLab developers
are prominent and highly respected in their field.

However, one must keep in mind that these are not sufficient reasons for
inclusion in Octave.  Wavelets may be used often and by many, but
WaveLab is a large body of code to take on for functionality that many
(probably most) Octave users won't use.  IMHO, it would be better suited
as an add-on package from Octave-Forge.

Licensing is a separate but perhaps more important issue.  WaveLab is
released as "freeware", but I couldn't to find any license for the
release.  The items I could find appear to have some elements of concern:

To paraphrase Wavelab850/Documentation/COPYING.m, redistribution is
permitted but the original work must be included in its entirety and the
original authors retain copyright on all redistributions, whether
verbatim or modified works.

And from the Introduction section of documentation available at
http://www-stat.stanford.edu/~wavelab/Wavelab_850/AboutWaveLab.pdf,
"The library is available free of charge over the Internet by WWW
access; instructions are given below. The material is, however,
copyrighted, so that advance permission is required for
any commercial use."

I am not a lawyer, but these terms seem to conflict with Octave's
license, the GNU GPL.  Perhaps a "non-free" Octave-Forge package (like
Arpack and spline-gcvspl) would be be a possibility.

> I've been trying to muck through WaveLabOnOctave, but I'm such an Octave
> noob - sometimes an Octave guru can do in 5 minutes what would take a
> noob a month (or more) to understand and implement.

I tinkered a bit with WavePath.m, the file that adds the WaveLab code to
your [Octave] path.  I made two changes: (1) eliminated the dependence
on the "matlabroot" variable by simply requiring that you run the script
from the WaveLab directory, and (2) removed some strange markup that
existed in the original file.  The modified WavePath.m is attached.

Executing this file seems to successfully add all of the WaveLab stuff
to the Octave path on my machine.  I didn't try to compile the mex
files, but the documentation indicates that the functions should still
work, albeit more slowly.  An attempt to run one of the demos failed, it
seems that the demo is graphically based and incompatible with Octave
graphics (at least with the gnuplot backend that I'm using).  So the
demos may be unavailable to you, but the functions that actually perform
various analyses should be accessible.

Does this help any?

-- 
------------------------------------------------------------------
Marc D. Normandin              http://web.ics.purdue.edu/~mdnorman
Graduate Research Assistant                     address@hidden
Indiana University School of Medicine           317-278-9841 (tel)
Department of Radiology, Division of Research   317-274-1067 (fax)
------------------------------------------------------------------
%  WavePath -- initialize path to include WaveLab 
%       
% This file was modified to remove some strange markup characters and
% to remove dependency on the "matlabroot" variable.  The second
% change was implemented by simply assuming that this file is being
% run from the WaveLab directory.  If this does not suit your needs,
% you should assign the "WAVELABPATH" variable appropriately below.
%
% Marc Normandin  address@hidden
% 10 August 2008

fprintf('Welcome to WaveLab v 850 \n');
disp('Setting Global Variables');
%
global WAVELABPATH
global PATHNAMESEPARATOR
global PREFERIMAGEGRAPHICS
global MATLABPATHSEPARATOR
global WLVERBOSE

WLVERBOSE = 'Yes';
PREFERIMAGEGRAPHICS = 1;
%
Friend = computer;
if strcmp(Friend,'MAC2'),
  PATHNAMESEPARATOR = ':';
  WAVELABPATH = ['Macintosh HD:Build 850:Wavelab$VERSION$', PATHNAMESEPARATOR];
  MATLABPATHSEPARATOR = ';';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% make path independent of "matlabroot"
% requires you run this from WaveLab directory
%  WAVELABPATH=strcat(matlabroot,'/toolbox/Wavelab850/')
  WAVELABPATH = strcat (pwd, '/')
% Marc Normandin  address@hidden
% 10 August 2008
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elseif isunix,
  PATHNAMESEPARATOR = '/';
  WAVELABPATH = [pwd, PATHNAMESEPARATOR];
  MATLABPATHSEPARATOR = ':';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% make path independent of "matlabroot"
% requires you run this from WaveLab directory
%  WAVELABPATH=strcat(matlabroot,'/toolbox/Wavelab850/')
  WAVELABPATH = strcat (pwd, '/')
% Marc Normandin  address@hidden
% 10 August 2008
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elseif strcmp(Friend(1:2),'PC');
  PATHNAMESEPARATOR = '\';
  WAVELABPATH = [cd PATHNAMESEPARATOR];
  MATLABPATHSEPARATOR = ';';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% make path independent of "matlabroot"
% requires you run this from WaveLab directory
%  WAVELABPATH=strcat(matlabroot,'\toolbox\Wavelab850\')
  WAVELABPATH = strcat (pwd, '\')
% Marc Normandin  address@hidden
% 10 August 2008
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
else
  disp('I don*t recognize this computer; ')
  disp('Pathnames not set; solution: edit WavePath.m')
end

UserWavelabPath='';
while (exist(WAVELABPATH)~=7)
  WAVELABPATH=input(sprintf('Directory %s does not exist.\nEnter the correct 
path (type 0 to exit): ',WAVELABPATH),'s')
  if WAVELABPATH=='0'
    fprintf('\nError occurs and WaveLab has not been set up.\n')
    fprintf('Solution: Identify the correct path for WaveLab Directory in 
toolbox\n\n')
    clear all;
    return;
  end
  if (WAVELABPATH(end))~=PATHNAMESEPARATOR
    WAVELABPATH=strcat(WAVELABPATH, PATHNAMESEPARATOR);
  end
end


%
global MATLABVERSION
V = version;
MATLABVERSION = str2num(V(1:3));

if MATLABVERSION < 6,
  disp('Warning: This version is only supported on Matlab 6.x and 7.x');
end

%
% Basic Tools
p = path;
pref = [MATLABPATHSEPARATOR WAVELABPATH];
post = PATHNAMESEPARATOR;
p = [p pref];

p = [p pref 'Biorthogonal'      post];
p = [p pref 'Continuous'        post];
p = [p pref 'Datasets'          post];
p = [p pref 'DeNoising'         post];
p = [p pref 'Documentation'     post];
p = [p pref 'FastAlgorithms'    post];
p = [p pref 'Fractals'          post];
p = [p pref 'Interpolating'     post];
p = [p pref 'MEXSource'         post];
p = [p pref 'Median'            post];
p = [p pref 'Median' PATHNAMESEPARATOR 'HigherDegree' post];
p = [p pref 'Meyer'             post];
p = [p pref 'Orthogonal'        post];
p = [p pref 'Packets' PATHNAMESEPARATOR 'One-D' post];
p = [p pref 'Packets' PATHNAMESEPARATOR 'Two-D' post];
p = [p pref 'Papers'            post];
p = [p pref 'Pursuit'           post];
p = [p pref 'Invariant'         post];
p = [p pref 'Utilities'         post];
p = [p pref 'TimeFrequency'     post];
p = [p pref 'Workouts'          post];

% Papers
pref = [MATLABPATHSEPARATOR WAVELABPATH];
pref = [pref 'Papers'   post];
p = [p pref 'Adapt'                     post];
p = [p pref 'Asymp'                     post];
p = [p pref 'Blocky'                    post];
p = [p pref 'Correl'                    post];
p = [p pref 'Ideal'                     post];
p = [p pref 'MinEntSeg'                 post];
p = [p pref 'MIPT'                      post];
p = [p pref 'RiskAnalysis'              post];
p = [p pref 'ShortCourse'               post];
p = [p pref 'SpinCycle'                 post];
p = [p pref 'Tour'                      post];
p = [p pref 'VillardDeLans'             post];

pref = [MATLABPATHSEPARATOR WAVELABPATH];
pref = [pref 'Workouts'         post];
p = [p pref 'BestOrthoBasis'    post];
p = [p pref 'MatchingPursuit'   post];
p = [p pref 'Toons'             post];
p = [p pref 'MultiFractal'              post];

% Browsers
pref = [MATLABPATHSEPARATOR WAVELABPATH];
pref = [pref 'Browsers' post];
p = [p pref 'One-D'     post];
p = [p pref 'WaveTour'  post];

pref = [MATLABPATHSEPARATOR WAVELABPATH];

% Book(s)
pref = [MATLABPATHSEPARATOR WAVELABPATH];
pref = [pref 'Books' PATHNAMESEPARATOR 'WaveTour' post];
p = [p pref 'WTCh02'    post];
p = [p pref 'WTCh04'    post];
p = [p pref 'WTCh05'    post];
p = [p pref 'WTCh06'    post];
p = [p pref 'WTCh07'    post];
p = [p pref 'WTCh08'    post];
p = [p pref 'WTCh09'    post];
p = [p pref 'WTCh10'    post];

path(p);
disp('Pathnames Successfully Set');
clear p pref post

%
fprintf('global WAVELABPATH = "%s"\n',              WAVELABPATH)
fprintf('global PATHNAMESEPARATOR = "%s"; ',  PATHNAMESEPARATOR)
fprintf('global MATLABVERSION = %g\n',            MATLABVERSION)
fprintf('global PREFERIMAGEGRAPHICS = %g\n',PREFERIMAGEGRAPHICS)
fprintf('WaveLab v 802 Setup Complete\n\n')
fprintf('Available Demos - Figures from the following papers:\n')
fprintf('  AdaptDemo  - ``Adapting to Unknown Smoothness via Wavelet 
Shrinkage''''\n')
fprintf('  AsympDemo  - ``Wavelet Shrinkage: Asymptopia?''''\n')
fprintf('  BlockyDemo - ``Smooth Wavelet Decompositions with Blocky Coefficient 
Kernels''''\n')
fprintf('  CorrelDemo - ``Wavelet Threshold Estimators for Data with Correlated 
Noise''''\n')
fprintf('  IdealDemo  - ``Ideal Spatial Adaptation via Wavelet Shrinkage''''\n')
fprintf('  MESDemo    - ``Minimum Entropy Segmentation''''\n')
fprintf('  MIPTDemo  - ``Nonlinear Wavelet Transforms based on 
Median-Interpolaton''''\n')
fprintf('  RiskDemo  - ``Exact Risk Analysis of Wavelet Regression''''\n')
fprintf('  SCDemo     - ``Nonlinear Wavelet Methods for Recovery of Signals, 
Densities\n')
fprintf('                  and Spectra from Indirect and Noisy Data''''\n')
fprintf('  CSpinDemo   - ``Translation-Invariant De-Noising''''\n')
fprintf('  TourDemo   - ``Wavelet Shrinkage and W.V.D. -- A Ten-Minute 
Tour''''\n')
fprintf('  VdLDemo    - ``WaveLab and Reproducible Research''''\n\n')
fprintf('Available Workouts:\n')
fprintf('  BBWorkout  - Workouts for Best Basis\n')
fprintf('  MPWorkout  - Workouts for Matching Pursuit\n')
fprintf('  MultiFrac  - Workouts for Continuous Wavelet Transform\n')
fprintf('  Toons      - The Cartoon Guide to Wavelets\n\n')
fprintf('Available Book(s):\n')
fprintf('  WaveTour   - ``WaveLet Tour of Signal Processing''''\n\n')

%
% the next statement leaves items in global workspace
%  but hides them from local workspace
%
clear WAVELABPATH MATLABVERSION PATHNAMESEPARATOR
clear Friend PREFERIMAGEGRAPHICS MATLABPATHSEPARATOR
 
 
%
%  Part of Wavelab Version 850
%  Built Tue Jan  3 13:20:38 EST 2006
%  This is Copyrighted Material
%  For Copying permissions see COPYING.m
%  Comments? e-mail address@hidden 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]