1

In this post, instructions are given to construct a periodogram essentially from scratch. How would one write the inverse function? I want to generate a periodogram, do some manipulations, and then invert it back to 'normal' grayscale space as an approach to filtering the original image, which will help with further analysis. This can be done in imageJ using their built in "FFT" and "inverse FFT" functions. I'd like to do it in Mathematica!

user94773
  • 11
  • 1
  • I mean, can you reconstruct the original image exactly? Since Periodogram computes the square of the Fourier transform (the Fourier spectrum), you are losing some phase information, and so you can't take the inverse. So, you can't use Periodogram. But you can use Fourier and InverseFourier, since those are essentially FFTs in Mathematica. (Or, at least they're discrete Fourier transforms. I assume that they are implemented as fast FT's, but I'm not sure. – march Oct 09 '23 at 18:16
  • Yes, in ImageJ they are FFTs. That's preciely at the the root of my question... how would one do this seeing that the Periodogram function can't be inverted? I'm just starting to learn about using FTs in image analysis... is there some piece of the original Fourier result that could be recalled to reconstruct the image? If so, how might that be implemented? – user94773 Oct 09 '23 at 19:59
  • Do you absolutely need to use Periodogram? Have you looked into Spectrogram and InverseSpectrogram (and the SpectrogramArray forms of these functions) ? Because that would solve the problem for you if you're okay with a short-time-fourier transform rather than the whole time domain. – flinty Oct 09 '23 at 20:08
  • @flinty TBH I'm not really sure how they are different. I am analyzing 2D grayscale images to detect diagonal patterns. The results that appear using Periodogram make it easy to identify the features I'm looking for... essentially two white dots positioned at an angle near the center (with proper thresholding). – user94773 Oct 09 '23 at 22:18
  • 1
    Periodogram is just the absolute square of Fourier, though, so you can just use Fourier instead and take the (log of the) absolute square to visualize it. Then, do whatever manipulations you need to do on the FT's data, then transform back. I guess I'm not sure exactly what the issue is. – march Oct 10 '23 at 03:04

0 Answers0