On Fri, 27 Mar 2009, Craig DeForest wrote:
> Hi, Hugh,
>
> Right now, the built-in fft code requires using separate variables to contain
> the
> real and imaginary components of the original array. For example, to find the
The historical reasons for this are obvious, and make sense up to a point,
but I think there is enough wrong with them to make a case for change.
But see below.
> Fourier transform of a real array $a nondestructively, one can:
>
> $ai = zeroes $a;
> $ar = copy $a;
> fft($ar,$ai);
> or
> $aa = copy $a;
> realfft($aa);
> $ar = $a->(0:$a->dim(0)/2-1);
> $ai = $a->($a->dim(0)/2:-1);
>
> The FFTW stuff requires running dim 0 across (real,imaginary), so one says
>
> $result = fftw $cplx
>
> where $cplx has size 2 in in the 0 dim. Different but also reasonable.
>
> I'm not sure whether the complex handling has to be changed, but I don't like
> that the built in fft stuff is automatically inplace. I've been complaining
> about that for a long time, but since I'm finally diving into the code I
> figure now's the time do something about it (provided that nobody pipes up and
> complains). Certainly I'm open to making the built-ins behave more like fftw
> if there's a desire to do so.
Well, since I primarily interested in N dimensional FFTs I'm capable
of getting myself in enough knots dimensionally without having to
track which slices are not actually slices, but what would be, in
an Object Oriented perspective, properties of a complex number.
Part of the point of OO interfaces was to shield us from this
indexing stuff which is so easy to get wrong.
Maybe another interface could meet the needs of people with my kind
of expectation. Simplicity is difficult to design, and when you
have backwards compatibility and performance to think of, it is even
harder. So I don't know what is achievable with the time * energy
available. But if you bear future simplicity in mind you might be
able to shape things so that it make the job easier for the next
phase.
>
> Cheers,
> Craig
>
>
>
Hugh
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl