?? xindao2.m
字號:
function [hp0,hvx0,hvy0]=xindao2(Data_path,fs)
%計算海洋聲信道沖激響應(yīng)hl,Vx,Vy;
%輸入變量:海洋聲信道參數(shù)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 %計算海洋信道沖激相應(yīng);
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
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -