[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: WaveLab error & fix!
From: 
Laurent Jacques 
Subject: 
Re: WaveLab error & fix! 
Date: 
Mon, 18 Aug 2003 10:27:24 +0200 
Useragent: 
KMail/1.5.1 
Hi,
It seems that octave uses its own reverse function instead of the Wavelab
ones.
Try to recall ./Orthogonal/reverse.m by for instance
./Orthogonal/filtreverse.m for "filter reverse" and modify aconv (and all the
files using it  grep list a the end of this mail) in consequence.
This is perhaps a remark to add in the wiki page WavelabOnOctave of
wiki.octave.org dedicated to Wavelab issues.
Other function callings have perhaps the same problem. To check.
Bye,
Laurent.
P.S. The list (perhaps too long)
Biorthogonal/MakeBSFilter.m
Biorthogonal/UpDyad_SBS.m
Biorthogonal/extend.m
Biorthogonal/symm_aconv.m
Books/WaveTour/WTCh04/MakeChirps.m
Books/WaveTour/WTCh06/wt06fig06.m
Books/WaveTour/WTCh06/wt06fig16.m
Books/WaveTour/WTCh06/wt06fig18.m
Books/WaveTour/WTCh06/wt06fig20.m
Books/WaveTour/WTCh07/wt07fig21.m
Books/WaveTour/WTCh10/wt10fig15.m
Browsers/OneD/do_cpcompress.m
Browsers/OneD/do_scalegram.m
Browsers/OneD/do_spectrum.m
Browsers/OneD/do_wpcompress.m
Browsers/OneD/do_wtcompress.m
Continuous/PlotThermoPartition.m
Datasets/MakeProcess.m
Datasets/MakeSignal.m
Interpolating/AIRefine.m
Interpolating/DDRefine.m
Orthogonal/CDJVDyadDown.m
Orthogonal/MakeCDJVFilter.m
Orthogonal/MakeOBFilter.m
Orthogonal/MakeONFilter.m
Orthogonal/aconv.m
Orthogonal/reverse.m
Packets/OneD/PlotCoeffComparison.m
Packets/OneD/PlotCompressNumbers.m
Papers/Adapt/opttrunc.m
Papers/Correl/StatShrink.m
Papers/MinEntSeg/Compare2.m
Papers/MinEntSeg/FastAllSeg.m
Papers/MinEntSeg/mefig201.m
Papers/MinEntSeg/mefig203.m
Papers/ShortCourse/SRefine.m
Papers/ShortCourse/scfig11.m
Papers/Tour/CompressoGram.m
Papers/VillardDeLans/vdlfig03.m
Workouts/BestOrthoBasis/Compare4Compress.m
Workouts/MatchingPursuit/Compare4Decomp.m
Workouts/Toons/KeepBiggest.m
Workouts/Toons/PlotOrderedCoef.m
Workouts/Toons/toon0311.m
Workouts/Toons/toon0312.m
Workouts/Toons/toon0342.m
Workouts/Toons/toon0432.m
Workouts/Toons/toon0433.m
Workouts/Toons/toon0443.m
Workouts/Toons/toon0444.m
Workouts/Toons/toon0524.m
Workouts/Toons/toon0531.m
Workouts/Toons/toon0532.m
Workouts/Toons/toon0533.m
Workouts/Toons/toon0563.m
Workouts/Toons/toon1612.m
Workouts/Toons/toon1613.m

On Friday 15 August 2003 00:59, Robert Leach wrote:
 I'm trying to do a daubechies wavelet transform. This is my first
 attempt at using the WaveLab802 package (and for that matter doing a
 wavelet analysis), but I suspect (and correct me if I'm wrong) that
 this problem had to do with compatibility between octave and this
 MATLAB package:

 octave:4> FWT_PO(signal,4,qmf)
 error: octave_base_value::list_value(): wrong type argument `matrix'
 error: evaluating assignment expression near line 31, column 8
 error: called from `aconv' in file
 `/sw/share/octave/2.1.46/m/WaveLab802/Orthogonal/aconv.m'
 error: evaluating assignment expression near line 14, column 3
 error: called from `DownDyadLo' in file
 `/sw/share/octave/2.1.46/m/WaveLab802/Orthogonal/DownDyadLo.m'
 error: evaluating assignment expression near line 26, column 13
 error: evaluating for command near line 23, column 3
 error: called from `FWT_PO' in file
 `/sw/share/octave/2.1.46/m/WaveLab802/Orthogonal/FWT_PO.m'


 Here's the relevant lines in aconv:

 function y = aconv(f,x)
 ...
 fflip = reverse(f);
 ...

 in DownDyadLo:

 function d = DownDyadLo(x,qmf)
 ...
 d = aconv(qmf,x);
 ...

 and in FWT_PO:

 function wcoef = FWT_PO(x,L,qmf)
 ...
 beta = ShapeAsRow(x); %take samples at finest scale as
betacoeffts
 for j=J1:1:L
 alfa = DownDyadHi(beta,qmf);
 wcoef(dyad(j)) = alfa;
 beta = DownDyadLo(beta,qmf);
 end


 signal is a 1D matrix (1 row & many columns) and qmf is the return from
 MakeONFilter in the WaveLab package.

 Now, I'm not a good octave coder. I can count the number of functions
 I've written on my digits. I don't know how to utilize all the
 efficient methods when dealing with arrays and stuff, but I coded up a
 solution to this problem that *appears* to have fixed it. I could be
 wrong because I don't know what the correct behavior of the output of
 FWT_PO is supposed to be (and likewise the MATLAB handling of various
 data structures in the call to reverse), so please let me know if I've
 done something wrong. I wrote a new reverse function called MATreverse
 (for MATLAB reverse). if I were really ambitious, I would write a
 little datatype check in octave's reverse and call MATreverse if the
 type is a matrix, but for expediency, I simply changed the call in
 FWT_PO. Here's the function:

 function y = aconv(x)

 %I'm writing this because MATLAB's reverse isn't compatible with
 octave's

 s1 = size(x,1); %I'm assuming here that MATLAB will reverse any 1D
 matrix
 s2 = size(x,2);
 if s1 == 1,
 if s2 == 1,
 s = s1;
 else
 s = s2;
 end
 else
 s = s1;
 end

 for i=1:s
 y(i) = x(si+1);
 end

 if s == s2
 y = y';
 end



 After incorporating this code, FWT_PO runs without error and my gut is
 telling me from the look of the output that it's right. If you confirm
 that this is a good thing or improve it (as I'm sure most of you
 could), where should this be reported?

 Rob

 =====================================================================
 = Robert W. Leach =
 = Los Alamos National Lab =
 = Bioscience Division: Bioinformatics & Computational Biology Group =
 = MS M888 =
 = Los Alamos, NM 87545 =
 = address@hidden =
 = 5056672307 =
 =====================================================================
 Work Calendar & ToDo
 List: http://66.93.220.190/phpicalendar/week.php?cal=Work



 
 Octave is freely available under the terms of the GNU GPL.

 Octave's home on the web: http://www.octave.org
 How to fund new projects: http://www.octave.org/funding.html
 Subscription information: http://www.octave.org/archive.html
 

Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
