How do I convolve a periodic rect function with comb function

조회 수: 9 (최근 30일)
Mohammad
Mohammad 2022년 6월 10일
댓글: Mohammad 2022년 6월 10일
p(x,y)=rect(2x/X)rect(2y/Y)⊗[comb(x/X)comb(y/Y)]
  댓글 수: 2
Mohammad
Mohammad 2022년 6월 10일
p(x,y) is defining a periodic function, with period X in the x direction and period Y in the y direction.
Mohammad
Mohammad 2022년 6월 10일
Now I need to plot p (x,y)

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

채택된 답변

Matt J
Matt J 2022년 6월 10일
편집: Matt J 2022년 6월 10일
X=1; Y=2;
rect=@(s) 0<=s & s<=1/2;
r=@(s) rect(mod(s+1/4,1));
[x,y]=meshgrid(-3*X:0.01:+3*X, -3*Y:0.01:+3*Y);
P=r(x/X).*r(y/Y) ;
surf(x,y,P,'EdgeColor','none');
xlabel x, ylabel y, zlabel p(x,y)
axis equal
  댓글 수: 1
Mohammad
Mohammad 2022년 6월 10일
Thanks you so much,
and also what should I do for Fourier transform of p ?

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

추가 답변 (1개)

Matt J
Matt J 2022년 6월 10일
Another possibility is to download interpMatrix
Here is an example with a comb of sincs, rather than a comb of rects.
x=linspace(-3,+3,601); y=x;
kx=sinc( pi*x );
ky=sinc( pi*y*2 );
Ix=sum(interpMatrix(kx,'max',7,100),2);
Iy=sum(interpMatrix(ky,'max',13,50),2);
Name Size Bytes Class Attributes Ix 601x1 9632 double sparse Iy 601x1 9632 double sparse x 1x601 4808 double y 1x601 4808 double
surf(x,y , Ix.*Iy','EdgeColor','none')

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by