필터 지우기
필터 지우기

How to implement Discrete Integration of the Gaussian Function on a Grid?

조회 수: 7 (최근 30일)
Hi!
I want to implement a physical problem, where the photons are incident on a 2D sensor as a Gaussian Function. I need to find out the number of photons hitting each pixel.
I know the total number of photons incident on the sensor as well as the spread of the Gaussian Function.
I can't use the PDF of a Gaussian Function as its a point value.
Any ideas on how to implement this on Matlab would be extremely helpful.

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2020년 5월 13일
In that case you better integrate your Gaussian (point-spread-function?) over the pixel-areas. You could use something like this:
ph_cnt = @(x,y,x0,y0,sx,sy) integral2(@(u,v) exp(-((u-x0).^2/sx^2)+(v-y0).^2/sy^2^2),x,x+1,y,y+1);
Where x and y are the pixel-indices, x0 and y0 are the centroid of your photon-beam, sx and sy are the horizontal and vertical widths of the beam. You will still have to manage the normalization of the integral to give you the correct total photon-count.
HTH
  댓글 수: 4
Neilabh Banzal
Neilabh Banzal 2020년 5월 13일
Bjorn,
I have to perform the integration on a grid of 1024 x 1280 pixels, for some 20 beams of photons. So, Intnegration would take a lot of time. And I can't vectorise the integration (As far as I know)
I am currently using the PDF value at the midpoint of the pixel. The problem is that most of my sigma spreads are too small for the PDF approximation to be valid.
Thanks for all your inputs. :)
- N
Bjorn Gustavsson
Bjorn Gustavsson 2020년 5월 13일
But if your beams are narrow, you certainly don't need to integrate over the entire 1024x1280 area. If you restrict the integration to an aera around each centre-point your relative error should be on the order of 1-erf(5)^2 or ~3e-12. To detect that small differences would require "very good" accuray for your photon-count.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by