octave-maintainers
[Top][All Lists]
Advanced

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

Re: Test failure for fftfilt.m


From: Ed Meyer
Subject: Re: Test failure for fftfilt.m
Date: Sat, 16 Mar 2013 16:18:49 -0600



On Sat, Mar 16, 2013 at 1:50 AM, Daniel J Sebald <address@hidden> wrote:
Below seems to be the fftfilt accuracy issue cropping up again.  I seem to recall we went through all these tests and reworked them somewhat by increasing the tolerance value somewhat larger than eps (many multiples) and adding more tests to really check the fftfilt routine beyond the few degenerate cases.  None of that seems to be in the fftfilt.m file.  Was some changes set lost or reverted along the way?  In the repository, the most recent changeset is:

http://hg.savannah.gnu.org/hgweb/octave/file/72c96de7a403/scripts/signal/fftfilt.m
Mon, 02 Jan 2012 14:25:41 -0500 (14 months ago)

It seems like the group examined this since then, sometime in early September of last year according to my old emails.

Dan


processing /usr/local/src/octave/octave-dialog/octave/scripts/signal/fftfilt.m
  ***** test
 r = sqrt (1/2) * (1+i);
 b = b*r;
 assert (fftfilt (b, x  ), r*[1 1 0 0 0 0 0 0 0 0]  , eps);
 assert (fftfilt (b, r*x), r*r*[1 1 0 0 0 0 0 0 0 0], eps);
 assert (fftfilt (b, x.'), r*[1 1 0 0 0 0 0 0 0 0].', eps);
!!!!! test failed
assert (fftfilt (b, r * x),r * r * [1, 1, 0, 0, 0, 0, 0, 0, 0, 0],eps) expected
 Columns 1 through 3:
   0.00000 + 1.00000i   0.00000 + 1.00000i   0.00000 + 0.00000i
 Columns 4 through 6:
   0.00000 + 0.00000i   0.00000 + 0.00000i   0.00000 + 0.00000i
 Columns 7 through 9:
   0.00000 + 0.00000i   0.00000 + 0.00000i   0.00000 + 0.00000i
 Column 10:
   0.00000 + 0.00000i
but got
 Columns 1 through 3:
   0.00000 + 1.00000i   0.00000 + 1.00000i   0.00000 - 0.00000i
 Columns 4 through 6:
  -0.00000 + 0.00000i  -0.00000 + 0.00000i   0.00000 + 0.00000i
 Columns 7 through 9:
  -0.00000 + 0.00000i   0.00000 - 0.00000i  -0.00000 + 0.00000i
 Column 10:
  -0.00000 + 0.00000i
maximum absolute error 2.22478e-16 exceeds tolerance 2.22045e-16
shared variables   scalar structure containing the fields:
    b =
       1   1
    x =
       1   0   0   0   0   0   0   0   0   0
    r = [](0x0)

I fixed the tests last fall according to what I consider the right way to
do tests like this. As I have said several times before tests should not
in general use absolute tolerances, rather they should take into account
the size of the data. So for example instead of

assert (fftfilt (b, r * x),r * r * [1, 1, 0, 0, 0, 0, 0, 0, 0, 0],eps)

I used

%! y = r*r*[1 1 0 0 0 0 0 0 0 0];
%! tol = 2*norm(y)*eps;
%! assert (fftfilt (b, r*x), y, tol);

There are a number of tests like this (eig.cc for example) with absolute
tolerances which should be using norms. But don't take my word for it,
see, e.g. Golub & Van Loan, "Matrix Computations".



--
Ed Meyer

reply via email to

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