Re: fft



On Feb 18, 12:46 pm, Gordon Sande <g.sa...@xxxxxxxxxxxxxxxx> wrote:
The OP wanted to evaluate the numerical accurracy of an FFT. One thing
that would be instructive is to see that it is more accurate than the
naive definition. A nice easy way is to do it forward and back as he
proposed for the FFT. I assumed that if he had the sense to ask for
comments he was likely to try his proposed forward and back method
on the other ways.

In my experience, it's unreliable to assume that students will check
their answers in multiple redundant ways. They find one way that
seems to work, and stop there. So if you tell students to compare to
the O(N^2) algorithm, without warning them that the latter is less
accurate, it's quite likely they will just compare the two algorithms
for random inputs and stop there.

Since the OP stated that he is a student. One might have thought that
suggesting a student to do other things to illustrate the background
might have helped the student's general education.

The problem is, if a student asks how to measure the "numerical
accuracy of an fft" and you tell him to compare to the O(N^2)
algorithm, it is a bit deceptive, because that comparison is measuring
the accuracy of the O(N^2) algorithm rather than the fft.

Of course, given enough time, hints, and prodding, the student may
figure out for himself that your answer didn't mean what it seemed,
but posting trick answers on internet forum is a bit dubious from a
pedagogical perspective, in my opinion.

It is not really necessary for the student's first step towards
understanding to be at the frontiers of the state of the art.

I agree, but an forum like this has wide readership; it's nice to give
a pointer or two to more advanced/rigorous approaches in addition to
the simplest answers (and often students appreciate seeing a broader
context as well). Also, this student *explicitly* asked for "papers"
describing methods to check accuracy, which indicates an attempt to go
beyond the level of the traditional homework problem.

Probaby the simplest and most general thing one can do, for numerical
accuracy, is to perform an FFT in single precision and compare it to
the result in double precision (or compare double precision to an
arbitrary-precision arithmetic FFT, which is how we perform our
accuracy benchmarks in FFTW, fftw.org/accuracy/).

Fine if you have all that infrastructure. What should a under-resourced
student, and probably without a lot of supervision, away from a major
research university do?

s/double/float/ is pretty easy even for a student.

(Also, our accuracy benchmark code is available to download.)

Regards,
Steven G. Johnson
.



Relevant Pages

  • Re: fft
    ... Is there any standard method to follow? ... evaluate the numerical accuracy of an FFT because the Oalgorithm ... has far worse floating-point error growth than most FFT algorithms (on ... Since the OP stated that he is a student. ...
    (comp.dsp)
  • Re: Evolution in HS Anthropology class
    ...  An algorithm is an effective procedure for solving a problem. ... The concept of "fraction", leaving aside improper fractions for the ... 1/5 of the pizza. ... Each student now has seven equal-sized small pieces, ...
    (talk.origins)
  • Re: Evolution in HS Anthropology class
    ... algorithm provides a solution is the so-called Halting Problem for ... the fraction 1/7 means one of seven equal parts of the whole. ... 1/5 of the pizza. ... Each student now has seven equal-sized small pieces, ...
    (talk.origins)
  • Re: Evolution in HS Anthropology class
    ... algorithm provides a solution is the so-called Halting Problem for ... 1/5 of the pizza. ... Each student now has seven equal-sized small pieces, ... 'understands the concept of fractions' and someone who simply knows ...
    (talk.origins)
  • Re: PRINTING DIAMOND SHAPE WITH LOOPS!
    ... Okay, Paul, et al., ... > falsely not to be a student, while explaining what kind of student you are. ... > of place in a simple, deterministic algorithm like this. ...
    (comp.lang.java.programmer)