% thin4b.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;
% THINNED ARRAY:
% http://www.beugungsbild.de/sidescan/sidescan2.html
% "With the left transducer being the number one and the right the number
% four we have 1->4 = 300mm, 1->3 = 150mm, and 1->2 = 65mm,
% the numbers given are always measured center to center."
ctr_x = [-150, -85, 0, 150]*1e-3;
% 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;