Author Topic: Fast Fourier Transform  (Read 7052 times)

Offline Astrocava

  • PixInsight Addict
  • ***
  • Posts: 180
    • Astrocava.com
Fast Fourier Transform
« on: 2011 February 16 12:28:05 »
Hi all!

Was reading this in the website of QSI:

http://www.qsimaging.com/ccd_noise_measure.html

And want to try it with my camera, but I've sarched for a FFT process in PI and is ... missing?

Sergio
Moonfish ED80 over a Meade LX200GPS 8"

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Fast Fourier Transform
« Reply #1 on: 2011 February 16 12:37:49 »
I seem to remember it's implemented in PCL but not exposed as a module. You could search the forums as this has come up before. I used AIP4WIN to do the FFT on my images after seen Kevin Nelson at MWAIC '10.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Philip de Louraille

  • PixInsight Addict
  • ***
  • Posts: 289
Re: Fast Fourier Transform
« Reply #2 on: 2011 February 16 12:48:58 »
If the goal is to detect the dominant frequencies in some datasets then a FFT tool is quite useful.
If the goal is then to use that knowledge to remove some frequencies then a FFT (and its inverse) are not that useful because that technique will not differentiate frequencies found in noise from that found in coherent signals.
Philip de Louraille

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Fast Fourier Transform
« Reply #3 on: 2011 February 16 16:13:33 »
Hi Sergio,

That's very easy to implement with a little script:

Code: [Select]
#include <pjsr/UndoFlag.jsh>

/*
 * Active view
 */
var window = ImageWindow.activeWindow;
if ( window.isNull )
   throw new Error( "There is no active image window." );
var view = window.currentView;

/*
 * DFT of the active view image
 */
var C = Image.newComplexImage();
C.assign( view.image );
C.FFT( true ); // center DFT

/*
 * Modulus (absolute value) of the DFT as a new image window
 */
var window = new ImageWindow( 1, 1, 1, 32, true );
var view = window.mainView;
view.beginProcess( UndoFlag_NoSwapFile ); // do not generate any swap file
view.image.assign( C );
view.image.rescale();
view.endProcess();
window.show();
window.zoomToFit();

Just select the image you want (including any preview) and run the script. It will compute the discrete Fourier transform (DFT) of the image and will provide its absolute value as a new image window. In most cases you'll have to apply automatic STF stretch to the DFT in order to view something useful. DFTs are computed with central symmetry (the DC component is at the center of the transform matrix).

Enjoy! :)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Philip de Louraille

  • PixInsight Addict
  • ***
  • Posts: 289
Re: Fast Fourier Transform
« Reply #4 on: 2011 February 16 22:36:42 »
Cool! Thanks Juan!
Philip de Louraille

Offline Astrocava

  • PixInsight Addict
  • ***
  • Posts: 180
    • Astrocava.com
Re: Fast Fourier Transform
« Reply #5 on: 2011 February 17 00:08:52 »
Thanks Juan for the code!  ;)

Well, this is the result of the SCRIPT to a single BIAS MasterBIAS substracted. There is a lot non random noise there. As the QSI web site states, will be it impossible to removal by combining multiple images? But can be removed by BIAS substraction?

btw, nice pattern. :laugh:
Moonfish ED80 over a Meade LX200GPS 8"

Offline Astrocava

  • PixInsight Addict
  • ***
  • Posts: 180
    • Astrocava.com
Re: Fast Fourier Transform
« Reply #6 on: 2011 February 19 03:18:43 »
Sorry for the up. Any idea?

Sergio
Moonfish ED80 over a Meade LX200GPS 8"

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: Fast Fourier Transform
« Reply #7 on: 2011 February 19 05:14:29 »
I don't follow... why do you want to substract a bias from a bias?
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: Fast Fourier Transform
« Reply #8 on: 2011 February 20 10:27:27 »
Well, I guess what you try to do is the procedure described at Iris' manual pages , http://www.astrosurf.com/buil/iris/new410/new410_us.htm, scroll down to "Fixed pattern noise removal". I was also looking for something similar last summer but never had the time to really implement it (I started a script with Juan's guidance, but never finished it).
 
(BTW it will be a great tool IMHO if ever been implemented into Pix - and should not be difficult. All functions are there, just somebody knowing how to combine them ;) )

But, I do not understand why you need it. Your FFT is not a single dot,  but rarely is. The pattern you have is almost textbook. Look at Iris' page above to see which patterns you should worry about. IMHO any residual fixed pattern from your camera will never be visible with proper calibration (you should see what my camera produces, horror !! )

Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Fast Fourier Transform
« Reply #9 on: 2011 February 21 02:37:00 »
Quote
which patterns you should worry about.

The DFT you've got does not show periodic features that you should worry about IMO. It shows patterns corresponding to dominant orientations of significant structures in the image.

What you are looking for are features well localized on the Fourier transform space. Think of the Fourier transform matrix as if it was a 'normal' image: you're looking for relatively small, bright and isolated features, because they are easy to identify and remove with a 'point and shoot' procedure (known as notch filters speaking more technically). For example, an isolated feature on two/four quadrants of the (centered) Fourier transform matrix denotes a periodic pattern, such as the typical interference pattern, which is very easy to remove working in the Fourier domain. The frequency of the pattern is a function of the distance to the center of the matrix. There are no such features easily identifiable in the DFT of your bias frame.

Quote
BTW it will be a great tool IMHO if ever been implemented into Pix - and should not be difficult. All functions are there, just somebody knowing how to combine them Wink

Indeed it wouldn't be difficult —although the required user interface is not trivial if it is well implemented—, but there are other priorities. A Fourier transform tool is very nice and interesting from an academic point of view (and it's the kind of things I love to write :)), but it would find little practical use in astrophotography —correct me if I'm wrong.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Ioannis Ioannou

  • PixInsight Addict
  • ***
  • Posts: 202
Re: Fast Fourier Transform
« Reply #10 on: 2011 February 21 02:45:18 »
A Fourier transform tool is very nice and interesting from an academic point of view (and it's the kind of things I love to write :)), but it would find little practical use in astrophotography —correct me if I'm wrong.

Not with my camera when you want to bring out every tiny bit of detail  ;D
I'm dealing with the noise from these patterns with ACDNR (and it does a pretty good job), but I'm loosing information also.
But indeed, the QSI in question is clean, no need for it.
Clear Skies
John (Ioannis)

FSQ106N+Robofocus+QHY-22+SX USB wheel+Baader filters
SX OAG+DSI Pro guiding a NEQ6
PI for the rest :)

Offline Astrocava

  • PixInsight Addict
  • ***
  • Posts: 180
    • Astrocava.com
Re: Fast Fourier Transform
« Reply #11 on: 2011 February 22 06:46:56 »
Thanks all for the input!

Have fun!

S-
Moonfish ED80 over a Meade LX200GPS 8"