kWave
A MATLAB toolbox for the timedomain
simulation of acoustic wave fields
 Getting Started
 Examples
 Initial Value Problems
 Example: Homogenous Propagation Medium
 Example: Using A Binary Sensor Mask
 Example: Defining A Sensor Mask By Opposing Corners
 Example: Loading External Image Maps
 Example: Heterogeneous Propagation Medium
 Example: Saving Movie Files
 Example: Recording The Particle Velocity
 Example: Defining A Gaussian Sensor Frequency Response
 Example: Comparison Of Modelling Functions
 Example: Setting An Initial Pressure Gradient
 Example: Simulations In One Dimension
 Example: Simulations In Three Dimensions
 Example: Photoacoustic Waveforms in 1D, 2D and 3D
 Time Varying Source Problems
 Example: Monopole Point Source In A Homogeneous Propagation Medium
 Example: Dipole Point Source In A Homogeneous Propagation Medium
 Example: Simulating Transducer Field Patterns
 Example: Steering A Linear Array
 Example: Snell's Law And Critical Angle Reflection
 Example: The Doppler Effect
 Example: Diffraction Through A Slit
 Example: Simulations In ThreeDimensions
 Sensor Directivity
 Example: Focussed Detector in 2D
 Example: Focussed Detector in 3D
 Example: Modelling Sensor Directivity in 2D
 Example: Modelling Sensor Directivity in 3D
 Example: Sensor Element Directivity in 2D
 Example: Focussed 2D Array with Directional Elements
 Photoacoustic Image Reconstruction
 Example: 2D FFT Reconstruction For A Line Sensor
 Example: 3D FFT Reconstruction For A Planar Sensor
 Example: 2D Time Reversal For A Line Sensor
 Example: 2D Time Reversal For A Circular Sensor
 Example: 3D Time Reversal For A Planar Sensor
 Example: 3D Time Reversal For A Spherical Sensor
 Example: Image Reconstruction With Directional Sensors
 Example: Image Reconstruction With Bandlimited Sensors
 Example: Iterative Image Improvement Using Time Reversal
 Example: Attenuation Compensation Using Time Reversal
 Example: Attenuation Compensation Using Time Variant Filtering
 Example: Automatic Sound Speed Selection
 Diagnostic Ultrasound Simulation
 Example: Defining An Ultrasound Transducer
 Example: Simulating Ultrasound Beam Patterns
 Example: Using An Ultrasound Transducer As A Sensor
 Example: Simulating Bmode Ultrasound Images
 Example: Simulating Bmode Images Using A Phased Array
 Numerical Analysis
 Example: Controlling The Absorbing Boundary Layer
 Example: Source Smoothing
 Example: Filtering A Delta Function Input Signal
 Example: Modelling Power Law Absorption
 Example: Modelling Nonlinear Wave Propagation
 Example: Optimising kWave Performance
 Using The C++ Code
 Elastic Wave Propagation
 Example: Explosive Source In A Layered Medium
 Example: Plane Wave Absorption
 Example: Shear Waves And Critical Angle Reflection
 Example: Simulations In Three Dimensions
 Functions  By Category
 Functions  Alphabetical List
 Release Notes
 License
kWave Toolbox 
kspacePlaneRecon
3D planar FFT reconstruction
Syntax
p_xyz = kspacePlaneRecon(p_tyz, dy, dz, dt, c) p_xyz = kspacePlaneRecon(p_tyz, dy, dz, dt, c, ...)
Description
kspacePlaneRecon
takes an acoustic pressure timeseries p_tyz
recorded over an uniform array of sensor points on a plane, and constructs an estimate of the initial acoustic pressure distribution that gave rise to those measurements using an algorithm based on the FFT. The input p_tyz
must be indexed p_tyz(time step, sensor y position, sensor z position)
, where the sensor spacing is given by dy
and dz
, the temporal spacing given by dt
, and the sound speed in the propagation medium (which is assumed to be acoustically homogeneous) is given by c
. The output p_xyz
is indexed as p_xyz(x position, y position, z position)
.
The code uses a kspace algorithm which performs (1) a Fourier transform on the data p_tyz
along both t
, y
, and z
dimensions (into wavenumberfrequency space), (2) a mapping, based on the dispersion relation for a plane wave in an acoustically homogeneous medium, from wavenumberfrequency space to wavenumberwavenumber space, and finally (3) an inverse Fourier transform back from the wavenumber domain to the spatial domain. The result is an estimate of the initial acoustic pressure distribution from which the acoustic waves originated.
Steps (1) and (3) can be performed efficiently using the fast Fourier transform (FFT); they are therefore fastest when the number of samples and number of detector points are both powers of 2. The mapping in step (2) requires an interpolation of the data from an evenly spaced grid of points in the wavenumberfrequency domain to an evenlyspaced grid of points in the wavenumberwavenumber domain. The option 'Interp'
may be used to choose the interpolation method.
The physics of photoacoustics requires that the acoustic pressure is initially nonnegative everywhere. The estimate of the initial pressure distribution generated by this code may have negative regions due to artefacts arising from differences between the assumed model and the real situation, e.g., homogeneous medium vs. real, somewhat heterogeneous, medium; infinite measurement surface vs. finitesized regionofdetection, etc. A positivity (or nonnegativity) condition can be enforced by setting the optional 'PosCond'
to true
which simply sets any negative parts of the final image to zero.
Inputs

pressure timeseries recorded over a uniform array of sensor points in a plane (indexed as t, y, z) 

spatial step [m] 

time step [s] 

acousticallyhomogeneous sound speed [m/s] 
Optional Inputs
Optional 'string', value pairs that may be used to modify the default computational settings.
Input  Valid Settings  Default  Description 




String input which sets the order of the input data. 

(string of interpolation type) 

String input controlling the interpolation method used by 

(boolean literal) 

Boolean controlling whether a plot of the reconstructed estimate of the initial acoustic pressure distribution is produced. 

(boolean literal) 

Boolean controlling whether a positivity condition is enforced on the reconstructed estimate of the initial acoustic pressure distribution. 
Outputs

estimate of the initial acoustic pressure distribution (indexed as x, y, z) 
Examples
See Also
interp3
, kspaceLineRecon
, makeGrid
kspaceLineRecon  kspaceSecondOrder 
© 20092014 Bradley Treeby and Ben Cox.