1
$\begingroup$

Previously I asked this question about FFT artifacts.

The solution that is most easily implemented is using an apodizing mask on the original image, tapering the borders to zero making the image left-right and top-bottom continuous.

The rest of the question is best illustrated with a series of pictures. First, we have the original image:

Original image

Now, we apply the cosine-tapered apodizing mask:

enter image description here

Note that we use this mask to do operations in Fourier Space on the second image; to get the power spectrum we will have to use a similar mask again but this is applied to both images so that is not the issue here. (i find it difficult to phrase this properly; please place a comment if you want me to elaborate).

So, now we use a FFT on the second image. In Fourier space we may do things with the image, but to trace our steps and see if the machinery works, we leave it be and just use the inverse-FFT back to real space.

Back in real space, we take the part of the image that was not tapered (so, the inner square) and obtain:

enter image description here

Now, for both the first and the third image I now want to find the power spectrum. In essence, this comes down to (1) using an apodizing mask again, (2) transforming to fourier space once more, and (3) taking the azimuthal average as a function of radius.

As a last subtelty, the power spectrum of the third image is multiplied by a factor $(N_1 / N_3)^2$, where $N_1$ is the number of pixels per side of the first image and $N_3$ the number of pixels per side of the third image. This factor is there to correct for the normalization $1/N$ in the definition of the FFT in numpy.

Doing all this, we obtain the following power spectra:

enter image description here

Clearly, the power spectrum of the third image (in red) has lost power with respect to the power spectrum of the original, first image (in blue). What is the cause of this and can it be compensated for? Or will I have to rely on more elaborate solutions than an apodizing mask (as given here) to not lose this power?

$\endgroup$
4
  • $\begingroup$ Did you scale the power by the area under the 2D window function? $\endgroup$ – hotpaw2 Sep 29 '15 at 17:51
  • $\begingroup$ If I understand you correctly, this is encapsulated in this: "As a last subtelty, the power spectrum of the third image is multiplied by a factor (N_1 / N_3)^2, where N_1 is the number of pixels per side of the first image and N_3 the number of pixels per side of the third image. This factor is there to correct for the normalization 1/N in the definition of the FFT in numpy." So yes, I believe I correct for that. $\endgroup$ – user1991 Sep 29 '15 at 17:57
  • $\begingroup$ That's the size of your window. You may also need to use the area under your window, where the input to the integral goes to zero near the edges. $\endgroup$ – hotpaw2 Sep 29 '15 at 18:00
  • $\begingroup$ That'd be another factor of (N_1/N_3)^2, if i'm not mistaken, and that'd mean the red line is well above the blue one. $\endgroup$ – user1991 Sep 30 '15 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.