Hi,
I am new in k-Wave. And in my TR reconstruction, there are two steps.
At the first step, I have two sources and a scatter in a waveguide. The sound spped and density of the scatter are both 2000. After running the codes,I got sensor_data from Receivers.
Codes of the first step are followings:
'H=120;
pml_size=16;
Nz=801-2*pml_size;
Nx=801-2*pml_size;
dz=0.25;
dx=0.25;
kgrid=kWaveGrid(Nz,dz,Nx,dx);
%Medium
medium.sound_speed=343*ones(Nz,Nx);
for i=8:(H/dz)+8
medium.sound_speed(i+1,:)=1520-i/16;
end
medium.sound_speed(H/dz+10:end,:)=1800;
medium.sound_speed(60/dz+1:100/dz+1,120/dx+1:140/dx+1)=2000; %scatter
medium.density=ones(Nz,Nx);
medium.density(9:H/dz+9,:)=1000;
medium.density(H/dz+10:end,:)=1800;
medium.density(60/dz+1:100/dz+1,120/dx+1:140/dx+1)=2000; %scatter
%Source1
disc_x_pos_1=80/dx+1;
disc_z_pos_1=70/dz+1;
disc_radius_1=4/dx;
disc_mag_1=9;
p1=disc_mag_1*makeDisc(Nz,Nx,disc_z_pos_1,disc_x_pos_1,disc_radius_1);
%Source2
disc_x_pos_2=100/dx+1;
disc_z_pos_2=90/dz+1;
disc_radius_2=2/dx;
disc_mag_2=3;
p2=disc_mag_2*makeDisc(Nz,Nx,disc_z_pos_2,disc_x_pos_2,disc_radius_2);
%Source
source.p0=p1+p2;
%Receivers
mask=zeros(Nz,Nx);
mask((3:4:123)/dz-3,1)=1;
[row,col]=find(mask==1);
sensor.mask=[kgrid.x_vec(row) kgrid.y_vec(col)].';
input_args={'PMLInside',false,'PMLSize',pml_size,'Smooth',false,'PlotPML',false,'PlotSim',false,'RecordMovie',true};
kgrid.makeTime(medium.sound_speed);
sensor_data=kspaceFirstOrder2D(kgrid,medium,source,sensor,input_args{:});'
Then, at the second step,I want to emit the time reversal of sensor_data from Receivers to the same waveguide but without the sources and the scatters. Although codes run without errors, an unexcepted result occurs--the window of the result becomes black. And I have no idea to deal withit.
Codes of the second step are followings:
' H=120;
pml_size=16;
Nz=801-2*pml_size;
Nx=801-2*pml_size;
dz=0.25;
dx=0.25;
kgrid=makeGrid(Nz,dz,Nx,dx);
%介质
medium.sound_speed=343*ones(Nz,Nx);
for i=8:(H/dz)+8
medium.sound_speed(i+1,:)=1520-i/16;
end
medium.sound_speed(H/dz+10:end,:)=1800;
medium.density=ones(Nz,Nx);
medium.density(9:(H/dz+9),:)=1000;
medium.density((H/dz+10):end,:)=1800;
mask=zeros(Nz,Nx);
mask((3:4:123)/dz-3,1)=1;
[row,col]=find(mask==1);
sensor.mask=[kgrid.x_vec(row) kgrid.y_vec(col)].';
sensor.record={'p_final','p'};
input_args={'PMLInside',false,'PMLSize',pml_size,'Smooth',false,'PlotPML',false,'PlotSim',false,'RecordMovie',true};
kgrid.makeTime(medium.sound_speed);
source.p_mask=mask;
source.p=fliplr(sensor_data);
source.p_mode='dirichlet';
test3=kspaceFirstOrder2D(kgrid,medium,source,sensor,input_args{:});'
I have no idea about waht's wrong with my model. Could you please give me some advice?Thank you very much.