k-Wave Toolbox Previous   Next

Heterogeneous Propagation Medium Example

Overview

This example provides a demonstration of using k-wave for the simulation and detection of photoacoustic waves within a two-dimensional heterogeneous propagation medium. It builds on the Homogeneous Propagation Medium Example.

 Back to Top

Defining a heterogeneous medium

For a homogeneous propagation medium, the sound speed (c) and density (rho) are given as scalar values in SI units. If the propagation medium is heterogeneous, c and rho are instead given as matrices with the same size and dimensions as the initial pressure distribution. These matrices can be created in several fashions, including explicity (as given below; note the ordering of the inputs), from external images maps, or using spacial or volume data from other simulations or experimental imaging modalities.

% define the properties of the propagation medium
c0 = 1500;                  % [m/s]
c = c0*ones(Nz, Nx);        % [m/s]
c(1:Nz/2, :) = c0*1.2;

rho0 = 1000;                % [kg/m^3]
rho = rho0*ones(Nz, Nx);    % [kg/m^3]
rho(:, Nx/4:end) = rho0*1.2;

 Back to Top

Running the simulation

The computation is again invoked by running kspaceFirstOrder2D with the inputs defined above. Rather than explicity producing a plot of the initial pressure distribution, sensor mask, and medium properties, it is easier to use the inbuilt functionality of kspaceFirstOrder2D by setting the optional input 'PlotLayout' to true (optional inputs for are given as 'string', value pairs). This produces a plot of the simulation inputs as shown below.

% run the simulation
sensor_data = kspaceFirstOrder2D(p0, kgrid, c, rho, 'auto', sensor_mask, 'PlotLayout', true);

A plot of the recorded time series is given below. The shape of the main wave-front has been perturbed compared to the homogeneous example, and weak reflections from the heterogeneous interfaces can also be seen.

 Back to Top


© 2009 Bradley Treeby and Ben Cox.