Graphics Programs Reference
In-Depth Information
% compute the phase level and round it to the closest quantization level at
each array element
angleq = round(dolr .* n * sintheta0 * levels) .* qlevels; % vector of possi-
ble angles
phase0 = exp(i*angleq);
end
% generate array of elements with or without window
if winid < 0
wr(1:Nr) = 1;
else
wr = win';
end
% add the phase shift terms
wr = wr .* phase0;
% determine if interpolation is needed (i.e., N > Nr)
if N > Nr
w(1:N) = 0;
w(1:ratio:N) = wr(1:Nr);
else
w = wr;
end
% compute the sine(theta) in real space that corresponds to the FFT index
arg = [-nfft/2:(nfft/2)-1] ./ (nfft*dol);
idx = find(abs(arg) <= 1);
sinetheta = arg(idx);
theta = asin(sinetheta);
% convert angle into degrees
theta = theta .* (180.0 / pi);
% Compute fft of w (radiation pattern)
patternv = (abs(fftshift(fft(w,nfft)))).^2;
% convert radiationa pattern to dBs
patternr = 10*log10(patternv(idx) ./Nr + eps);
% Compute directive gain pattern
rbarr = 0.5 *sum(patternv(idx)) ./ (nfft * dol);
patterng = 10*log10(patternv(idx) + eps) - 10*log10(rbarr + eps);
return
Listing 8.4. MATLAB Program Ðcircular_array.mÑ
% Circular Array in the x-y plane
% Element is a short dipole antenna parallel to the z axis
% 2D Radiation Patterns for fixed phi or fixed theta
% dB polar plots uses the polardb.m file
% Last modified: July 13, 2003
Search WWH ::




Custom Search