⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xindao2.m

📁 水声信道传输特性进行仿真的程序
💻 M
字号:
function [hp0,hvx0,hvy0]=xindao2(Data_path,fs) 
%计算海洋声信道冲激响应hl,Vx,Vy;  
%输入变量:海洋声信道参数pi;
T_max=0;
k=1;      %特性阻抗;

   fid1=fopen(Data_path,'r');
   x = fscanf(fid1,'%f');
   status = fclose(fid1);
   line=size(x,1)/12;
   x1=x;
   x1=(reshape(x1,12,line))';
   A=zeros(1,line);
   t=zeros(1,line);
   Theta_In=zeros(1,line);
   j=0;
for i=1:1:line    
    A(i)=x1(i,10);   %幅度
    t(i)=x1(i,12);   %时延
    Theta_In(i)=-x1(i,6);    %掠射角
end
 [T_max,t_n] = max(t);

 hp0=zeros(1,round(T_max*fs)+1);
 hvx0=zeros(1,round(T_max*fs)+1);
 hvy0=zeros(1,round(T_max*fs)+1);
 [t_1,t_n1] =size(t);
 for i=1:1:t_n1                        %计算海洋信道冲激相应;
    hp0(1,round(t(i)*fs+1))=hp0(round(t(i)*fs)+1)+A(i);
    hvx0(1,round(t(i)*fs+1))=hvx0(round(t(i)*fs)+1)+k*A(i)*cos(Theta_In(i));
    hvy0(1,round(t(i)*fs+1))=hvy0(round(t(i)*fs)+1)+k*A(i)*sin(Theta_In(i));
end










⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -