Jump to content
  • Advertisement
Sign in to follow this  
Icebraker

2D FFT

This topic is 4094 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have implemented a noise algorithm and would like to see it's behaviour in the frequency domain. Therefore I have rendered it in an image and performed a 2D-FFT. I am sure my FFT is correct, but I don't know how to scale the values correctly to get an FFT image like http://www.qsimaging.com/ccd_noise_interpret_ffts.html. I have one array of thew size N*N, which stores the absolute value of the FFT. Can anybody please give me a hint how to scale the values (they are in the range 0 to 10000) correctly to get these images? Uniform division by the largest value does not work because it reduces all other small values to 0.. Thanks, Icebraker

Share this post


Link to post
Share on other sites
Advertisement
Scaling depends on what you use to plot the image. If you do this in say matlab with imagesc then it will automatically scale the values (highest value = white, lowest value = black). I think you should post an example of what you are currently getting and what you are using to plot. If you want something as good as the results shown on that website you might need to perform thresholding.

Share this post


Link to post
Share on other sites
To get those images, uniform division by the largest magniture IS what you want. Small non-zero values are reduced to zero because they are small and you're using limited precision. If you need non-zero values, you need a higher precision datatype.

edit: Actually, on a second thought, you may want to scale the logarithm of the magnitude to the range of your datatype. Keep in mind though that a simple scaling is not really enough, you need to offset the lowest value to zero first.

Share this post


Link to post
Share on other sites
I don't know that much about FFT in image processing, but in audio processing, we only ever consider the amplitudes on a logarithmic scale - it is the natural way to view phenomena that reside in an exponential domain (such as sound loudnesses as a function of wave amplitude).

However, I'm not thoroughly convinced that this is appropriate for bounded greyscale images. The Fourier transform simply takes the signal from the second spatial- to the frequency-domain; it doesn't scale any of the values. I recommend you temporarily adapt your noise function into something with a predictable frequency distribution (I mean superpositions of harmonic waves). This way, you can determine if the problem lies with the noise generation, the FFT or the plot.

Admiral

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!