필터 지우기
필터 지우기

Create 2D radial symmetric matrix from radius vector

조회 수: 9 (최근 30일)
Przemyslaw Gontar
Przemyslaw Gontar 2018년 2월 9일
답변: Matt 2018년 2월 10일
Hello, I have a following problem. I calculate intensity distribution Bessel-Gauss beam using Hankel transform. Input variables
f = 10000;
a = 10;
ff = 3.2;
w0 = ff * a;
lambda = 10^(-6);
k = 2 * pi / lambda;
N = 100;
rmax = 1.8 * lambda * f / a;
# observation plane
x1 = linspace(-rmax,rmax,N);
y1 = linspace(-rmax,rmax,N);
[U,V] = meshgrid(x1,y1);
W = sqrt(U.^2 + V.^2);
# aperture plane
xx = linspace(-a,a,N);
yy = linspace(-a,a,N);
[X,Y] = meshgrid(xx,yy);
R = sqrt(X.^2 + Y.^2);
Hankel transform:
A2 = zeros(N);
for i = 1:N
for j = 1:N
fun = besselj(0,k/f * W(i,j) * R) .* R .* exp(-(R/w0).^2);
A2(i,j) = trapz(y1,trapz(x1,fun));
end
end
A2 = abs(A2).^2;
imagesc(A2);
Output:
This method takes about 100 sec using N = 100. So for much beter resolution calculating takes a much more time. So I think that beter solution will be using 1D intensity distribution radius vector and create 2D matrix rotate in relation to the center. I dont find solution for that, so i created intensity distribution diameter vector and then i can use A' * A what i find in Matlab Answers. Need to change range from -a:a to 0:a and this same in rmax case. Code:
A = zeros(1,N);
for i = 1:N
fun = besselj(0,k/f * x1(i) * xx) .* xx .* exp(-(xx/w0).^2);
A(i) = trapz(fun);
end
A = [fliplr(A(2:end)) A];
A = abs(A).^2;
Output:
Using A = A' * A /2 I received:
My question: There is any option to improve radial symmetry in output image or maybe there is different method to create 2D matrix from vector?

답변 (1개)

Matt
Matt 2018년 2월 10일
Hey! Just a thought... Does resizing the figure window help?

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by