help-octave
[Top][All Lists]
Advanced

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

Help me convert a Matlab file


From: ionone
Subject: Help me convert a Matlab file
Date: Sun, 25 Aug 2013 11:02:59 -0700 (PDT)

Hello

I'm currently trying to convert a Matlab program to Octave. Here you can get
all the m files i converted :  http://khaelis.com/tmp/m.zip
<http://khaelis.com/tmp/m.zip>  

but when i run the program, i have a different result from what they
computed in this page : 
http://vadkudr.org/Algorithms/LangIIR/LangIIR_examples.html
<http://vadkudr.org/Algorithms/LangIIR/LangIIR_examples.html>  

the algorithm has been taken from this paper : 
http://www.nt.tuwien.ac.at/fileadmin/users/gerhard/diss_Lang.pdf
<http://www.nt.tuwien.ac.at/fileadmin/users/gerhard/diss_Lang.pdf>   page
171 from the main function.

What are the differences:

from the narrow band filter they have these values :

ERROR    MAX.RADIUS    STEP       SLOPE
 9.070e+000 8.877e-001 1.979e+000 -2.872e-001 
 7.212e+000 9.403e-001 8.745e-001 -5.000e-001 
 5.251e+000 9.577e-001 8.267e-001 -4.071e-001 
 4.342e+000 9.505e-001 1.184e+000 -1.605e-001 
 3.969e+000 9.400e-001 1.164e+000 -2.535e-001 
 3.280e+000 9.216e-001 7.838e-001 -5.230e-001 
 2.153e+000 9.528e-001 3.441e-001 -7.251e-001 
 1.508e+000 9.423e-001 2.206e-001 -2.737e-001 
 1.350e+000 9.436e-001 2.837e-001 -1.233e-001 
 1.282e+000 9.455e-001 3.225e-001 -6.556e-002 
 1.245e+000 9.454e-001 4.222e-001 -4.978e-002 
 1.215e+000 9.457e-001 5.883e-001 -6.161e-002 
 1.174e+000 9.442e-001 7.407e-001 -1.057e-001 
 1.098e+000 9.547e-001 7.887e-001 -2.360e-001 
 9.064e-001 9.693e-001 4.477e-001 -4.362e-001 
 6.435e-001 9.750e-001 2.132e-001 -6.106e-001 
 4.383e-001 9.710e-001 5.675e-001 -4.661e-001 
 3.507e-001 9.690e-001 5.604e-001 -3.447e-001 
 3.067e-001 9.699e-001 4.295e-001 -2.198e-001 
 2.814e-001 9.710e-001 2.610e-001 -1.130e-001 
 2.694e-001 9.727e-001 1.663e-001 -5.685e-002 
 2.634e-001 9.733e-001 1.107e-001 -2.854e-002 
 2.603e-001 9.740e-001 1.134e-001 -1.851e-002 
 2.581e-001 9.743e-001 1.644e-001 -1.727e-002 
 2.559e-001 9.746e-001 2.393e-001 -2.226e-002 
 2.530e-001 9.748e-001 3.458e-001 -3.366e-002 
 2.484e-001 9.750e-001 4.671e-001 -5.595e-002 
 2.408e-001 9.753e-001 5.751e-001 -1.014e-001 
 2.265e-001 9.759e-001 6.326e-001 -2.086e-001 
 1.962e-001 9.763e-001 4.803e-001 -3.611e-001 
 1.535e-001 9.773e-001 2.031e-001 -3.467e-001 
 1.256e-001 9.782e-001 8.498e-002 -2.277e-001 
 1.113e-001 9.789e-001 3.959e-002 -1.332e-001 
 1.039e-001 9.794e-001 1.972e-002 -7.519e-002 
 1.000e-001 9.796e-001 1.030e-002 -4.193e-002 
 9.795e-002 9.798e-001 5.462e-003 -2.325e-002 
 9.681e-002 9.799e-001 2.995e-003 -1.285e-002 
 9.619e-002 9.799e-001 1.642e-003 -7.083e-003 
 9.585e-002 9.800e-001 9.394e-004 -3.919e-003 
 9.566e-002 9.800e-001 5.351e-004 -2.152e-003 
 9.556e-002 9.800e-001 3.037e-004 -1.191e-003 
 9.550e-002 9.800e-001 1.822e-004 -6.597e-004 
 9.547e-002 9.800e-001 1.039e-004 -3.575e-004 
 9.546e-002 9.800e-001 6.150e-005 -2.025e-004 
 9.545e-002 9.800e-001 3.701e-005 -1.147e-004 
 9.544e-002 9.800e-001 2.236e-005 -6.450e-005 

