Hello,
I have a question regarding how k-wave computes the photoacoustic response for individual dots compared to when the object is a sum of such individual dots.
My simulation setup includes a single element in my sensor.mask placed in the middle of the space defined. I then define 2 objects p01 and p02 both of which are single dots separated in x,y but in the same z-plane. I then generate the PA response of each of these dots and save them. The next object defined is p03 = p01+p02 and once again I generate a PA response for this combined object.
Now my issue is this. When the dots do not share a common edge or corner, the sensor_data_p03 = sensor_data_p01 + sensor_data_p02. But when the two point objects do share a common edge or corner, the waveforms are in the same place in time and have the same shape but the principle of superposition doesn't hold anymore.
When they share a corner, sensor_data_p03 = (sensor_data_p01 + sensor_data_p02)/1.4
When they share an edge, sensor_data_p03 = (sensor_data_p01 + sensor_data_p02)/1.65
I came by these scaling factors purely by trial and error.
Would anyone happen to know why this is the case? Or is the way I'm looking at the PA generation wrong perhaps?
My code is as follows:
%% create computational grid
clear;
Nx = 32;
dx = 1e-3;
Ny = Nx; dy = dx;
Nz = 64; dz = dx;
kgrid = kWaveGrid(Nx,dx,Ny,dy,Nz,dz);
% define the properties of the propagation medium
medium.sound_speed = 1500; % [m/s]
% create the time array
kgrid.makeTime(medium.sound_speed);
% define grid sensor
sensor.mask = zeros([Nx,Ny,Nz]);
sensor.mask(Nx/2+1,Ny/2+1,10) = 1;
% input arguments
input_args = {'DataCast', 'single', 'CartInterp', 'nearest', 'DisplayMask', 'off', ...
'PlotSim', boolean(0)};
% create pressure distributions and get data
p01 = zeros([Nx Ny Nz]);
p01(17,17,50) = 1; % changing this in r,c
source.p0 = p01;
sensor_data_1 = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});
p02 = zeros([Nx Ny Nz]);
p02(17,18,50) = 1; % changing this in r,c
source.p0 = p02;
sensor_data_2 = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});
p03 = p01+p02;
source.p0 = p03;
sensor_data_3 = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});
figure;
plot(sensor_data_3)
hold on
plot(sensor_data_1 + sensor_data_2)
legend('Total obj','Superposition')
Any help would greatly be appreciated!
Thanks