Simple MATLAB and CUDA implementations of the frequency-dependent F-number for coherent plane-wave compounding [1], [2], line-by-line scanning [3], and synthetic aperture imaging [4].
The F-number is a user-defined parameter of a technique known as "dynamic aperture". This technique reduces image artifacts in image formation methods that use the delay-and-sum (DAS) algorithm to focus echo signals. Such methods include
The term "aperture" denotes the set of array elements that contribute to the focusing. The dynamic aperture varies with the focus and, for any given focus, seeks to achieve two properties:
-
Centering on the lateral focal position. The left and right bounds have equal distance from the lateral focal position
-
Linear widening with the focal length as a function of the F-number.
The F-number, for a linear transducer array, equals the quotient of the focal length and the aperture width.
Typical F-numbers, however, exclude echo signals from the focusing and reduce both the signal-to-noise ratio (SNR) and the lateral resolution.
Established methods to compute optimal F-numbers attribute the image artifacts to two different phenomena:
-
Measurement noise [5], [8], [9]: The directivity of the array elements attenuates the echoes and reduces the SNR of the recorded signals.
-
Grating lobes [10], [11]: The width of the aperture determines the grating lobe-to-main lobe ratio.
Both approaches yield similar F-numbers (0.5 <= F <= 2) but are mutually contradictory.
Wide array elements, for example, show
an increased directivity.
The "Noise" approach suggests
the usage of
narrow receive subapertures or, equivalently,
large F-numbers for
such elements to improve
the signal-to-noise ratio.
The "Grating lobes" approach, in contrast, permits
wide receive subapertures or, equivalently,
small F-numbers for
such elements because they attenuate
the grating lobes.
Both approaches, moreover, yield F-numbers that increase with the frequency.
The DAS algorithm, however, requires a fixed F-number and typically uses the maximum F-number at the upper frequency bound. This F-number satifies the conditions for all lower frequencies but, owing to its suboptimal value, reduces the spatial resolution.
The proposed F-number not only eliminates image artifacts but also maintains the spatial resolution of the full aperture [1], [2].
This F-number, in particular, prevents the first-order grating lobes from insonifying reflective image structures. The F-number, to this end, uses a closed-form expression, which derives from the far-field sensitivity of the focused receive subaperture, to impose a minimum angular distance on these grating lobes.
A Fourier-domain beamforming algorithm enables the usage of frequency-dependent F-numbers. The algorithm not only varies the width of the receive subaperture with the voxel position but also with the frequency. This additional frequency dependence, in contrast to a fixed F-number, includes additional frequency components that improve both the contrast and the spatial resolution.
| Method | Width of the receive subaperture | Spatial resolution | Grating lobe suppression |
|---|---|---|---|
| No F-number | always full | optimal | none |
| Fixed F-number | position-dependent | minimal | exaggerated |
| Proposed F-number | frequency- and position-dependent | almost optimal | optimal |
- Clone the repository or download the release to your local hard drive.
git clone https://github.com/mschiffn/f_number
- Add the repository to your MATLAB path.
addpath( genpath( './f_number' ) )- Run the script "examples.m".
examplesThe repository has the following structure:
.
├── +auxiliary # auxiliary functions (e.g., dimension and size check)
├── +cuda # C++/CUDA implementation and MEX interface
├── +f_numbers # classes for various types of F-numbers (e.g., constant, directivity-derived, proposed)
├── +normalizations # classes for various types of normalizations (e.g., off, on, window-based)
├── +platforms # classes for various types of platforms (e.g., CPU, GPU)
├── +windows # classes for various window functions (e.g., boxcar, Hann, Tukey)
├── das_pw.m # main function for coherent plane-wave compounding
├── das_prog_scan.m # main function for line-by-line scanning
├── das_sa.m # main function for synthetic aperture imaging
├── data_RF.mat # experimental data (tissue phantom; steered plane waves)
├── examples.m # examples for the usage of the main functions
├── LICENSE # license file
└── README.md # this readme
The packages +f_numbers, +normalizations, and +windows contain exemplary class hierarchies to manage various types of F-numbers, normalizations, and window functions, respectively.
The package +cuda contains the source code for C++/CUDA.
The package +platforms contains classes that determine the platform for the computations (CPU vs. GPU).
The functions das_pw, das_prog_scan, and das_sa enable image formation.
The function das_pw forms single plane-wave images [1], [2]. The images that result from different steering angles can be added manually.
In the MATLAB command line, type
help das_pwto display explanations of all input and output arguments.
The typical usage of the function das_pw is:
image = das_pw( positions_x, positions_z, data_RF, f_s, theta_incident, element_width, element_pitch, [ f_lb, f_ub ], c_ref, N_samples_shift, window, F_number, normalization, platform );The proposed F-number [1], [2] can be instantiated by:
chi_lb = 60; % minimum angular distance of the first-order grating lobes (°)
F_ub = 2; % maximum permissible F-number
delta = 10; % safety margin for anti-lobe aliasing (°)
F_number_rx = f_numbers.grating.angle_lb( chi_lb, F_ub, delta );The directivity-derived F-numbers [8], [9] are:
width_over_pitch = 0.918; % element width-to-element pitch ratio (1)
F_number_rx_1 = f_numbers.directivity.perrot( width_over_pitch );
F_number_rx_2 = f_numbers.directivity.szabo( width_over_pitch );The usual fixed F-number is:
F_number_rx_3 = f_numbers.constant( 2 );The function das_prog_scan forms line-by-line scans [3] from a complete synthetic aperture scan. Each scan has a different transmit focal length.
In the MATLAB command line, type
help das_prog_scanto display explanations of all input and output arguments.
The function das_sa forms a fully-focused image from a complete synthetic aperture scan [4]. The focusing is dynamic in both transmit and receive.
In the MATLAB command line, type
help das_sato display explanations of all input and output arguments.
The typical usage of the function das_sa is:
image = das_sa( positions_x, positions_z, data_RF, f_s, element_width, element_pitch, c_0, f_bounds, index_t0, window_tx, window_rx, F_number_tx, F_number_rx, normalization_tx, normalization_rx, platform );The usage of the MEX interface to the C++/CUDA implementation is optional but strongly recommended. This interface must be compiled:
mexcuda '-L/usr/local/cuda/lib64' -lcudart -lcufft -lcublas gpu_bf_das_pw_rf.cu
mexcuda '-L/usr/local/cuda/lib64' -lcudart -lcufft -lcublas gpu_bf_saft_rf.cuThe library path (here: /usr/local/cuda/lib64) has to be adapted to your system.
Define the platform argument
index_gpu = 0; % index of the GPU
platform = platforms.gpu( index_gpu );to run the C++/CUDA implementation on the GPU with the index index_gpu.
-
M. F. Schiffner and G. Schmitz, "Frequency-dependent F-number suppresses grating lobes and improves the lateral resolution in coherent plane-wave compounding," IEEE Trans. Ultrason., Ferroelectr., Freq. Control (2023).
-
M. F. Schiffner and G. Schmitz, "Frequency-dependent F-number increases the contrast and the spatial resolution in fast pulse-echo ultrasound imaging," 2021 IEEE Int. Ultrasonics Symp. (IUS), Xi’an, China, Sep. 2021, pp. 1–4.
-
M. F. Schiffner, “Frequency-dependent F-numbers suppress grating lobes and improve the lateral resolution in line-by-line scanning,” 2024 IEEE Ultrasonics, Ferroelectrics, and Frequency Control Joint Symp. (UFFC-JS), Taipei, Sep. 2024, pp. 1–4.
-
M. F. Schiffner, “Frequency-dependent F-numbers suppress grating lobes and improve both the signal-to-noise ratio and the lateral resolution in synthetic aperture imaging,” 2025 IEEE Int. Ultrasonics Symp. (IUS), Utrecht, Sep. 2025.
-
G. Montaldo, M. Tanter, J. Bercoff, N. Benech, and M. Fink, “Coherent plane-wave compounding for very high frame rate ultrasonography and transient elastography," IEEE Trans. Ultrason., Ferroelectr., Freq. Control, vol. 56, no. 3, pp. 489–506, Mar. 2009.
-
A. Ilovitsh, T. Ilovitsh, J. Foiret, D. N. Stephens, and K. W. Ferrara, “Simultaneous axial multifocal imaging using a single acoustical transmission: A practical implementation,” IEEE Trans. Ultrason., Ferroelectr., Freq. Control, vol. 66, no. 2, pp. 273–284, Feb. 2019.
-
J. A. Jensen, S. I. Nikolov, K. L. Gammelmark, and M. H. Pedersen, “Synthetic aperture ultrasound imaging,” Ultrasonics, vol. 44, Supplement, e5–e15, Dec. 2006.
-
V. Perrot, M. Polichetti, F. Varray, and D. Garcia, “So you think you can DAS? A viewpoint on delay-and-sum beamforming,” Ultrasonics, vol. 111, p. 106 309, Mar. 2021.
-
T. L. Szabo, Diagnostic Ultrasound Imaging: Inside Out, 2nd. Elsevier Academic Press, Dec. 2013
-
B. Delannoy, R. Torguet, C. Bruneel, E. Bridoux, J. M. Rouvaen, and H. Lasota, “Acoustical image reconstruction in parallel-processing analog electronic systems,” J. Appl. Phys., vol. 50, no. 5, pp. 3153–3159, May 1979.
-
C. Bruneel, E. Bridoux, B. Delannoy, B. Nongaillard, J. M. Rouvaen, and R. Torguet, “Effect of spatial sampling on an acoustical image reconstruction,” J. Appl. Phys., vol. 49, no. 2, pp. 569–573, Feb. 1978.

