# Finding DC gain of a signal

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?.

• 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? Mar 19, 2017 at 22:54
• 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. Mar 20, 2017 at 8:30
• 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.... Mar 20, 2017 at 12:54
• 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. Mar 20, 2017 at 15:21
• Ok if that is a valid answer i will add below Mar 20, 2017 at 15:28

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