fnm_tsd()
Description: Calculates the transient pressure field from an arbitrary transducer array using the Fast Nearfield Method and Time-Space Decomposition or Frequency Domain Time-Space Decomposition, depending on the input signal.
Usage
pressure = fnm_tsd(transducer_array, coordinate_grid, medium, time_struct, ndiv,excitation_function);
pressure = fnm_tsd(transducer_array, coordinate_grid, medium, time_struct, ndiv,excitation_function,\
disp_flag);
pressure = fnm_tsd(transducer_array, coordinate_grid, medium, time_struct, ndiv,excitation_function,\
disp_flag, num_threads);
pressure = fnm_tsd(transducer_array, coordinate_grid, medium, time_struct, ndiv,excitation_function,\
disp_flag, num_threads, precision_flag);
Arguments
- transducer_array A transducer_array.
- coordinate_grid A coordinate grid struct like the ones created by set_coordinate_grid.
- medium A medium struct like the ones created by set_medium.
- time_struct A time samples struct created by set_time_samples.
- ndiv The number of integral points to use.
- excitation_function An excitation function created by set_excitation_function.
- disp_flag Display flag, 1 = display, 0 = suppress.
- num_threads Number of CPU threads to use in the calculation. Default is 1.
- precision_flag Precision flag, 1 = single precision, 0 = double precision. Default is 0 (double precision).
Output Parameters
- pressure A 3-d array representing the pressure at each point in space.
- start_time A vector containing the start time for the impulse response at each observation point.
Notes
This function only calculates pressures in lossless media, so any attenuation parameter set by the user will be ignored.
Threading in FOCUS is implemented at the transducer level, meaning that single transducers will not benefit from this feature.
Specifying a number of threads larger than the number of CPU cores available will not result in a significant additional speed increase and may in fact result in slower speeds due to additional inter-thread communication overhead.
Single precision calculations use about half as much memory as double precision calculations, so setting the precision flag to 1 can help with simulations that run out of memory.
FDTSD calculations are not as fast as TSD calculations. It is therefore recommended that users use one of the analytical TSD expressions if possible for the greatest speed.

