thin4.m

% thin4.m
% SHolm, Univ of Oslo 22 Aug 2006
%
% Generate four circular xdcrs from a 2D rectangular layout
% Purpose: simulate effect of putting 4 fishfinder xdcrs next to each
% other = hobbyist sidescan sonar
%
% Assumptions:
% 1. assumes setup of xdcr with only a single point pr element
%   <=> size(elem_pts) = size(centers)
% 2. A 2D array has been setup which covers more than footprints of 4
%   xdcrs

%
% define active circular elements in array by radius and center position
%
radius = [ 22,  22, 22, 22]*1e-3; % Ø 44 mm
ctr_y  = [0,     0   0   0]*1e-3;

% REGULAR ARRAY WITH XDCRS AS CLOSE AS PHYSICALLY POSSIBLE
ctr_x  = [-90, -30, 30, 90]*1e-3; % min 60 mm between them


% flip elements in elem_pts (ultrasim array with coordinates for each point in xdcr)
% azimuth elements no is now negative <=> will be omitted in simulations
%
elem_pts(4,:) = - elem_pts(4,:);

for nn = 1:length(radius), % step through each fishfinder transducer
    ctrx = ctr_x(nn);
    ctry = ctr_y(nn);
    rad2 = radius(nn)*radius(nn);
   
    for el = 1:length(elem_pts), % step through each simulation point
        xel = elem_pts(1,el);
        yel = elem_pts(2,el);
        if ((xel-ctrx) ^2 + (yel-ctry)^2) < rad2,
            % flip back on again:
            elem_pts(4,el) = abs(elem_pts(4,el));
        end
    end
end
centers = elem_pts;

Published Mar. 8, 2011 2:52 PM - Last modified Mar. 8, 2011 2:59 PM