k-Wave Toolbox |
![]() ![]() |
Fast time-domain simulation of wave propagation for homogeneous media
sensor_data = kspaceSecondOrder(kgrid, medium, source, sensor) sensor_data = kspaceSecondOrder(kgrid, medium, source, sensor, ...) [sensor_data, field_data] = kspaceSecondOrder(kgrid, medium, source, sensor) [sensor_data, field_data] = kspaceSecondOrder(kgrid, medium, source, sensor, ...)
kspaceSecondOrder
simulates the time-domain propagation of linear compressional waves through a one, two, or three dimensional homogeneous acoustic medium given four input structures: kgrid
, medium
, source
, and sensor
.
The computation is based on an exact second-order k-space model for media with power law absorption.
At each time-step (defined by kgrid.t_array
), the pressure at the positions defined by sensor.mask
are recorded and stored.
If kgrid.t_array
is set to 'auto'
, this array is automatically generated using makeTime
. To prevent wave wrapping, the computational domain can be automatically expanded by a factor of two by setting the optional input 'ExpandGrid'
to true
.
An initial pressure distribution can be specified by assigning a matrix (the same size as the computational grid) of arbitrary numeric values to source.p0
.
An initial pressure gradient can similarly be specified using source.dp0dt
. The pressure is returned as an array of time series at the sensor locations defined by sensor.mask
.
This is specified as a binary grid (i.e., a matrix of 1's and 0's the same size as the computational grid) representing the pixels within the computational grid that will collect the data.
The sensor_data
is returned using MATLAB's standard column-wise linear matrix index ordering with the recorded data indexed as sensor_data(sensor_position, time)
.
The final pressure field over the complete computational grid can also be obtained using the output field_data
.
Compared to the first-order simulation functions kspaceFirstOrder1D
, kspaceFirstOrder2D
, and kspaceFirstOrder3D
, kspaceSecondOrder
is restricted to homogeneous media and has less functionality. However, it is also more computationally efficient and allows an initial pressure gradient to be specified.
|
k-Wave grid structure returned by |
|
evenly spaced array of time values [s] (set to |
  |
  |
|
homogeneous sound speed within the acoustic medium [m/s] |
|
power law absorption exponent |
|
power law absorption coefficient [dB/(MHz^y cm)] |
  |
  |
|
initial pressure within the acoustic medium |
|
initial pressure gradient within the acoustic medium |
  |
  |
|
binary grid specifying where the pressure is recorded at each time-step |
Optional 'string', value pairs that may be used to modify the default computational settings.
Input | Valid Settings | Default | Description |
---|---|---|---|
|
(Boolean scalar) |
|
Boolean controlling whether the grid size is expanded on two sides to delay the time before wave wrapping occurs. |
|
(Boolean scalar) |
|
Boolean controlling whether |
|
(Boolean scalar) |
|
Boolean controlling whether the pressure field for each time step is plotted in a new window. |
|
(integer numeric scalar) |
|
The number of iterations which must pass before the simulation plot is updated. |
|
(numeric two element vector) |
|
[min, max] values used to control the scaling for |
|
(Boolean scalar) |
|
Boolean controlling whether the simulation iterations are progressively plotted. |
|
(Boolean scalar) |
|
Boolean controlling whether |
|
time varying pressure recorded at the sensor positions given by |
|
final pressure field |
kspaceFirstOrder1D
, kspaceFirstOrder2D
, kspaceFirstOrder3D
, makeGrid
, makeTime
, smooth
![]() |
kspacePlaneRecon | loadImage | ![]() |
© 2009-2012 Bradley Treeby and Ben Cox.