and i have these :

  9.070e+000 1.061e+000 1.997e+000 -7.899e-001
  1.119e+001 1.052e+000 3.264e-001 -2.346e-001
  1.019e+001 1.125e+000 1.414e+000 -5.981e-002
  1.007e+001 1.085e+000 1.241e-001 -2.204e-002
  9.976e+000 1.008e+000 4.032e-001 -8.092e-003
  9.868e+000 1.052e+000 8.317e-001 -3.368e-001
  9.967e+000 1.938e+000 1.706e+000 -1.288e+000
  9.945e+000 4.545e+000 2.168e+000 -6.259e-002
  9.946e+000 4.758e+001 1.815e+000 -1.035e-002
  9.942e+000 4.159e+001 1.467e+000 -1.011e-002
  9.892e+000 7.223e+001 1.895e+000 -6.343e-002
  1.001e+001 1.640e+001 2.381e-001 -1.618e-002
  9.966e+000 8.069e+001 3.286e-001 -1.218e-002
  9.936e+000 1.687e+002 3.465e-001 -8.199e-003
  9.915e+000 2.291e+002 3.085e-001 -3.040e-003
  9.902e+000 3.199e+002 8.020e-001 -7.278e-003
  9.850e+000 2.452e+002 1.605e+000 -6.718e-002
  1.000e+001 2.068e+002 1.462e-001 -8.621e-003
[...................................................................]
  2.613e-001 2.100e+003 8.208e-004 -1.390e-005
  2.613e-001 2.099e+003 7.134e-004 -1.056e-005
  2.613e-001 2.098e+003 6.201e-004 -8.015e-006
  2.613e-001 2.098e+003 5.390e-004 -6.081e-006
  2.613e-001 2.097e+003 4.686e-004 -4.612e-006
  2.613e-001 2.097e+003 4.073e-004 -3.497e-006
  2.613e-001 2.096e+003 3.541e-004 -2.651e-006
  2.613e-001 2.096e+003 3.078e-004 -2.009e-006
  2.613e-001 2.095e+003 2.676e-004 -1.522e-006
  2.613e-001 2.095e+003 2.327e-004 -1.153e-006
  2.613e-001 2.095e+003 2.023e-004 -8.734e-007
  2.613e-001 2.094e+003 1.759e-004 -6.614e-007
  2.613e-001 2.094e+003 1.529e-004 -5.008e-007
  2.613e-001 2.094e+003 1.330e-004 -3.792e-007
  2.613e-001 2.094e+003 1.156e-004 -2.871e-007
  2.613e-001 2.094e+003 1.006e-004 -2.173e-007
  2.613e-001 2.094e+003 8.746e-005 -1.645e-007


so you can see from the beginning that the Max Radius parameter is of the
chart (>1) in my implementation. The filter also is unstable.
I had to modify the main function to make it work (and not stop from that
parameter). 
I changed the line :
/*if* (step < tol && abs(slope) < tol) || pr > r,
        break; 
*end*/
 to :
/*if* (step < tol && abs(slope) < tol),
        break; 
*end*/

*so why is Max Radius > 1 at the very start ? Unfortunately i cannot compare
as i don't own Matlab. Could you pinpoint the errors i made during the
algorithm conversion ?*

thanks a lot

Jeff




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Help-me-convert-a-Matlab-file-tp4656804.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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