I have a gray scale image produced by an optical photon simulation and I am trying to find the DC gain of the image using Matlab. For that, I simulate a slant edge image in the simulation where N number of photons are incident on the optical plate.

I use the edge image to find the line spread function of the edge by taking the first derivative of the edge spread function (LSF=diff(ESF)). Then I use the Matlab FFT function to find the DC gain at frequency = 0.

I am not sure if this method is correct or not. How do I correctly find the DC gain in my image?.

  • 1
    $\begingroup$ The FFT at frequency = 0 is just the mean times the number of samples in the FFT, so couldn't you just take the mean? $\endgroup$ – Dan Boschen Mar 19 '17 at 22:54
  • $\begingroup$ Yes, I can do that but am I getting the DC gain of the image or it's DC value?. Here I have tried to implement the transfer function method where the DC gain is obtained when the frequency tends to 0. $\endgroup$ – dykes Mar 20 '17 at 8:30
  • $\begingroup$ I don't really know what the "DC gain of the image" really means; but if you find your answer is the FFT bin 0 value (or proportional to it) my point was that value is just the mean of the waveform that you took the FFT of (mean * N where N is the number of samples). Do you need to take the FFT for other reasons. Not sure if that helps you.... $\endgroup$ – Dan Boschen Mar 20 '17 at 12:54
  • $\begingroup$ I get your point. I can take the mean of the LSF which would give me the DC gain. I am doing FFT to be sure and also to compare it from the two-dimensional FFT of the image. $\endgroup$ – dykes Mar 20 '17 at 15:21
  • $\begingroup$ Ok if that is a valid answer i will add below $\endgroup$ – Dan Boschen Mar 20 '17 at 15:28

The 0 FFT bin "DC Value" is equal to the mean of the signal scaled by the number of samples in the FFT. So a more direct method to compute the DC value is to compute the mean value of the signal directly.

$$FFT_{bin0} =\sum_{n=0}^{N-1}x_n = N\overline x$$


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.