%% General parameters %%%

dx=0.05; % mm
Vmax=4.0; % mm/us
alpha=0.99;
dt=alpha*dx/(sqrt(2)*Vmax);% µs

%% Building map  %%%

N1=400;
N2=800;
interface_position=201;
map=repmat(uint8(0),[N1 N2]);
map(interface_position:end,:)=uint8(1);
SimSonic2DWriteMap2D(map);

%% Building signal  %%%

f0=1.0; % central frequency, MHz
t0=1.5; % pulse center time
bndwdth=1.5; % pulse -6dB bandwidth
duration=2*t0; % signal length

timebase=(0:round(duration/dt)-1)'*dt;
[signalI,signalQ]=gauspuls(timebase-t0,f0,bndwdth);signal=signalQ;
signal=signal/max(signal);

SimSonic2DWriteSgl(signal)

%% check 
figure(1)
imagesc(map)
axis image

figure(2)
plot(timebase,signal,'.-')
title('source signal')
xlabel('time (µs)')
 