'% create the computational grid
Nx = 128; % number of grid points in the x (row) direction
Ny = Nx; % number of grid points in the y (column) direction
dx = 50e-3/Nx; % grid point spacing in the x direction [m]
dy = dx; % grid point spacing in the y direction [m]
kgrid = makeGrid(Nx, dx, Ny, dy);
% define the properties of the propagation medium
medium.sound_speed = 1500; % [m/s]
medium.alpha_power = 1.5; % [dB/(MHz^y cm)]
medium.alpha_coeff = 0.75; % [dB/(MHz^y cm)]
medium.density = 1;
% create the time array
[kgrid.t_array, dt] = makeTime(kgrid, medium.sound_speed);
kgrid.t_array = 0:dt:1000*dt;
% define source mask for a linear transducer with an odd number of elements
num_elements = 21; % [grid points]
x_offset = 25; % [grid points]
source.p_mask = zeros(Nx, Ny);
start_index = Ny/2 - round(num_elements/2) + 1;
source.p_mask(x_offset, start_index:start_index + num_elements - 1) = 1;
% define the properties of the tone burst used to drive the transducer
sampling_freq = 1/dt; % [Hz]
steering_angle = 0; % [deg]
element_spacing = dx; % [m]
tone_burst_freq = 1e6; % [Hz]
tone_burst_cycles = 20;
% create an element index relative to the centre element of the transducer
element_index = -(num_elements - 1)/2:(num_elements - 1)/2;
% use geometric beam forming to calculate the tone burst offsets for each
% transducer element based on the element index
tone_burst_offset = 40 + element_spacing*element_index*sin(steering_angle*pi/180)/(medium.sound_speed*dt);
% create the tone burst signals
source.p = toneBurstCopy(sampling_freq, tone_burst_freq, tone_burst_cycles, 'SignalOffset', tone_burst_offset);
% assign the input options
input_args = {'DisplayMask', source.p_mask};
% run the simulation
kspaceFirstOrder2D(kgrid, medium, source, [], input_args{:});
% =========================================================================
% VISUALISATION
% =========================================================================
% plot the input time series
figure;
num_source_time_points = length(source.p(1,:));
[t_sc, scale, prefix] = scaleSI(kgrid.t_array(num_source_time_points));
stackedPlot(kgrid.t_array(1:num_source_time_points)*scale, source.p);
xlabel(['Time [' prefix 's]']);
ylabel('Input Signals');'
I want to simulate a linear transducer being focused towards the center, i.e. inner elements being delayed from the outer elements, resulting in a symmetric input signal plot. I am confused with the syntax of the tone_burst_offset variable. What exactly would be changing to get this desired effect?