1functionar = 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 elements11%12% Written by Kevin D. Donohue August 200513%14[mt, nmic] = min(rst); % Find closest mic to point being considered15% Create shading values to weight mic inputs as function of16% distance giving closest mic the most weight.17ar = 1 ./ ((rst+eps));18ar = ar/(sum(ar)+eps);