layerasa()
Description: This function uses the Angular Spectrum Approach to perform calculations in layered media.
Usage
pressure = layerasa(p0, z, medium, nfft, delta, f0);
Arguments
- p0 matrix of size [nx,ny], input pressure or velocity source.
- z vector, location of destination planes.
- medium A layered medium struct constructed with set_layered_medium.
- nfft Number of FFT terms to use in the calculation. Must be greater than the largest dimensions of the input pressure matrix. See notes for details on choosing this value.
- delta scalar, spatial sampling interval in meters.
- f0 Excitation frequency of the source wave.
Output Parameters
- pressure matrix of size [ nx ny nz ], calculated pressure.
Notes
This function is currently in a testing
phase and the results it computes have not been fully validated. If you encounter any calculation errors or other problems when using this function, please contact the development team so we can work on rectifying the problem.
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.

