Menu

#1 compute only subset of the fourier transform (zero centered)

open
nobody
None
5
2012-02-16
2012-02-16
No

As I only need a subset of the fourier transform (centered on zero), I implemented an optimized realForward alternative: realForwardSubset(final int subSize, float[][]) where subSize corresponds to both input image size and output DFT size.

The main idea consist in avoiding computing frequencies higher than desired subSize and using only the input image << FFT size to use less memory (subSize x DFT size instead of size x size) and skip FFT over zero values i.e. avoid zero padding.

I provide the pacthed FloatFFT_2D class to have your review / point of view. The only problem I guess concerns data in the first column (re/im) that contains values for zero, rows/2 and columns/2 (mixed).

I also added another optimization to avoid allocating too large arrays newRows / newCols for very large FFT (>64K) and work in parallel on chunks in a sort of pipeline (rows => output) > (output => columns) > final subpart. Doing so, it only consumes 512M to compute an FFT 256K for an output size of 8192.

I think such enhancement could be generalized to other FFT methods and at least integrated to the next JTransforms release. What is your opinion ?

Here are benchmark results limited to 16K full FFT due to the memory limit on my computer (2g):
Full FFT:
11:42:42.588 INFO [main] fits.ImageFitsTest - FFT realForward[2048 - 2048]: average duration = 153.7692635 ms (10 iterations).
11:42:50.915 INFO [main] fits.ImageFitsTest - FFT realForward[4096 - 4096]: average duration = 433.6015159 ms (10 iterations).
11:43:13.437 INFO [main] fits.ImageFitsTest - FFT realForward[8192 - 8192]: average duration = 1777.2291536 ms (10 iterations).
11:44:51.746 INFO [main] fits.ImageFitsTest - FFT realForward[16384 - 16384]: average duration = 8456.270368399999 ms (10 iterations).
FFT Subset:
11:42:44.607 INFO [main] fits.ImageFitsTest - FFT realForward[512 - 2048]: average duration = 30.388753700000002 ms (10 iterations). (5 times faster)
11:42:53.209 INFO [main] fits.ImageFitsTest - FFT realForward[512 - 4096]: average duration = 64.2379522 ms (10 iterations). (6.9 times faster)
11:43:16.189 INFO [main] fits.ImageFitsTest - FFT realForward[512 - 8192]: average duration = 111.0820636 ms (10 iterations). (16 times faster)
11:44:56.155 INFO [main] fits.ImageFitsTest - FFT realForward[512 - 16384]: average duration = 261.37946509999995 ms (10 iterations). (32.3 times faster)

