Hi,
I'm new in K-Wave, I've been trying the initial value example with the 2-D with the sensor disc. The simulation worked well. I want to make the reconstruction of the the initial pressure distribution.
After setting manually the time array, I add those lines
sensor.time_reversal_boundary_data=sensor_data;
source.p0=0
%run the reverse simulation
p0_recon = kspaceFirstOrder2D(kgrid, medium, source, sensor);
So far, it works. They suggested to add noise and change the computational grid:
noise_ratio=2.0;
for i=1:num_sensor_points
sensor_data(i,:)=addNoise(sensor_data(i,:),noise_ratio);
end
It's still okay but when it goes to the grid change, it doesn't work. The interpolation works, but not the reverse simulation : I used
Nx_recon=100;
Ny_recon=100;
dx_recon=dx*Nx/Nx_recon;
dy_recon=dy*Ny/Ny_recon;
kgrid_recon=makeGrid(Nx_recon,dx_recon,Ny_recon,dy_recon);
%interpolation of the different k-grids
sensor_radius_grid_points = round(sensor_radius/kgrid_recon.dx);
binary_sensor_mask = makeCircle(kgrid_recon.Nx, kgrid_recon.Ny, kgrid_recon.Nx/2, kgrid_recon.Ny/2, sensor_radius_grid_points);
source.p0=0;
sensor.time_reversal_boundary_data = interpCartData(kgrid_recon, sensor_data, sensor.mask, binary_sensor_mask);
p0_recon = kspaceFirstOrder2D(kgrid_recon, medium, source, sensor);
and I got these errors
Error in kspaceFirstOrder_inputChecking (line 628)
sensor.time_reversal_boundary_data(:, new_col_pos) = order_index;
Error in kspaceFirstOrder2D (line 496)
kspaceFirstOrder_inputChecking;
Error in changeGridKwave (line 80)
p0_recon = kspaceFirstOrder2D(kgrid_recon, medium, source, sensor);
So if someone has a solution, thanks :)