Re: FFT implementation in ImageJ

Posted by James Ewing on
URL: http://imagej.273.s1.nabble.com/FFT-implementation-in-ImageJ-tp5008239p5008246.html

My experience with the NR FFT is that it can be improved for speed.  Using pointers, and discarding that strange translation of Fortran that generates useless vectors starting at the index 1, I wrote a C translation of the Fortran NR FFT that improved execution time by about 30%.  I can send the C code to anyone who wants it.  I’m not promising that there aren’t faster versions, but this could be a starting point.

 - Jim Ewing.

On Jun 16, 2014, at 5:44 PM, Kenneth R Sloan <[hidden email]> wrote:

> As always with _Numerical Recipes_, use the code with caution.  The code is
> explicitly intended as a *starting point*.  You should also read the WORDS
> in the chapter, and consider extending and hardening the sample code.
>
> Also, if you can find it, my experience is that the C version of _NR_ is
> distinctly WORSE than the original ForTran for many algorithms (I have not
> checked the FFT code to see if this trend holds here).  When I use _NR_ algorithms,
> I always start with the original.
>
> And…while I appreciate the reasons, it seems (to me) wrong to claim to “compute the
> FFT via the FHT”.  Truth in advertising, please. Most of the time, “close” is good enough.
> But, not always.
>
> I think ImageJ would be improved by offering both the FFT *and* the FHT, with appropriate
> (and correct) documentation.
>
> --
> Kenneth Sloan
> [hidden email]<mailto:[hidden email]>
> "La lutte elle-même vers les sommets suffit à remplir un coeur d'homme; il faut imaginer Sisyphe heureux."
>
>
> On Jun 16, 2014, at 13:37 , Curtis Rueden <[hidden email]<mailto:[hidden email]>> wrote:
>
> Hi Herbie & Mariam,
>
> You may also have a look at the code in "Numerical Recipes". However, you
> have to change the C code to Java, which is rather easy.
>
> Note that Numerical Recipes code is released under a very restrictive
> license. Specifically: redistribution is prohibited. So if you are
> producing open source software, you will need to stay away from it.
>
> Regards,
> Curtis
>
>
> On Mon, Jun 16, 2014 at 12:16 PM, Herbie <[hidden email]<mailto:[hidden email]>> wrote:
>
> Mariam,
>
> ImageJ computes the 2D FFT via the 2D FHT.
>
> The resulting transforms (Fourier-spectra) are essentially the same as
> with a (direct) "classical" 2D FFT implementation. However the computation
> is faster.
>
> There is a plugin called FFTJ which is based on "classical 2D" FFT
> implementation. The source code is available.
>
> You may also have a look at the code in "Numerical Recipes". However, you
> have to change the C code to Java, which is rather easy.
>
> HTH
>
> Herbie
>
> ::::::::::::::::::::::::::::::::::
>
> On 16.06.14 18:58, Student1 wrote:
>
> Hi,
>
> I was wondering if ImageJ has standard FFT algorithm? Because I know
> ImageJ has a FFT window and it also FHT window, so does the FFT
> implementation based on the FHT algorithm? When I look into the code
> I basically see the FHT implementation but not a standard FFT
> algorithm.
>
> Thanks.
>
> Mariam Dost -- ImageJ mailing list:
> http://imagej.nih.gov/ij/list.html
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html