Hello !
When I used a large transducer or/and when I simulated a large range of steering angles, I have always observed an x-upward shift on the reconstructed image compared to real medium (you can see here that the cylinder appears between 56.5 and 63.5mm instead of between 54.5 and 61.5mm : https://www.casimages.com/i/181004035409747281.png.html). For the reconstruction, I use "transducer.combine_sensor_data" (I use the C++ code on GPU so this stage is necessary) then "transducer.scan_line" and then your code "example_us_bmode_phased_array" starting from the line "t0_offset = round(length(input_signal) / 2) + (transducer.appended_zeros - transducer.beamforming_delays_offset);".
After a lot of research, I observed that the output of combine_sensor_data has a significant negative temporal offset compared to the input (for example, the transducer_input_signal starts before in the output compared to the input). With an analyse of the source code, I find that, in line 908 (of kWaveTransducer.m), you use transducer.delays_mask(2) to obtain the elevation_delays. But, in transducer.delays_mask(2), there is also the transducer.beamforming_delays_offset. Because of that, in line 913, you apply again the transducer.beamforming_delays_offset to sensor_data... And this temporal offset causes the spatial offset observed in the images.
There are 2 solutions to fix this, either change the line "t0_offset = round(length(input_signal) / 2) + (transducer.appended_zeros - transducer.beamforming_delays_offset)" to "t0_offset = round(length(input_signal) / 2) + (transducer.appended_zeros - 2*transducer.beamforming_delays_offset)" in post-processing or change the source code kWaveTransducer.m line 609 "dm = obj.delay_mask(2)" => "dm = obj.delay_mask(2)-obj.beamforming_delays_offset".
Since this change, I have always observed the objects at the well depth (e.g : the same simulation with the correction https://www.casimages.com/i/18100403550733177.png.html).
So, my question is, Do you think my analyse is correct or I misunderstand something and the x-upward shift comes from an other thing ?
I thank you in advance for your answer.
Best regards,
Alexandre