0
votes

I am trying to get the 1D power histogram of all the frequencies of certain images. I will describe what I have done so far.

  1. Read the image (if neccessary, convert to grayscale)
  2. Calculate the FFT2 and shift it
  3. In the Fourier domain, apply some filters
  4. Retransform to the spatial domain and display (for visual verification that the filter worked)

  5. FFT2 and fftshift that newly created image (optional, I could have used the former ifft2 input as well)

  6. Calculate the power spectrum, i.e. .^2 all the fourier domain values

Now begins the tricky part. For a power histogram I'd have to get all the values of a certain frequency, for all frequencies involved. With a contiuous signal, I'd just integrate from 0 to 2pi for all frequencies, and that's it.

But I cannot integrate with discrete values, at least I think it is wrong. And for an integration from 0 to 2pi, I'd have to sum up all values with a certain distance to the 0th frequency. I cannot to that because then I'd have to determine the distance from the centre, which will fail because the values are located in a square matrix. If I were to sum up the values from a ring of finite width, then I'd have to make sure not to select some values multiple times.

Maybe I'm just thinking in a wrong direction, because I am relatively new to MATLAB. But how can I calculate such power histograms?

Phreak

1

1 Answers

0
votes

This looks like what you need: FEX

Although I am not sure why you wouldn't just use the 2D information.