%This program is designed to form broadband beam using conventional TLS eigenfilter
%Using ULA
clear all;
clear all;
N=6; %the number of the sensors
L=20; %the number of reference filter laps
d0=0.04; %the spacing the array
c=340; %the speed of sound
f_l=200; %the lowest frequency
f_u=4000; %the highest frequency
step1=10;
f=[f_l:step1:f_u]; %the signal frequency band
fs=2*f_u; %the sampling frequency
Ts=1/fs; %the sampling period
omega=2*pi*f/fs; %the signal anglular frequency
lambda_u=c/f_u; %the wavelength of the highest frequency
p=zeros(1,N); %the position of each sensor
step2=180;
theta=[0:pi/step2:pi]; %the angle
thetaT=pi/2; %the steered signal angle
%d2lambda=; %d to lambda
Theta_p1=70/180*pi;
Theta_p2=110/180*pi;
%Omega_p=
Theta_s1=pi/3;
Theta_s2=2*pi/3;
%Omega_s=
alpha=1;
omegac=1500/4000*pi;
thetac=pi/3;
for(l=1:L)
e(l,:)=exp(-j*(l-1)*omega);
end
for(n=1:N)
d(n)=d0*(n-1);
tau(n,:)=d(n)*cos(theta)*fs/c;
end
%compute Q_p Q_e and Q_eig
M=L*N;
step3=1000;
theta=[Theta_p1:pi/step3:Theta_p2];
theta1=[0:pi/step3:Theta_s1];
theta2=[Theta_s2:pi/step3:pi];
theta3=[0:pi/step3:pi];
omega1=[0:pi/step3:pi];
for(p=1:M)
disp(p);
k=mod(p-1,L);
n=floor((p-1)/L)+1;
a=k;
b=d(n)*fs/c;
gamma=0;
%compute A
A1(p)=trapz(theta,omega((f_u-f_l)/step1+1)*sinc(omega((f_u-f_l)/step1+1)*(a+b*cos(theta))/pi))...
-trapz(theta,omega(1)*sinc(omega(1)*(a+b*cos(theta))/pi));
% if b==0
% if a==0
% A(p)=cos(gamma)*(Theta_p2-Theta_p1)*(omega((f_u-f_l)/step1+1)-omega(1));
% else
% A(p)=(sin(omega((f_u-f_l)/step1+1)*a+gamma)-sin(omega(1)*a+gamma))/a*(Theta_p2-Theta_p1);
% end
% elseif abs(b)>abs(a)
% thetan=acos(-a/b);
% if thetan>=Theta_p1 & thetan<=Theta_p2
% A(p)=trapz(theta,(sin(omega((f_u-f_l)/step1+1)*(a+b*cos(theta)))*b*sqrt(1-a^2/b^2)...
% .*(theta-thetan)+sin(gamma)*(a+b*cos(theta)))...
% ./((a+b*cos(theta))*b*sqrt(1-a^2/b^2).*(theta-thetan)))...
% -trapz(theta,(sin(omega(1)*(a+b*cos(theta)))*b*sqrt(1-a^2/b^2)...
% .*(theta-thetan)+sin(gamma)*(a+b*cos(theta)))...
% ./((a+b*cos(theta))*b*sqrt(1-a^2/b^2).*(theta-thetan)));
% else
% A(p)=trapz(theta,sin(omega((f_u-f_l)/step1+1)*(a+b*cos(theta)))./(a+b*cos(theta)))...
% -trapz(theta,sin(omega(1)*(a+b*cos(theta)))./(a+b*cos(theta)));
% end
% else
% A(p)=trapz(theta,sin(omega((f_u-f_l)/step1+1)*(a+b*cos(theta)))./(a+b*cos(theta)))...
% -trapz(theta,sin(omega(1)*(a+b*cos(theta)))./(a+b*cos(theta)));
% end
for(q=1:M)
%disp(q);
l=mod(q-1,L);
m=floor((q-1)/L)+1;
a=k-l;
b=(d(n)-d(m))*fs/c;
gamma=0;
%Qtot_e(p,q)=trapz(theta3,pi*sinc(a+b*cos(theta3)));
%Qtot_e(p,q)=trapz(theta3,pi*sinc(a+b*cos(theta3)));
Qtot_e(p,q)=pi*trapz(omega1,besselj(0,b*omega1).*cos(a*omega1));
%-trapz(theta3,omega(1)*sinc(omega(1)*(a+b*cos(theta3))/pi));
% Qtot_e1(p,q)=trapz(theta3,omega((f_u-f_l)/step1+1)*sinc(omega((f_u-f_l)/step1+1)*(a+b*cos(theta3))/pi))...
% -trapz(theta3,omega(1)*sinc(omega(1)*(a+b*cos(theta3))/pi));
% syms theta1 theta2;
% g1=subs('sinc(omega((f_u-f_l)/step1+1)*(a+b*cos(theta))/pi)');
% f1=inline('g1');
% g2=subs('sinc(omega(1)*(a+b*cos(theta))/pi)');
% f2=inline('g2');
% Q_ep(p,q)=quad(f1,Theta_p1,Theta_p2)-quad(f2,Theta_p1,Theta_p2);
% g3=subs('sinc(omega((f_u-f_l)/step1+1)*(a+b*cos(theta1))/pi)');
% f3=inline('g3');
% g4=subs('sinc(omega(1)*(a+b*cos(theta1))/pi)');
% f4=inline('g4');
% g5=subs('sinc(omega((f_u-f_l)/step1+1)*(a+b*cos(theta2))/pi)');
% f5=inline('g5');
% g6=subs('sinc(omega(1)*(a+b*cos(theta2))/pi)');
% f6=inline('g6');
% Q_es(p,q)=quad(f3,0,Theta_s1)-quad(f4,0,Theta_s1)+quad(f5,Theta_s2,pi)-quad(f6,Theta_s2,0);
% Q_ep1(p,q)=trapz(theta,omega((f_u-f_l)/step1+1)*sinc(omega((f_u-f_l)/step1+1)*(a+b*cos(theta))/pi))...
% -trapz(theta,omega(1)*sinc(omega(1)*(a+b*cos(theta))/pi));
% Q_es1(p,q)=trapz(theta1,omega((f_u-f_l)/step1+1)*sinc(omega((f_u-f_l)/step1+1)*(a+b*cos(theta1))/pi))...
% -trapz(theta1,omega(1)*sinc(omega(1)*(a+b*cos(theta1))/pi))...
% +trapz(theta2,omega((f_u-f_l)/step1+1)*sinc(omega((f_u-f_l)/step1+1)*(a+b*cos(theta2))/pi))...
% -trapz(theta2,omega(1)*sinc(omega(1)*(a+b*cos(theta2))/pi));
if b==0
if a==0
Q_ep(p,q)=cos(gamma)*(Theta_p2-Theta_p1)*(omega((f_u-f_l)/step1+1)-omega(1));
Q_es(p,q)=cos(gamma)*(Theta_s1+pi-Theta_s2)*(omega((f_u-f_l)/step1+1)-omega(1));
else
Q_ep(p,q)=(sin(omega((f_u-f_l)/step1+1)*a+gamma)-sin(omega(1)*a+gamma))/a*(Theta_p2-Theta_p1);
Q_es(p,q)=(sin(omega((f_u-f_l)/step1+1)*a+gamma)-sin(omega(1)*a+gamma))/a*(Theta_s1+pi-Theta_s2);
end
elseif abs(b)>abs(a)
thetan=acos(-a/b);
if thetan>=Theta_p1 & thetan<=Theta_p2
Q_ep(p,q)=trapz(theta,(sin(omega((f_u-f_l)/step1+1)*(a+b*cos(theta)))*b*sqrt(1-a^2/b^2)...
.*(theta-thetan)+sin(gamma)*(a+b*cos(theta)))...
./((a+b*cos(theta))*b*sqrt(1-a^2/b^2).*(theta-thetan)))...
-trapz(theta,(sin(omega(1)*(a+b*cos(theta)))*b*sqrt(1-a^2/b^2)...
.*(theta-thetan)+sin(gamma)*(a+b*cos(theta)))...
./((a+b*cos(theta))*b*sqrt(1-a^2/b^2).*(theta-thetan)));
Q_es(p,q)=trapz(theta1,sin(omega((f_u-f_l)/step1+1)*(a+b*cos(theta1)))./(a+b*cos(theta1)))...
-trapz(theta1,sin(omega(1)*(a+b*cos(theta1)))./(a+b*cos(theta1)))...
+trapz(theta2,sin(omega((f_u-f_l)/step1+1)*(a+b*cos(theta2)))./(a+b*cos(theta2)))...
-trapz(theta2,sin(omega(1)*(a+b*cos(theta2)))./(a+b*cos(theta2)));
elseif thetan<=Theta_s1 | thetan>=Theta_s2
Q_ep(p,q)=trapz(theta,sin(omega((f_u-f_l)/step1+1)*(a+b*cos(theta)))./(a+b*cos(theta)))...
-trapz(theta,sin(omega(1)*(a+b*cos(theta)))./(a+b*cos(theta)));
Q_es(p,q)=trapz(theta1,(sin(omega((f_u-f_l)/step1+1)*(a+b*cos(theta1)))*b*sqrt(1-a^2/b^2).*(theta1-thetan)+sin(gamma)*(a+b*cos(theta1)))...
./((a+b*cos(theta1))*b*sqrt(1-a^2/b^2).*(theta1-thetan)))...
-trapz(theta1,(sin(omega(1)*(a+b*cos(theta1)))*b*sqrt(1-a^2/b^2).*(theta1-thetan)+sin(gamma)*(a+b*cos(theta1)))...
./((a+b*cos(theta1))*b*sqrt(1-a^2/b^2).*(theta1-thetan)))...
+trapz(theta2,(sin(omega((f_u-f_l)/step1+1)*(a+b*cos(theta2)))*b*sqrt(1-a^2/b^2)...
.*(theta2-thetan)+sin(gamma)*(a+b*cos(theta2)))./((a+b*cos(theta2))*b*sqrt(1-a^2/b^2).*(theta2-thetan)))...
-trapz(theta2,(sin(omega(1)*(a+b*cos(theta2)))*b*sqrt(1-a^2/b^2).*(theta2-thetan)+sin(gamma)*(a+b*cos(theta2)))...
./((a+b*cos(theta2))*b*sqrt(1-a^2/b^2).*(theta2-thetan)));
end
Q_ep(p,q)=trapz(theta,sin(omega((f_u-f_l)/step1+1)*(a+b*cos(theta)))./(a+b*cos(theta)))...
-trapz(theta,sin(omega(1)*(a+b*cos(theta)))./(a+b*cos(theta)));
Q_es(p,q)=trapz(theta1,sin(omega((f_u-f_l)/step1+1)*(a+b*cos(theta1)))./(
TLS.rar_TLS宽带_hslogic算法仿真_光束_本征滤波器
版权申诉
138 浏览量
2022-07-14
12:19:42
上传
评论
收藏 2KB RAR 举报
钱亚锋
- 粉丝: 90
- 资源: 1万+
最新资源
- VHDL是VHSIC Hardware Description Language的缩写,全称是Very High Speed I
- Redis是一种流行的开源内存数据库,它提供了各种各样的命令和功能来处理数据 以下是一些常见的Redis命令以及它们的用法:
- 基于CYCLONE FPGA设计的出租车计价器Quartus工程VERILOG源码+课设报告文档.zip
- 基于C++的线段树和树状数组(免费提供全部源码)
- 使用 Redis 存储用户和他们的帖子.zip
- AI绘画实操(基础版)-推荐资料
- 基于SpringBoot+Mybatis+Redis的问答社交网站项目(免费提供全部源码)
- 基于springboot的新闻推荐系统带源码.rar
- 基于Web足球青训俱乐部管理后台系统开发带源码.zip
- 基于springboot的美容院管理系统.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