cw_angular_spectrum()
Description: This function uses the Angular Spectrum Approach to quickly calculate 3D continuous-wave pressures given an intial pressure field.
Usage
pressure = cw_angular_spectrum(p0, coord_grid, medium, f0, nfft);
pressure = cw_angular_spectrum(p0, coord_grid, medium, f0, nfft, type);
Arguments
- p0 matrix of size [nx,ny], input pressure (in Pa) or velocity source (in m/s).
- coord_grid A FOCUS coordinate grid describing the dimensions of the output pressure field.
- medium The medium in which this calculation will occur.
- f0 Excitation frequency of the source wave in Hz.
- nfft FFT grid number. Must be greater than the largest dimensions of the input pressure matrix. See notes for details on choosing this value.
- type Selection for different choices of ASA method; default is 'Pa'.
- 'P' Spectral propagator and pressure source without angular restriction.
- 'Pa' Spectral propagator and pressure source with angular restriction. (This is the default)
- 'V' Spectral propagator and velocity source without angular restriction.
- 'Va' Spectral propagator and velocity source with angular restriction.
- 'p' Spatial propagator and pressure source without angular restriction.
- 'v' Spatial propagator and velocity source without angular restriction.
Output Parameters
- pressure matrix of size [ nx ny nz ], calculated pressure.
Notes
To choose the number of FFT terms to use, the simplest method is to zero-pad the source pressure and increase the number of terms until an acceptable error is reached. Numbers of terms that are powers of two (e.g. 512, 1024) usually result in the fastest calculations.