首页->【超声成像实验室】

5 1

% frbeamptn='C:\Users\pc\Desktop\Busound\Usound\Matlab_usage\signal_1m.txt';
% fbeamptn='C:\Users\pc\Desktop\Busound\Usound\Matlab_usage\bmpt.txt';
%  Procedure for calculating the received signal from a collection of scatterers.
%
%  Calling:  [scat, start_time] = calc_scat(Th1, Th2, points, amplitudes);
%
%  Parameters:  Th1        - Pointer to the transmit aperture.  
%               Th2        - Pointer to the receive aperture.  
%               points     - Scatterers. Vector with three columns (x,y,z)
%                            and one row for each scatterer.
%               amplitudes - Scattering amplitudes. Row vector with one
%                            entry for each scatterer.
%
%  Return:      scat       - Received voltage trace.
%               start_time - The time for the first sample in scat.
%
%  Version 1.0, November 28, 1995 by Joergen Arendt Jensen
N=16;                           % Number of
f0=6.6e6;
c=1540;%mm/ms
k0=2*pi*f0/c;
lamda=c/f0;
d=0.5/1000;                       
[windout] = ui_windows_func(N);
Amp=0;
cnt=1;
col=200;
y_das=zeros(1,200);
y_dashan=zeros(1,200);
y_dasham=zeros(1,200);
y_dasblk=zeros(1,200);
y_daskai=zeros(1,200);
P=N-1;
for n=1:N
   cnt=1;
   for sita=-pi/18:pi/1795:pi/18       
        Amp(1,cnt)=(windout(1,n))*exp(-1i*k0*d*(n-1)*sin(sita));  %  Amp of UltraSound  noWin
        Amphan(1,cnt)=(windout(2,n))*exp(-1i*k0*d*(n-1)*sin(sita));  %  Amp of UltraSound  han
        Ampham(1,cnt)=(windout(3,n))*exp(-1i*k0*d*(n-1)*sin(sita));  %  Amp of UltraSound  ham
        Ampblk(1,cnt)=(windout(4,n))*exp(-1i*k0*d*(n-1)*sin(sita));  %  Amp of UltraSound  blk
        Ampkai(1,cnt)=(windout(5,n))*exp(-1i*k0*d*(n-1)*sin(sita));  %  Amp of UltraSound  blk
        cnt=cnt+1;
   end
   y_das=y_das+Amp;  
   y_dashan=y_dashan+Amphan;
   y_dasham=y_dasham+Ampham;
   y_dasblk=y_dasblk+Ampblk;
   y_daskai=y_daskai+Ampkai;
end
wdas=[y_das;y_dashan;y_dasham;y_dasblk;y_daskai];
y_wdas=abs(wdas);
ymax=max(y_wdas);
[row,~]=size(wdas);
for cnt=1:row
    ymax=max(y_wdas(cnt,:));
    y_wdas(cnt,:)=20*log(y_wdas(cnt,:)/ymax);
end
sita=(-pi/18:pi/1795:pi/18)*(180/pi) ;
plot(sita,y_wdas(1,:),'b',...
     sita,y_wdas(2,:),'b-s',...
     sita,y_wdas(3,:),'r:',...
     sita,y_wdas(4,:),'r--',...
     sita,y_wdas(5,:),'r-o','LineWidth',2),...
     xlabel('Angel [°]','FontSize',12,'FontWeight','bold'),...
     ylabel('Normalized Magnitude[dB]','FontSize',12,'FontWeight','bold');
legend('rectangular','hannning','hamming','blackman','kaiser-4.5');
set(gca,'XLim',[-10 10]);%X轴的数据显示范围
set(gca,'YLim',[-100   0]);%设置要显示坐标刻度
grid on;

程序运行结果如图:

TIM截图20180421203640.png

楼主可见

  1. shwnyoo 1#

    matlab 下 不同窗函数下16阵元波束形成beam pattern  例程 ,仅供参考