fig10_5.m
上传用户:szahd2008
上传日期:2020-09-25
资源大小:1275k
文件大小:1k
- % Use this code to produce figure 10.5a and 10.5b based on equation 10.34
- clear all
- close all
- eps = 0.00001;
- k = 2*pi;
- theta = -pi : pi / 10791 : pi;
- var = sin(theta);
- nelements = 8;
- d = 1; % d = 1;
- num = sin((nelements * k * d * 0.5) .* var);
- if(abs(num) <= eps)
- num = eps;
- end
- den = sin((k* d * 0.5) .* var);
- if(abs(den) <= eps)
- den = eps;
- end
- pattern = abs(num ./ den);
- maxval = max(pattern);
- pattern = pattern ./ maxval;
- figure(1)
- plot(var,pattern)
- xlabel('sine angle - dimensionless')
- ylabel('Array pattern')
- grid
- figure(2)
- plot(var,20*log10(pattern))
- axis ([-1 1 -60 0])
- xlabel('sine angle - dimensionless')
- ylabel('Power pattern [dB]')
- grid;
- figure(3)
- theta = theta +pi/2;
- polar(theta,pattern)
- title ('Array pattern')