Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.74 MB, 23 trang )
<span class="text_page_counter">Trang 1</span><div class="page_container" data-page="1">
% I. Normal Mode
% a. Pitch angle alpha (in degrees)% b. Axial ratio (AR)% c. HPBW (in degrees)
% c. Directivity (dimensionless and in dB)% *
% II. Axial (End-Fire) Mode% a. Pitch angle alpha (in degrees)% b. Input impedance (ohms)% c. Axial ratio (AR)% d. Relative phase velocity ratio p
% e. HPBW (in degrees) (both approximate and numerical)% f. FNNW (in degrees) (both approximate and numerical)
% g. Directivity (dimensionless and in dB) (both approximate and numerical)% 1.Choice of output
% % Input 1 for Screen output% Input 2 for File output%
---% 2.Choice of radiation mode% ---% Input 1 to select Normal mode% Input 2 to select Axial (End-Fire) mode
</div><span class="text_page_counter">Trang 5</span><div class="page_container" data-page="5">%
---% a. Number of turns N
% b. Circumference of loops C (in lambda)% c. Spacing between turns S (in lambda)% *
% For axial mode, also need to select end-fire mode:% Input 1 to select Ordinary End-Fire
% Input 2 to select Hansen-Woodyard End-Fire%
% 4.Output% ---% I. Normal Mode
% a. Pitch angle alpha (in degrees)% b. Axial ratio (AR)% c. HPBW (in degrees)
% c. Directivity (dimensionless and in dB)% d. Plot the normalized radiation pattern (0 to -60 dB)%
% II. Axial (End-Fire) Mode% b. Input impedance (ohms)% c. Axial ratio (AR)% d. Relative phase velocity ratio p% e. HPBW (in degrees)
% A. Approximate (use Equation 10-31)% B. Numerical (found from pattern)% f. FNNW (in degrees)
% A. Approximate (use Equation 10-32)
% B. Numerical (found from pattern, set "zero" point to be less% than 1e-6)
% g. Directivity (dimensionless and in dB)% A. Approximate (use Equation 10-33)
% B. Numerical (calculated from equation D0=4*pi*Umax/Prad)% h. Plot the normalized radiation pattern (in dB: 0 to -60 dB)% ---
FILNAM = input('Input the desired output filename: ', );'s'
ERR = 0; else
fprintf('\nOutputting device number should be either 1 or 2\n'); end
</div><span class="text_page_counter">Trang 6</span><div class="page_container" data-page="6">%---Start of main
program---switch SELECT_mode, case 1
%---Normal mode---
fprintf('\nInput:\n'); fprintf('---\n');
%---Input turn numbers---
ERR = 1; while(ERR ~= 0)
N = str2num(input('Number of turns N = ', ));'s'
N = round(N); if (isempty(N))
fprintf('\n * ERROR: Please enter an integer!\n\n'); elseif (N <= 0)
fprintf('\n * ERROR: The number has to be greater than 0!\n\n');
elseif (N > 10)
fprintf('\n * WARNING: Large turn number may cause multi-lobe!\n\n');
ERR = 0; else
ERR = 0; end
end
%---Input circumference of
ERR = 1; while(ERR ~= 0)
fprintf('\n * NOTICE: For Normal mode, C << lambda.'); fprintf('\n It is recommended that C/lambda <= 1/10.\n\n');
C = str2num(input('Circumference of loops C (in lambda) = ', ));'s'
</div><span class="text_page_counter">Trang 7</span><div class="page_container" data-page="7">end
%---Input spacing between
ERR = 1; while(ERR ~= 0)
fprintf('\n * NOTICE: For Normal mode, S << lambda.'); fprintf('\n It is recommended that S/lambda <= 1/20.\n\n');
S = str2num(input('Spacing between turns S (in lambda) = ','s')); if (isempty(S))
fprintf('\n * ERROR: Please enter a number!\n\n'); elseif (S <= 0)
fprintf('\n * ERROR: The number has to be greater than 0!\n\n');
else
ERR = 0; end
end
%---Normal mode main %---Setup---
step=0.1; % Step: accuracy control
delta=1e-2; % To avoid sigularity in calculation
angle=[0+delta:step:360+delta]; theta=angle*pi/180;
%---Pitch
alpha=atan(S/C)*180/pi;
%---Axial
AR=2*S/C;
L0=sqrt(C^2+S^2); E=sin(theta); % Element factor
M=2*N; % Image due to ground plane
kesi=2*pi*(S*cos(theta));
AF=sin(M*kesi/2)./sin(kesi/2)/N; % Array factor
U=(E.*AF).^2; % Pattern mutiplicatin
[Umax,Index]=max(U); U=U/Umax; Umax=1; U_dB=10*log10(U);
%---HPBW(From
for i=Index:length(U) if U(i)<HP_dB
HPBW=angle(i)+angle(i-1)-2*angle(Index); break;
endend
</div><span class="text_page_counter">Trang 8</span><div class="page_container" data-page="8">
Prad=2*pi*sum(integrand(1:round(length(integrand)/2))); D0=4*pi*Umax/Prad;
D_dB=10*log10(D0);
%---Create
output---if(DEVICE == 2) fid = fopen(FILNAM,'w');
fid = DEVICE;
%---Echo input parameters and output computed
parameters---fprintf(fid,'\nHELIX: NORMAL MODE:\n');fprintf(fid,'\nInput parameters:\n---');fprintf(fid,'\nNumber of turns N = %3.0f',N);
fprintf(fid,'\nCircumference of loops C (in lambda) = %6.4f',C);fprintf(fid,'\nSpacing between turns S (in lambda) = %6.4f',S);fprintf(fid,'\nLength (one-turn) L0 (in lambda) = %6.4f',sqrt(C^2+S^2));fprintf(fid,['\nLength (',num2str(N),'-turn) LN (in lambda) = %6.4f'],N*sqrt(C^2+S^2));
fprintf(fid,'\n\nOutput parameters:\n---');fprintf(fid,'\nAxial Ratio AR (dimensionless) = %6.4f',AR);fprintf(fid,'\nHPBW (in degrees) = %6.4f',HPBW);fprintf(fid,'\nDirectivity(approximate) (dimensionless) = 1.5');fprintf(fid,'\nDirectivity(approximate) (in dB) = 1.7609');fprintf(fid,'\nDirectivity(numerical from pattern) (dimensionless) = %6.4f',D0);
fprintf(fid,'\nDirectivity(numerical from pattern) (in dB) \t= %6.4f',D_dB);fprintf(fid,'\n\n');
if(DEVICE == 2) fclose(fid);
%---Input turn numbers---
ERR = 1; while(ERR ~= 0)
N = str2num(input('Number of turns N = ', ));'s'
N = round(N); if (isempty(N))
fprintf('\n * ERROR: Please enter an integer!\n\n'); elseif (N <= 0)
fprintf('\n * ERROR: The number has to be greater than 0!\n\
</div><span class="text_page_counter">Trang 9</span><div class="page_container" data-page="9">ERR = 0; end
end
%---Input circumference of
ERR = 1; while(ERR ~= 0)
fprintf('\n * NOTICE: To achieve nearly circular polarizaion, it is');
fprintf('\n recommended that 3/4 <= (C/lambda) <= 4/3.\n\n');
C = str2num(input('Circumference of loops C (in lambda) = ', ));'s'
end
%---Input spacing between
ERR = 1; while(ERR ~= 0)
fprintf('\n * NOTICE: To achieve nearly circular polarizaion, it is');
fprintf('\n recommended that S/lambda is approximately 1/4.\n\n');
S = str2num(input('Spacing between turns S (in lambda) = ','s')); if (isempty(S))
fprintf('\n * ERROR: Please enter an number!\n\n'); elseif (S <= 0)
fprintf('\n * ERROR: The number has to be greater than 0!\n\n');
else
ERR = 0; end
end
%---Axial(End-fire) mode main %---Setup---
step=0.1; % Step: accuracy control
delta=1e-2; % To avoid sigularity in calculation
angle=[0+delta:step:360+delta]; theta=13*pi/180;
%---Choice of End-Fire
mode---ERR = 1;
while(ERR ~= 0)
fprintf('\nSELECT END-FIRE MODE:\n'); fprintf('---\n');
</div><span class="text_page_counter">Trang 10</span><div class="page_container" data-page="10">fprintf('(3) END-FIRE (p=1)\n\n');
SELECT_end = str2num(input('SELECT = ', ));'s'
(SELECT_end== 1)|(SELECT_end == 2)|(SELECT_end == 3)if
ERR = 0; endend
%---Numerical results from
pattern---if (SELECT_end ~= 3)
%---HPBW(From
for i=1:length(U) if U(i)<HP_dB
HPBW=angle(i)+angle(i-1);
</div><span class="text_page_counter">Trang 11</span><div class="page_container" data-page="11">endendelse
%---HPBW(From
endfor i=imax:-1:2 if U(i)<HP_dB
HPBW=angle(imax-i)+angle(imax-i+1); break;
endend
%---FNBW(From
pattern)---for i=imax:-1:2
U(i)<1e-4 if % set "zero" point to be less than 1e-4
FNBW=angle(imax-i)+angle(imax-i+1); break;
endend
%---Directivity(From
%---Create
output---if(DEVICE == 2) fid = fopen(FILNAM,'wt');
</div><span class="text_page_counter">Trang 12</span><div class="page_container" data-page="12">if (SELECT_end == 1)|(SELECT_end == 2)|(imax == 1)fprintf(fid,'\n\nOutput parameters:\n---');fprintf(fid,'\nInput impedance R (ohms)) = %6.4f',R);fprintf(fid,'\nAxial Ratio AR (dimesionless) = %6.4f',AR);fprintf(fid,'\nRelative phase velocity ratio p = %6.4f',p);fprintf(fid,'\n\nDirectivity:');
fprintf(fid,'\n A1. Approximate(10-33) (dimensionless) = %6.4f',D_app);fprintf(fid,'\n A2. Approximate(10-33) (in dB) = %6.4f',D_app_dB);fprintf(fid,'\n\n');
fprintf(fid,'\n\
fprintf(fid,'BAD DESIGN! MAXIMUM IS NOT AT 0 DEGREES!\n');
fprintf(fid,'PLEASE SEE THE PLOTTED RADIATION PATTERN FOR DETAILS.\n');
endif(DEVICE == 2) fclose(fid);
r = 0.3e-3;width = cylinder2strip(r);feedheight = 3*r;D = 56e-3;radius = D/2;turns = 6;pitch = 13;
spacing = helixpitch2spacing(pitch,radius);side = 600e-3;
radiusGP = side/2;
hx = helix('Radius',radius,'Width',width,'Turns',turns,'Spacing',spacing);fc = 1.65e9;
relativeBW = 0.45; BW = relativeBW*fc;
hx = helix('Radius',radius,'Width',width,'Turns',turns);figure;
show(hx);
</div><span class="text_page_counter">Trang 13</span><div class="page_container" data-page="13">Nf1 = 15;Nf2 = 20;fmin = 0.3e9;fmax = 0.7e9; fstep = 0.1e9;
fband1 = linspace(fmin,1.3e9,Nf1);fband2 = linspace(fmin,fmax,Nf2);freq = unique([fband1,fband2]);Nf = length(freq);D = nan(1,Nf);f_eng = freq./1e9;f_str = ;'G'
fig1 = figure;
for i = 1:length(freq) D(i) = pattern(hx,freq(i),0,90); figure(fig1)
plot(f_eng,D,'x-') grid on
axis([f_eng(1) f_eng(end) 9 16 ]) xlabel(['Frequency (' f_str 'Hz)']) ylabel('Directivity (dBi)')
title('Peak Directivity Variation vs. Frequency') drawnow
f = 500e6;figure(1)show(hx)figure(2)pattern(hx, f)figure(3)patternElevation(hx,f);figure(4)patternAzimuth(hx,f)figure(5)charge(hx, 93.5e6)
%impedance of the antenna
figure('name' 'Impedance', )impedance(hx, 1.5e8:10e6:f)
%Reflection Coeffcient of the antenna
figure('name', 'Reflection coefficient')S = sparameters(hx, 1.5e8:10e6:f,70);rfplot(S)
%Return Loss of the antenna
figure('name', 'Return Loss')returnLoss(hx, 1.5e8:10e6:f,70)
%VSWR of the antenna
figure('name', 'VSWR')vswr(hx, 1.5e8:10e6:f,70)directivity = pattern(hx, f, 0, 90);
disp('The directivity of the antenna in the direction from 0 degree');
</div><span class="text_page_counter">Trang 14</span><div class="page_container" data-page="14">Input Parameters Description% ---
% - theta (in degrees) must be a row vector from 0 to 360 degrees% - rho (in dB) must be a row vector
% - rmin (in dB) sets the minimum limit of the plot (e.g., -60 dB)% - rmax (in dB) sets the maximum limit of the plot (e.g., 0 dB)% - rticks is the # of radial ticks (or circles) desired. (e.g., 4)% - linestyle is solid (e.g., '-') or dashed (e.g., '--')%
function hpol = polar_dB(theta,rho,rmin,rmax,rticks,line_style)
% Convert degrees into radians
theta = theta * pi/180;
% Font size, font style and line width parameters
font_size = 16;font_name = 'Times';line_width = 1.5;
</div><span class="text_page_counter">Trang 15</span><div class="page_container" data-page="15">error('Requires 5 or 6 input arguments.')
elseif nargin == 5
if isstr(rho)line_style = rho;rho = theta;[mr,nr] = size(rho);
if mr == 1theta = 1:nr;
th = (1:mr)';theta = th(:,ones(1,nr));
line_style = 'auto';
endelseif nargin == 1
line_style = 'auto';rho = theta;[mr,nr] = size(rho);
if mr == 1theta = 1:nr;
th = (1:mr)';theta = th(:,ones(1,nr));
'DefaultTextFontName', font_name, ...
'DefaultTextFontSize', font_size, ...
'DefaultTextFontWeight', get(cax, 'FontWeight') )
% only do grids if hold is off
</div><span class="text_page_counter">Trang 16</span><div class="page_container" data-page="16">hold ;on
% v returns the axis limits
% changed the following line to let the y limits become negative
hhh=plot([0 max(theta(:))],[min(rho(:)) max(rho(:))]);v = [get(cax,'xlim') get(cax,'ylim')];
ticks = length(get(cax,'ytick'));delete(hhh);
% check radial limits (rticks)
if rticks > 5 % see if we can reduce the number
if rem(rticks,2) == 0rticks = rticks/2;
elseif rem(rticks,3) == 0rticks = rticks/3;
% define a circle
th = 0:pi/50:2*pi;xunit = cos(th);yunit = sin(th);
% now really force points on x/y axes to lie on them exactly
inds = [1:(length(th)-1)/4:length(th)]; xunits(inds(2:2:4)) = zeros(2,1); yunits(inds(1:2:5)) = zeros(3,1);rinc = (rmax-rmin)/rticks;
% label r
% change the following line so that the unit circle is not multiplied
% by a negative number. Ditto for the text locations.
for i=(rmin+rinc):rinc:rmax is = i - rmin;
plot(xunit*is,yunit*is, ,'-' 'color',tc,'linewidth',0.5);text(0,is+rinc/20,[' ' num2str(i)],'verticalalignment' 'bottom',);
% plot spokes
th = (1:6)*2*pi/12;cst = cos(th); snt = sin(th);cs = [-cst; cst];sn = [-snt; snt];
plot((rmax-rmin)*cs,(rmax-rmin)*sn, ,'-' 'color',tc,'linewidth',0.5);
% plot the ticks
george=(rmax-rmin)/30; % Length of the ticks
th2 = (0:36)*2*pi/72; cst2 = cos(th2); snt2 = sin(th2);
cs2 = [(rmax-rmin-george)*cst2; (rmax-rmin)*cst2];sn2 = [(rmax-rmin-george)*snt2; (rmax-rmin)*snt2];plot(cs2,sn2, ,'-' 'color',tc,'linewidth',0.15); % 0.5
</div><span class="text_page_counter">Trang 17</span><div class="page_container" data-page="17">% Changed the next line to make the spokes long enough
rt = 1.1*(rmax-rmin);
for i = 1:max(size(th))
90)),'horizontalalignment','center' );
text(rt*cst(i),rt*snt(i),int2str(abs(i*30-if i == max(size(th))loc = int2str(90);
elseif i*30+90<=180loc = int2str(i*30+90); else
% set axis limits
% Changed the next line to scale things properly
% transform data to Cartesian coordinates.
% changed the next line so negative rho are not plotted on the other side
for i = 1:length(rho) (rho(i) > rmin)if
theta(i)*180/pi >=0 & theta(i)*180/pi <=90if
xx(i) = (rho(i)-rmin)*cos(pi/2-theta(i)); yy(i) = (rho(i)-rmin)*sin(pi/2-theta(i)); elseif theta(i)*180/pi >=90
xx(i) = (rho(i)-rmin)*cos(-theta(i)+pi/2); yy(i) = (rho(i)-rmin)*sin(-theta(i)+pi/2); elseif theta(i)*180/pi < 0
xx(i) = (rho(i)-rmin)*cos(abs(theta(i))+pi/2); yy(i) = (rho(i)-rmin)*sin(abs(theta(i))+pi/2); end
else
xx(i) = 0; yy(i) = 0; end
end
% plot data on top of grid
if strcmp(line_style,'auto')
</div><span class="text_page_counter">Trang 18</span><div class="page_container" data-page="18">q = plot(xx,yy,line_style);
endif nargout > 0
hpol = q;
endif ~hold_state
% reset hold state
if ~hold_state, set(cax,'NextPlot',next); end