FrequencyDependent FNumber for CPWC
FrequencyDependent FNumber for Coherent PlaneWave Compounding
Simple MATLAB and CUDA implementations of the frequencydependent Fnumber [1] for coherent planewave compounding.
What is an FNumber?
The Fnumber significantly reduces image artifacts in all image formation methods using the delayandsum (DAS) algorithm, such as
The Fnumber, for a uniform linear transducer array, equals the quotient of the focal length and the width of the receive subaperture.
The usage of a fixed Fnumber results in a dynamic receive subaperture whose width increases with the focal length.
Established Methods to Compute the FNumber are Contradictory and Yield FrequencyDependent Results
Established methods to compute the optimal Fnumber attribute the image artifacts to two different phenomena:

Noise [4], [5], [2]: The directivity of the array elements attenuates the echoes and reduces the signaltonoise ratio of the recorded signals.

Grating lobes [6], [7]: The width of the receive subaperture determines the grating lobetomain lobe ratio.
Both approaches, although yielding similar Fnumbers (0.5 <= F <= 2), 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 Fnumbers for
such elements to improve
the signaltonoise ratio.
The "Grating lobes" approach, in contrast, permits
wide receive subapertures or, equivalently,
small Fnumbers for
such elements because they attenuate
the grating lobes.
Both approaches, moreover, yield Fnumbers that increase with the frequency.
The DAS algorithm, however, requires a fixed Fnumber and typically uses the maximum Fnumber at the upper frequency bound. This Fnumber satifies the conditions for all lower frequencies but, owing to its suboptimal value, reduces the spatial resolution.
What Does the Proposed FNumber Accomplish?
The proposed Fnumber not only eliminates image artifacts but also maintains the spatial resolution of the full aperture [1].
This Fnumber, in particular, prevents the firstorder grating lobes from insonifying reflective image structures. The Fnumber, to this end, uses a closedform expression, which derives from the farfield sensitivity of the focused receive subaperture, to impose a minimum angular distance on these grating lobes.
How Does the Implementation Work?
A Fourierdomain beamforming algorithm enables the usage of frequencydependent Fnumbers. 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 Fnumber, 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 Fnumber  always full  optimal  none 
Fixed Fnumber  positiondependent  minimal  exaggerated 
Proposed Fnumber  frequency and positiondependent  almost optimal  optimal 
Getting Started
 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 using .
addpath( genpath( './f_number' ) )
Folder Structure
The 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 Fnumbers (e.g., constant, directivityderived, proposed)
├── +normalizations # classes for various types of normalizations (e.g., off, on, windowbased)
├── +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
├── LICENSE # license file
└── README.md # this readme
The packages +f_numbers, +normalizations, and +windows contain exemplary class hierarchies to manage various types of Fnumbers, normalizations, and window functions.
Image Formation
Use the function das_pw to form images.
In MATLAB type
help das_pw
to obtain an explanation of the input and output arguments.
The typical usage is:
[ image, F_number_values ] = 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 Fnumber can be instantiated by
chi_lb = 45; % minimum angular distance of the firstorder grating lobes (°)
F_ub = 3; % maximum permissible Fnumber
delta = 10; % safety margin for antilobe aliasing (°)
F_number_rx = f_numbers.grating.angle_lb( chi_lb, F_ub, delta );
The directivityderived Fnumbers [4], [5] are
width_over_pitch = 0.918; % element widthtoelement 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 standard fixed Fnumber is
F_number_rx_3 = f_numbers.constant( 3 );
The MEX interface to the C++/CUDA implementation must be compiled:
mexcuda 'L/usr/local/cuda/lib64' lcudart lcufft gpu_bf_das_pw_rf.cu
You might have to adapt the library path (here: /usr/local/cuda/lib64) to your system.
References 📓

M. F. Schiffner and G. Schmitz, "Frequencydependent Fnumber increases the contrast and the spatial resolution in fast pulseecho ultrasound imaging," 2021 IEEE Int. Ultrasonics Symp. (IUS), Xi’an, China, Sep. 2021, pp. 1–4.

G. Montaldo, M. Tanter, J. Bercoff, N. Benech, and M. Fink, “Coherent planewave 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.

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 delayandsum 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 parallelprocessing 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.
Cite As
mschiffn (2022). FrequencyDependent FNumber for CPWC (https://github.com/mschiffn/f_number/releases/tag/0.1), GitHub. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.