Discussion

  • Laurent Bourgès

    provided patch having realForwardSubset(subSize, float[][])

     
  • Nobody/Anonymous

    You actually make it seem so easy with your presentation but I find this topic to be actually something that I think I would never understand. It seems too complex and very broad for me. I am looking forward for your next post, I?ll try to get the hang of it!
    http://guccibagssales.tumblr.com

     
  • Nobody/Anonymous

    I think other site proprietors should take this website as an model, very clean and magnificent user friendly style and design, let alone the content. You are an expert in this topic!
    http://seosoftwaresales.tumblr.com

     
  • Nobody/Anonymous

    It??s really a cool and useful piece of information. I am satisfied that you just shared this useful info with us. Please keep us informed like this. Thanks for sharing.
    wow gold usa http://wowgoldus.tumblr.com/

     
  • Nobody/Anonymous

    Hey, you used to write fantastic, but the last several posts have been kinda boringK I miss your great writings. Past several posts are just a little bit out of track! come on!
    wow gold prices http://iwowgold.tumblr.com/

     
  • Nobody/Anonymous

    Hi, I log on to your blogs like every week. Your humoristic style is witty, keep up the good work!
    cheap wow gold http://cheapgold4wow.tumblr.com/

     
  • Nobody/Anonymous

    You actually make it seem so easy with your presentation but I find this matter to be actually something that I think I would never understand. It seems too complex and extremely broad for me. I'm looking forward for your next post, I will try to get the hang of it!
    diablo 3 gold http://www.d3eye.com

     
  • Nobody/Anonymous

    My brother recommended I might like this blog. He was totally right. This post actually made my day. You cann't imagine simply how much time I had spent for this info! Thanks!
    chanel outlet http://chaneloutletonline.weebly.com/

     
  • Nobody/Anonymous

    Ive been exploring for a bit for any high quality articles or blog posts on this kind of space . Exploring in Yahoo I eventually stumbled upon this web site. Studying this info So i am satisfied to express that I have a very just right uncanny feeling I discovered just what I needed. I so much unquestionably will make sure to dont disregard this web site and provides it a glance on a constant basis|regularly}.
    chanel classic flap bag http://chanelclassicflapbag.ezweb123.com/

     
  • Nobody/Anonymous

    I am always invstigating online for ideas that can facilitate me. Thx!
    chanel bag http://chanelbag.onsugar.com/

     
  • Nobody/Anonymous

    Hi there, I discovered your web site by way of Google while looking for a related topic, your web site got here up, it seems great. I've bookmarked it in my google bookmarks.
    chanel bags http://chanelbags.onsugar.com/

     
  • Nobody/Anonymous

    Sweet blog! I found it while browsing on Yahoo News. Do you have any tips on how to get listed in Yahoo News? Ive been trying for a while but I never seem to get there! Thank you
    derrick rose shoes http://derrickroseshoes0.webnode.com

     
  • Nobody/Anonymous

    I'm very happy to read this. This is the type of manual that needs to be given and not the accidental misinformation that is at the other blogs. Appreciate your sharing this best doc. archeage power leveling http://www.cheap-archeage-gold.com/archeage-power-leveling.html

     
  • Nobody/Anonymous

    Family and pals around me truly feel that i am easy to have mood swings, it can be terrible to come across yourself dropped management of your appetite, but many thanks to Fruta Planta, I eventually have the freedom to management my foods instead of it controlling me! Zi Xiu Tang http://www.361slimcapsule.com/

     
  • Nobody/Anonymous

    This has curbed my appetite and has given me a great source of energy, does not make me crash either. So far I've shed about 1.5 lbs. Bee Pollen Weight Loss http://www.361slimcapsule.com/

     
  • Nobody/Anonymous

    qLWApW <a href="http://lfwotwscynmi.com/">lfwotwscynmi</a>, [url=http://igcfimyrolps.com/]igcfimyrolps[/url], [link=http://wtxbdckujeun.com/]wtxbdckujeun[/link], http://skguzqturuqa.com/

     
  • Nobody/Anonymous

    All u guys that cant grasp why the possibility blood elves joined horde in place of alliance are juvenile fools, its so simple: Blood elves were already facing persecution from prejuidiced human generals and they also enlisted the help of the naga the alliance locked them up and had been goign ot kill these products, but the elves steered clear of, plus they blame the alliance for the losing of their home land i assume. Do you really think the blood elves would join that crowd again wow powerleveling http://buygoldwow.webklik.nl/page/guessing-about-the-patch-3one-release

     
  • Nobody/Anonymous

    I have no problem with restrictions on free to play accounts, if I want more from the game I can buy the extras or upgrade my very own account. But constant pop-ups reminding me Let me upgrade is ridiculous to me. Why offer free to play when quite clearly they want you to pay to play. If they think pop-up windows will encourage someone to do that I think they contain it mistaken. Diablo 3 Gold EU http://www.diablo3web.com/Buy-Diablo3-Gold-EU.html

     
  • Nobody/Anonymous

    PVP is different and Blizz has to take steps to balance the action economy in PVP. Diablo 3 Gold Asia http://www.diablo3web.com/Buy-Diablo3-Gold-Asia.html

     
  • Nobody/Anonymous

    Seriously though, you could say a real about any game in a very established genre. Buy Diablo 3 Gold Asia http://www.diablo3web.com/Buy-Diablo3-Gold-Asia.html

     
  • Nobody/Anonymous

    ZdwXob <a href="http://qyqwiyjcdple.com/">qyqwiyjcdple</a>, [url=http://jsvqdzcgcymp.com/]jsvqdzcgcymp[/url], [link=http://fivlyhdwxjpm.com/]fivlyhdwxjpm[/link], http://yjnnqppeojwv.com/