线阵分析
1 %% 2 %linear array 3 % number of elements to mainlobe and sidelobe beamwidth, directivity 4 % different amplitude taper 5 % 1. W(n) = 1 ; 6 % 2. W(n) = abs((2*n-1)/N-1); 7 % 3. W(n) = abs(((2*n-1)/N)^2-1); 8 % 4. W(n) = power(cos(((2*n-1)/N-1)*pi/2),1) 9 % 5. W(n) = power(cos(((2*n-1)/N-1)*pi/2),2) 10 % 6. W(n) = power(cos(((2*n-1)/N-1)*pi/2),3) 11 % 7. W(n) = power(cos(((2*n-1)/N-1)*pi/2),4) 12 13 clc; 14 clear all; 15 close all; 16 N = 9; % 17 N = power(2,2:1:N);%elements number array 18 Ka =7 ; %antenna element amplitude taper conf 19 M = 2000; % theta sample points 20 AF = zeros(length(N),M);% array factor buffer 21 E0 = zeros(length(N),M);% 22 H0 = zeros(length(N),M);% 23 U0= zeros(length(N),M);% 24 f0 = 1e9; 25 lambda = 3e8/f0; 26 d = lambda/2;% elements spacing 27 k =2*pi/lambda;% wave constant 28 imp = 120*pi;%wave impdance 29 I0= 1; 30 r = 100; 31 l = 0.01; 32 BeamWidth = zeros(Ka,length(N)); 33 D = zeros(Ka,length(N)); 34 tau = zeros(Ka,length(N)); 35 for m = 1:1:Ka 36 figure; 37 for i = 1:1:length(N) 38 theta = linspace(0,pi,M)+pi/10e10; 39 phi = linspace(0,2*pi,M); 40 af(i,:) = zeros(1,M); 41 a = 0; 42 b = 0; 43 for j = 1:1:N(i) 44 switch(m) 45 case 1 46 a= a+ 1; 47 b = b+1; 48 af(i,:) = af(i,:)+ exp(1i*(j-1)*k*d*cos(theta)); 49 50 case 2 51 a= a+power(cos(((2*j-1)/N(i)-1)*pi/2),1); 52 b = b + power(cos(((2*j-1)/N(i)-1)*pi/2),2); 53 af(i,:) = af(i,:)+ exp(1i*(j-1)*k*d*cos(theta))*power(cos(((2*j-1)/N(i)-1)*pi/2),1); 54 55 case 3 56 a= a+power(cos(((2*j-1)/N(i)-1)*pi/2),2); 57 b = b + power(cos(((2*j-1)/N(i)-1)*pi/2),4); 58 af(i,:) = af(i,:)+ exp(1i*(j-1)*k*d*cos(theta))*power(cos(((2*j-1)/N(i)-1)*pi/2),2); 59 60 case 4 61 a= a+power(cos(((2*j-1)/N(i)-1)*pi/2),3); 62 b = b + power(cos(((2*j-1)/N(i)-1)*pi/2),6); 63 af(i,:) = af(i,:)+ exp(1i*(j-1)*k*d*cos(theta))*power(cos(((2*j-1)/N(i)-1)*pi/2),3); 64 65 case 5 66 a= a+power(cos(((2*j-1)/N(i)-1)*pi/2),4); 67 b = b + power(cos(((2*j-1)/N(i)-1)*pi/2),8); 68 af(i,:) = af(i,:)+ exp(1i*(j-1)*k*d*cos(theta))*power(cos(((2*j-1)/N(i)-1)*pi/2),4); 69 case 6 70 a= a+power(0.5+0.5*cos(((2*j-1)/N(i)-1)*pi/2),1); 71 b = b + power(0.5+0.5*cos(((2*j-1)/N(i)-1)*pi/2),2); 72 af(i,:) = af(i,:)+ exp(1i*(j-1)*k*d*cos(theta))*power(0.5+0.5*cos(((2*j-1)/N(i)-1)*pi/2),1); 73 74 case 7 75 a= a+power(0.33+0.67*cos(((2*j-1)/N(i)-1)*pi/2),1); 76 b = b + power(0.33+0.67*cos(((2*j-1)/N(i)-1)*pi/2),2); 77 af(i,:) = af(i,:)+ exp(1i*(j-1)*k*d*cos(theta))*power(0.33+0.67*cos(((2*j-1)/N(i)-1)*pi/2),1); 78 79 80 end 81 end 82 af(i,:) = abs(af(i,:)/N(i)); 83 E0(i,:) = af(i,:) *imp; 84 Wav = real(E0(i,:) .* E0(i,:) )/2/imp; 85 Prad = imp*pi*3*(I0*l/lambda)^2; 86 theta = theta/pi*180; 87 af(i,:)= 10*log10(af(i,:)/max(af(i,:))); 88 U(i,:)= real(E0(i,:) .*E0(i,:))*r^2/2/imp; 89 U(i,:)= 10*log10(U(i,:)/max(U(i,:))); 90 plot(theta,U(i,:)); 91 hold on; 92 axis([0 180 -120 0]); 93 error = 0.01; 94 af(i,:)=U(i,:); 95 pos1_3dB = []; 96 pos_max = find(max(af(i,:))==af(i,:)); 97 while(isempty(pos1_3dB)) 98 pos1_3dB = find(abs(((af(i,1:pos_max)-af(i,pos_max)))+3) < error); 99 error = error + 0.005; 100 end 101 error = 0.01; 102 pos2_3dB = []; 103 while(isempty(pos2_3dB)) 104 pos2_3dB = find(abs(((af(i,pos_max:end)-af(i,pos_max)))+3) < error); 105 error = error + 0.005; 106 end 107 BeamWidth(m,i)= (theta(pos2_3dB(1)+pos_max)-theta(pos1_3dB(end))); 108 D(m,i) = 10*log10(a^2/b); 109 tau(m,i) = a^2/b/N(i); 110 end 111 switch(m) 112 case 1 113 % title('\[{W_n} = 1\]1'); 114 text(80,5,'$$W_{n}= 1$$','interpreter','latex','fontsize',10); 115 % text(0.5,0.5,'$$f(x)=\frac{sin(x)}{x}$$','interpreter','latex','fontsize',20) 116 case 2 117 text(50,5,'$$W_{n}=cos\left [ \left ( \frac{2n-1}{N} -1\right )\frac{\pi}{2} \right ]$$','interpreter','latex','fontsize',10) 118 case 3 119 text(50,5,'$$W_{n}=cos^{2}\left [ \left ( \frac{2n-1}{N} -1\right )\frac{\pi}{2} \right ]$$','interpreter','latex','fontsize',10) 120 case 4 121 text(50,5,'$$W_{n}=cos^{3}\left [ \left ( \frac{2n-1}{N} -1\right )\frac{\pi}{2} \right ]$$','interpreter','latex','fontsize',10) 122 case 5 123 text(50,5,'$$W_{n}=cos^{4}\left [ \left ( \frac{2n-1}{N} -1\right )\frac{\pi}{2} \right ]$$','interpreter','latex','fontsize',10) 124 case 6 125 text(50,5,'$$W_{n}=0.5+0.5cos\left [ \left ( \frac{2n-1}{N} -1\right )\frac{\pi}{2} \right ]$$','interpreter','latex','fontsize',10) 126 case 7 127 text(50,5,'$$W_{n}=0.33+0.67cos\left [ \left ( \frac{2n-1}{N} -1\right )\frac{\pi}{2} \right ]$$','interpreter','latex','fontsize',10) 128 129 end 130 end
波束宽度
增益
效率
OPTIMISM, PASSION & HARDWORK