Graphics Programs Reference
In-Depth Information
if nffty < 256
nffty = 256;
end
% generate array of elements with or without window
if winid < 0
array = ones(N,N);
else
array = win;
end
% convert steering angles (theta0, phi0) to radians
theta0 = theta0 * pi / 180;
phi0 = phi0 * pi / 180;
% convert steering angles (theta0, phi0) to U-V sine-space
u0 = sin(theta0) * cos(phi0);
v0 = sin(theta0) * sin(phi0);
% Use formula thetal = (2*pi*n*dol) * sin(theta0) divided into 2^m levels
% and rounded to the nearest qunatization level
if nbits < 0
phasem = exp(i*2*pi*dolx*u0 .* nx * ratiox);
phasen = exp(i*2*pi*doly*v0 .* ny * ratioy);
else
levels = 2^nbits;
qlevels = 2.0*pi / levels; % compute quantization levels
sinthetaq = round(dolx .* nx * u0 * levels * ratiox) .* qlevels; % vector of
possible angles
sinphiq = round(doly .* ny * v0 * levels *ratioy) .* qlevels; % vector of pos-
sible angles
phasem = exp(i*sinthetaq);
phasen = exp(i*sinphiq);
end
% add the phase shift terms
array = array .* (transpose(phasem) * phasen) ;
% determine if interpolation is needed (i.e., N > Nr)
if (Nx > N )| (Ny > N)
for xloop = 1 : N
temprow = array(xloop, :) ;
w( (xloop-1)*ratiox+1, 1:ratioy:Ny) = temprow ;
end
array = w;
else
w(1:Nx, :) = array(1:N,:);
end
% Convert rectangular array into circular using function rec_to_circ
Search WWH ::




Custom Search