k-Wave Toolbox |

# makeTime

Create an evenly spaced array of time points

## Syntax

    [t_array, dt] = makeTime(kgrid, c)
    [t_array, dt] = makeTime(kgrid, c, cfl)
    [t_array, dt] = makeTime(kgrid, c, cfl, t_end)
    [t_array, dt] = makeTime(kgrid, c, [], t_end)

## Description

`makeTime` creates an evenly spaced array of time points for use with the k-Wave simulation codes based on the Courant-Friedrichs-Lewy stability level `cfl` and the grid size. The time-step `dt` is chosen based on the `cfl` level (the default setting is 0.3), and the number of time-steps is chosen based on the time it takes to travel from one corner of the grid specified by `kgrid` to the geometrically opposite corner. Note, if c is given as a matrix, the calculation for `dt` is based on the maximum value, and the calculation for `t_end` based on the minimum value.

## Inputs

`kgrid` | k-Wave grid structure returned by `makeGrid`
`c` | maximum sound speed in the medium [m/s]

## Optional Inputs

`cfl` | Courant-Friedrichs-Lewy stability criterion (default = 0.3)
`t_end` | maximum time [s]

## Outputs

`t_array` | array of evenly spaced time points [s]
`dt` | time step [s]

## Examples

- Recording The Particle Velocity
- Defining A Gaussian Sensor Frequency Response
- Comparison Of Modelling Functions
- Simulations In One Dimension
- Simulating Transducer Field Patterns
- Steering A Linear Array
- Snell's Law And Critical Angle Reflection
- Diffraction Through A Slit
- Focussed Detector in 2D
- Focussed Detector in 3D
- Modelling Sensor Directivity in 3D
- Sensor Element Directivity in 2D
- Focussed 2D Array with Directional Elements
- 2D FFT Reconstruction For A Line Sensor
- 3D FFT Reconstruction For A Planar Sensor
- 2D Time Reversal For A Line Sensor
- 2D Time Reversal For A Circular Sensor
- 3D Time Reversal For A Planar Sensor
- 3D Time Reversal For A Spherical Sensor
- Image Reconstruction With Directional Sensors
- Image Reconstruction With Bandlimited Sensors
- Image Reconstruction With Compensation For Acoustic Absorption
- Filtering A Delta Function Input Signal
- Modelling Power Law Absorption
- Optimising k-Wave Performance

## See Also

`makeGrid`, `kspaceFirstOrder1D`, `kspaceFirstOrder2D`, `kspaceFirstOrder3D`

© 2009-2014 Bradley Treeby and Ben Cox.