|
楼主 |
发表于 2008-8-27 21:13
|
显示全部楼层
回复 板凳 S0704082 的帖子
请各位检查一下我的NAH仿真结果有没有错误,感觉幅值不对
点声源频率100HZ,L=2,N=32,全息面距离点声源0.1m,点声源位于(-0.5,0,0)点和(0.5,0,0)点,点声源半径0.001m,质点振速2.5m/s,图一为全息面上的声压和相位,图二为重建源面的声压和相位
clear
f1=300;
f2=300;
c0=340;
p0=1.25;
w1=2*pi*f1;
w2=2*pi*f2;
k1=2*pi*f1/c0;
k2=2*pi*f2/c0;
x1=-0.5;y1=0;
x2=0.5;y2=0;
lx=2;
ly=2;
N=16;
zh=0.1;
m=0:N-1;
n=0:N-1;
dx=lx/N;
dy=ly/N;
x=(m-N/2)*dx;
y=(n-N/2)*dy;
[X,Y]=meshgrid(x,y);
r1=sqrt((X-x1).^2+(Y-y1).^2+zh^2);
r2=sqrt((X-x2).^2+(Y-y2).^2+zh^2);
r0=0.001;
ua=2.5;
Q0=4*pi*r0.^2*ua;
ff1=exp(-j*k1*r1);
ff2=exp(-j*k2*r2);
p1=j*k1*p0*c0*Q0*ff1./(4*pi*r1);
p2=j*k2*p0*c0*Q0*ff2./(4*pi*r2);
p=p1+p2;
figure(1)
subplot(211)
meshc(X,Y,abs(p));
shading interp
colormap
subplot(212)
mesh(X,Y,angle(p));
shading interp
colormap
Y1=fft2(p);
YY=fftshift(Y1);
%mesh(X,Y,YY)
%shading interp
q=0:N-1;
s=0:N-1;
Kx=q*2*pi/lx;
Ky=s*2*pi/ly;
[kx,ky]=meshgrid(Kx,Ky);
rr1=kx.^2+ky.^2-k1.^2;
rr2=kx.^2+ky.^2-k2^2;
R01=sqrt(k1.^2-kx.^2-ky.^2);
Gd1=exp(j*(zh-0)*R01).*(rr1<=0);
R01=sqrt(kx.^2+ky.^2-k1.^2);
Gd2=sqrt(-2*pi*(zh-0)*R01).*(rr1>0);
Gd=Gd1+Gd2;
Gdd=1./(Gd);
ZZ=YY.*Gdd;
pp=ifft2(ZZ);
p0=pp;
figure(2)
subplot(211)
mesh(X,Y,abs(p0));
shading interp
colormap
subplot(212)
mesh(X,Y,angle(p0)*180/pi)
shading interp
colormap
[ 本帖最后由 S0704082 于 2008-8-27 21:27 编辑 ] |
-
-
|