1function ar = arweights(rst)
 2%  This function computes a set of weights for each sensor in an
 3%  array based on the distances from sources to the sensors.
 4%
 5%    ar = arweights(rst)
 6%
 7%  input:
 8%  RST    vector of distances of each sensor to the point in space
 9%  output:
10%  AR     corresponding vector of weights for the array elements
11%
12%    Written by Kevin D. Donohue August 2005
13%
14[mt, nmic] = min(rst);  % Find closest mic to point being considered
15%  Create shading values to weight mic inputs as function of
16%  distance giving closest mic the most weight.
17ar = 1 ./ ((rst+eps));
18ar = ar/(sum(ar)+eps);