examine the response of a focused phased array -凯发k8网页登录
introduction
this example introduces the concept of a focused beam, and shows how to use phased.focusedsteeringvector
to generate the required element weights for a phased array. it also shows how to use phased.sphericalwavefrontarrayresponse
to compute the array response of an array at a given angle and range. first you will look at the response when a single beam is formed and examine characteristics of the focal region, then emulate a collection strategy commonly used in ultrasound imaging to see how a focused beam appears in an image.
focused beamforming
spherical wavefront delay-and-sum
beamforming under the typical far-field assumption enables modeling the signal wavefront as a plane which is propagating along its normal direction. when the signal is incident on an array, the wavefront intersects individual elements with a relative time delay that is proportional to the distance of the element along the wave's propagation direction. under this model, a delay (or phase shift, in the narrowband case) can be applied to each element such that the outputs across elements (whether on transmit or receive) have constructive phase when coherently summed.
without the far-field assumption, the wavefront emanating from a point source is modeled as a spherical surface centered at that soure. this wavefront intersects the elements of the phased array with relative time delay dictated by the hyperbolic range across colinear elements. while this model would simply add unneccessary computation cost to the generation of a far-field pattern, the spherical wavefront model is necessary to understand near-field beamforming and focusing.
the function helperplotulawavefronts
is provided to demonstrate the difference in element delays and wavefront shape between a steered beam with and without focusing. element delays are relative to the array center.
figure
helperplotulawavefronts(14,1e6,1540,20,inf)
title('steered wavefront')
figure
helperplotulawavefronts(14,1e6,1540,20,0.01)
title('steered and focused wavefront')
the focal region and near/far boundary
in the far field, a steered array has a well-defined pattern in angle space, which is not dependent on range. in the near field, a steered (but unfocused) array has no discernabe lobe structure at all. thanks to the nonlinear phase relationship between elements, a response that has equal magnitude at all ranges in a given direction is not possible. instead, by focusing a beam one can obtain a small region, bounded in both angle and range, in which the response resembles a far-field response, known as the focal region. the angular position of the focal region may be controlled as easily as with a far-field beam. the position of the focal region in range is determined by the focal range, and the depth of field (dof), which is the range extent of the region.
the figures below shows the progression of beam shape with range for focused uniform and rectangular arrays. the function helperplotresponseslices
is provided to demonstrate how to generate this type of figure.
at the focal range, our beam in angle space closely resembles that of a far-field pattern.
the near/far boundary, similar in concept to other near-field/far-field boundaries, is the boundary past which focusing is not possible. conversely, a steered but unfocused beam is not possible on the near side of the boundary. the figure below demonstrates this fact. notice that the steered beam only begins to take shape on the far side, and the focused beam is only focused on the near side.
the range where this boundary can be found is well-documented in the medical imaging literature as , where is the length of the array. for a simple uniform linear array with critically-spaced elements, this can be expressed as .
generating the response for a single beam
this sections shows how to generate and plot a single beam. start by setting up the phased array and other system objects. common medical imaging ultrasound systems operate between 2 and 20 mhz, and the commonly-accepted average propagation speed of sound in soft tissue is 1540 m/s.
rng('default')
freq = 4e6;
c = 1540;
lambda = c/freq;
ultrasound transducers come in a wide variety of topologies suited for specific activities. this example simply uses a uniform linear array with critical element spacing.
numelems = 256; elemspacing = lambda/2; array = phased.ula(numelems,elemspacing);
the system objects phased.focusedsteeringvector
and phased.sphericalwavefrontarrayresponse
are used in tandem to generate steered and focused element weights, and to compute the response over some domain. pass the array and propagation speed specification from above to the constructors. for the array response, also turn on the weights input port.
sv = phased.focusedsteeringvector('sensorarray',array,'propagationspeed',c); ar = phased.sphericalwavefrontarrayresponse('sensorarray',array,'propagationspeed',c,'weightsinputport',true);
now you have the minimal setup required to form and inspect a focused beam. use a 10 degree steer in azimuth and a focal range of 40 mm.
azsteer = 10; focalrange = 0.04;
use a domain that starts in front of the array and extends out to twice the focal range, and covers the length of the array in the lateral direction. the array elements lie along the y axis, and the array normal direction is x.
arraylength = numelems*elemspacing; x = linspace(1e-3,2*focalrange,200); y = linspace(-arraylength/2,arraylength/2,200);
convert to spherical coordinates for input to the steering vector and response computation.
[az,el,rng] = cart2sph(x,y',0); ang = rad2deg([az(:) el(:)]'); rng = rng(:)';
now compute the response of the focused array over the specified domain.
weights = sv(freq,[azsteer;0],focalrange); beam = ar(freq,ang,rng,weights);
reshape, normalize, and use log-scale.
beam = reshape(beam,numel(y),numel(x)); beam = beam/max(abs(beam(:))); beam = mag2db(abs(beam));
use the provided function helperplotresponse
to plot the result. the positions of the array elements are indicated by red markers.
figure
helperplotresponse(beam,x,y,array)
title('single steered and focused beam')
the focal region is clearly visible at the specified range and angle. as with the far-field response (pattern), the magnitude of the spherical wavefront response takes into account the varying phase across elements but, unlike the far-field response, the spherical wavefront response also includes the effect of varying free-space propagation loss across elements. this is essentially a slight amplitude modulation across elements, the effect of which is visible in the beam's sidelobes. a flat gain equal to the focal range is applied to each element, so that the overall amplitude weighting on an element is the ratio of the distance between the response point and the array center to the distance from the response point to the individual element: . for example, the contribution to the sum beam from an element located at the origin would have unit magnitude.
focal region
for a focal region to be bounded in range, the focal range must be small enough that the entire region (with extent determined by the dof) must be closer than the near/far boundary. dof can be expressed as a function of a related quantity, commonly seen in optics, known as the f-number, which is the ratio of the focal range to the length of the array: . from this quantity, a good estimate of the dof is . for a fixed array and frequency, the dof increases with the square of the focal range.
this section takes a look at how the dof changes with focal range. generate the response over an interval of focal ranges, and examine the changing dof. the function helperplotbeammarkers
will display an indication of the dof for each focal range. the focal region is roughly elliptical, and is not centered on the focal range. another rule of thumb can be used to find the offset from the focal range to the center of the region: .
nearfield = arraylength^2/(4*lambda); % near/far boundary range x = linspace(1e-3,nearfield*1.2,100); y = linspace(-0.01,0.01,100); coeff = 0.1:0.1:0.9; % proportion of near/far boundary focalranges = coeff*nearfield; fnum = focalranges/arraylength; dof = 7.1*lambda*fnum.^2; focalregioncenter = focalranges dof/4; figure for ind = 1:numel(focalranges) beam = helpermakesinglebeam( sv,ar,freq,0,focalranges(ind),x,y ); helperplotresponse(beam,x,y) caxis([-6 0]) % only view the greatest 6 db of the beam helperplotbeammarkers(focalranges(ind),focalregioncenter(ind),nearfield,dof(ind),0.001) title(sprintf('focal range = %d%% of near/far boundary',round(coeff(ind)*100))) drawnow end
by the time the focal range has increased to 60% of the near/far boundary, the eccentricity of the focal region has become quite large. by 80%, the focal region has intersected the near/far boundary and has essentially become an unfocused beam.
beamwidth in the focal region, as with a far-field response, may still be roughly computed with the usual , the ratio of wavelength to array length. thus the width (in the lateral direction) of the focal region can be approximated with .
single-line acquisition with linear subarray shifting
a-scans and image formation
unlike radar systems, where direction of arrival can be estimated efficiently through beamforming of far-field signals, the near-field beamforming and latency requirements of ultrasound systems often necessitate a simpler strategy to locate the source of returned energy. a common class of collection strategy involves multiple a-scans, reflectivity profiles along a given line segment. the placement of these lines within the formed image is determined simply by the known position of the beam.
to form a rectangular image, as is done in this example, lineary subarray shifting can be used. with this method a subset of the array elements (a subarray) is used for each pulse, with no steering, to get a range profile originating at the center of the subarray and extending in the axial direction. successive lines are formed by shifting the subarray selection to a different set of elements.
the choice of focal range can be considered separately from beam pointing. some systems may keep a fixed focal range, or use dynamic focusing on receive along with apodization or windowing to generate a broad image that covers much of the near-field region. in this example focal range is kept fixed while the lateral position of the subarray is varied.
the helper class helpersubarray
is provided to emulate subarray selection and simplify the simulation loop. this class keeps track of which elements belong to the current subarray and handles the necessary transforms between the global and subarray frames.
image formation
in order to demonstrate the effects of focused beamforming, this example uses a simple image formation strategy that constructs each range profile by quantizing and accumulating the response at each pulse, then inserting that profile into the completed image based on the location of the subarray. this simulates an ideal delta pulse in free space, which allows for a comparison of lateral resolution inside and outside the focal region. this method disregards the effects of waveform choice and multipath reflections, and treats scatterers as perfect point isotropic reflectors.
simulation
the same system parameters will be used as in the previous section. each subarray will consist of 64 elements. the subarray starts at the end of the array and is shifted by one element on each pulse.
numsubelems = 64; subarray = helpersubarray(array,numsubelems);
if subarray is shifted by one element on each pulse and all contiguous subarrays are covered, the total number of pulses will be
numpulses = numelems - numsubelems 1
numpulses = 193
following the analysis in the previous section, check the focal region parameters for this subarray. get the subarray length, near/far boundary, dof, and lateral width of the focal region.
subarraylength = numsubelems*elemspacing;
nearfieldsub = subarraylength^2/(4*lambda); % near/far boundary for the subarray
fnumsub = focalrange/subarraylength;
dofsub = 7.1*lambda*fnumsub.^2
dofsub = 0.0288
widthsub = lambda/subarraylength*focalrange
widthsub = 0.0013
the subarray beam has a dof of about 28.8 mm, and the lateral width of the focal region is about 1.3 mm. check that the focal region is well within the near/far boundary
boundedfocalregion = focalrange dofsub < nearfieldsub
boundedfocalregion = logical
1
to demonstrate the primary usefulness of a focused beam, decreased beamwidth in the focal region, use multiple parallel lines of scatterers along the axial direction (depth lines). specify the desired max depth of scatterers, and use the provided helper function, helpergetresponsepoints
, to get the scatterer positions. let all scatterers have reflectivity with unit amplitude. the scatterer positions are perturbed to avoid artifacting due to symmetry.
for the lateral spacing of the lines, use 4 times the calculated focal region width. because the subarray is simply shifted by one element at a time, which is a shorter distance than our beam width in the focal region, return from each line of scatterers shows up in more than one row of the image, making them appear to have greater width.
maxdepth = nearfieldsub; linespacing = 4*widthsub; [sx,sy] = helpergetresponsepoints(maxdepth,arraylength,lambda,linespacing);
to visualize the scene, plot the scatterer positions along with the array elements.
figure plot(subarray) hold on plot(sx,sy,'.') hold off legend('array elements','initial subarray','scatterers') xlabel('axial distance') ylabel('lateral position')
to form a range profile and capture the effects of interference from sidelobe return, range sampling parameters must be defined. modern ultrasound systems use a relatively high sampling frequency, on the same order as the center frequency of the transmitted waveform. use a range bin size of 1 mm, corresponding to a sampling rate of about 1.5 mhz. the provided helper function helperformrangeprofile
is used to form the range profile from the array response data.
rangebinsize = 1e-3; fs = c/rangebinsize; rangebins = 0:rangebinsize:maxdepth; numrangesamples = numel(rangebins);
get the scatterer positions in spherical coordinates (angles in degrees) for input to sphericalwavefrontarrayresponse
.
[respang,~,resprng] = cart2sph(sx,sy,0); respang = rad2deg(respang(:)'); resprng = resprng(:)';
each loop of the simulation involves computing weights for the current subarray, computing the response, forming a range profile, and forming the image line by line. we'll also apply range-dependent gain for uniform brightness (see helperformrangeprofile
).
im = zeros(numpulses,numrangesamples); center = zeros(3,numpulses); for pulse = 1:numpulses center(:,pulse) = subarray.center; % center position of our current subarray [focazglobal,~,focrngglobal] = subarray.localtoglobalsph( 0,0,focalrange ); % angle and range to current focal point weights = sv(freq,[focazglobal;0],focrngglobal); weights(~subarray.selection) = 0; % zero-out weights for unused elements resp = ar(freq,respang,resprng,weights); resp = resp./resprng(:); % undo normalization to use actual propagation loss im(pulse,:) = helperformrangeprofile(resp,sx,sy,center(:,pulse),rangebins); % add line to image if pulse < numpulses subarray.shift(1) % shift subarray if there are pulses remaining end end
normalize and plot the image, along with an overlay of the scatterer positions.
im = im/max(abs(im(:))); figure subplot(1,2,1) helperplotresponse(mag2db(abs(im)),rangebins,center(2,:)) title('linear subarray shift image') subplot(1,2,2) helperplotresponse(mag2db(abs(im)),rangebins,center(2,:)) hold on plot(sx,sy,'.r','markersize',1) hold off title('scatterer overlay') set(gcf,'position',get(gcf,'position') [0 0 560 0]);
the depth lines are resolvable about the focal range, over a range interval roughly equal to the computed dof for the subarray beam. away from the focal point, the parallel lines of scatterers quickly become indistinguishable thanks to the wide angular spread of the beam outside the focal region.
note that, though all the scatterers were used to compute energy return, not all lines are visible due to the clipping between the full array size and the extent of subarray center positions. a wider total field of view would be obtainable with a shorter subarray, at the cost of reduced lateral resolution.
conclusion
this example introduced two system objects for computing focused weights and for computing the non-far-field response of an array with spherical wavefronts. it showed how to examine some basic characteristics of a focused beam, and how to generate a basic image to visualize the effect of a focused beam on lateral resolution with a linear subarray shift collection method.
references
[1] demi, libertario. “practical guide to ultrasound beam forming: beam pattern and image reconstruction analysis.” applied sciences 8, no. 9 (september 3, 2018): 1544.
[2] ramm, o. t. von, and s. w. smith. “beam steering with linear arrays.” ieee transactions on biomedical engineering bme-30, no. 8 (august 1983): 438–52.
helper functions
helpermakesinglebeam
function [beam,x,y] = helpermakesinglebeam( sv,ar,freq,azsteer,focalrange,x,y ) % get the element weighting for a single beam and compute the response weights = sv(freq,[azsteer;0],focalrange); % domain of response if nargin < 6 x = linspace(1e-3,2*focalrange,200); end if nargin < 7 pos = sv.sensorarray.getelementposition; halfy = max(pos(2,:))*1.2; y = linspace(-halfy,halfy,200); end [az,el,rng] = cart2sph(x,y',0); ang = rad2deg([az(:) el(:)]'); rng = rng(:)'; % generate response beam = ar(freq,ang,rng,weights); beam = reshape(beam,numel(y),numel(x)); % normalize and use log scale beam = beam/max(abs(beam(:))); beam = mag2db(abs(beam)); end
helperplotresponse
function helperplotresponse(r,x,y,array) % plot the response, r, on the domain defined by x and y. imagesc(x,y,r) set(gca,'ydir','normal') caxis([-32 0]) xlabel('axial distance') ylabel('lateral position') if nargin > 3 pos = getelementposition(array); hold on h = plot(pos(1,:),pos(2,:),'.r'); hold off xl = xlim; xlim([min(pos(1,:)) xl(2)]) legend(h,'array elements','location','southeast','autoupdate','off') end end
helperplotbeammarkers
function helperplotbeammarkers(focalrange,center,nearfield,dof,offset) % put informative markers on a beam plot line([center-dof/2 center dof/2],[offset offset],'color','white') line([center-dof/2 center-dof/2],[0 offset],'color','white') line([center dof/2 center dof/2],[0 offset],'color','white') line([focalrange focalrange],ylim,'color','red') line([nearfield nearfield],ylim,'color','cyan') end
helpergetresponsepoints
function [sx,sy] = helpergetresponsepoints( maxdepth,arraylength,lambda,dy ) % make parallel lines of scatterers along x sx = linspace(0.001,maxdepth,400); sy = -arraylength/2:dy:arraylength/2; [sx,sy] = meshgrid(sx,sy); sx = sx(:); sy = sy(:); sx = sx (rand(size(sx))-1/2)*lambda; sy = sy (rand(size(sy))-1/2)*lambda; end
helperformrangeprofile
function rangeprof = helperformrangeprofile(resp,sx,sy,center,rangebins) % this helper function quantizes a response in range, coherently % accumulates the return in each bin, and applies amplitude weighting per % range bin rangebinsize = rangebins(2) - rangebins(1); numrangesamples = numel(rangebins); % range of scatterers relative to subarray center scatrngrel = sqrt((center(1)-sx).^2 (center(2)-sy).^2); % quantize scatterer ranges into fast-time sampling vector scatridx = 1 floor(scatrngrel/rangebinsize); % only keep samples below max depth i = scatridx <= numrangesamples; scatridx = scatridx(i); resp = resp(i); % accumulate return into fast-time sampling grid rangeprof = accumarray(scatridx,resp,[numrangesamples 1]); rangeprof = rangeprof'; % apply range-dependent gain rangeprof = rangeprof.*rangebins; end
helperplotulawavefronts
function helperplotulawavefronts( numelems,f,c,az,r ) % plot the wavefronts for the given ula with arrayaxis 'y', for the given % azimuth angle and focal range. % % for the far-field wavefront, use inf for focal range lambda = c/f; array = phased.ula(numelems,lambda/2); pos = getelementposition(array); arraylength = max(pos(2,:)) - min(pos(2,:)); % get relative path lengths if isinf(r) l = phased.internal.elemdelay(pos,c,[az;0])*c; else l = phased.internal.sphericalelemdelay(pos,c,[az;0],r)*c; end % plot element positions plot(pos(1,:),pos(2,:),'oblue'); hold on; % if near field, plot source if ~isinf(r) [src(1,1),src(2,1),src(3,1)] = sph2cart(az*pi/180,0,r); plot(src(1),src(2),'*r','markersize',10); end % wavefront marker width s = lambda/6; % far field prop path if isinf(r) [los(1,1),los(2,1),los(3,1)] = sph2cart(az*pi/180,0,1); end for ind = 1:size(pos,2) % for each element p = pos(:,ind); if isinf(r) src = p los*arraylength; end path = src - p; path = path/norm(path); wp = p path*l(ind); % position of wavefront % prop path line([wp(1) src(1)],[wp(2) src(2)],'color','black','linestyle','--'); % wavefront marker u = cross([0;0;1],path)*s; line([wp(1)-u(1) wp(1) u(1)],[wp(2)-u(2) wp(2) u(2)],'color','magenta'); end hold off; grid on; axis equal; if isinf(r) legend('elements','prop path','wavefronts','location','southeast'); else legend('elements','focal point','prop path','wavefronts','location','southeast'); end end
helperplotresponseslices
function helperplotresponseslices % demonstrates how to visualize range slices of a spherical wavefront response f = 2e6; c = 1540; lambda = freq2wavelen(f,c); array = phased.ura([32 32],lambda/2); elempos = array.getelementposition; focalrange = 0.03; sampleranges = .01:.01:.05; % domain of each slice azsteer = -20; elsteer = 20; az = azsteer (-30:.1:30); el = elsteer (-30:.1:30); [az,el] = meshgrid(az,el); ang = [az(:) el(:)]'; [x,y,z] = sph2cart(az*pi/180,el*pi/180,1); sv = phased.focusedsteeringvector('sensorarray',array,'propagationspeed',c); ar = phased.sphericalwavefrontarrayresponse('sensorarray',array,'propagationspeed',c,'weightsinputport',true); w = sv(f,[azsteer;elsteer],focalrange); for ind = 1:numel(sampleranges) resp = ar(f,ang,sampleranges(ind),w); resp = resp / array.getnumelements; resp = reshape(resp,size(x)); alpha = 1 - (abs(sampleranges(ind) - focalrange)/(max(sampleranges)-min(sampleranges))); % transparency surf(x*sampleranges(ind),y*sampleranges(ind),z*sampleranges(ind),mag2db(abs(resp)),'facealpha',alpha) hold on shading flat end % plot element positions and boresight vector caxis([-32 0]) plot3(elempos(1,:),elempos(2,:),elempos(3,:),'.black','markersize',4); [b(1),b(2),b(3)] = sph2cart(azsteer*pi/180,elsteer*pi/180,max(sampleranges)*1.2); quiver3(0,0,0,b(1),b(2),b(3),'black','autoscale','off') axis equal axis off hold off set(gca,'view',[-70 22]) end