資源簡介
且改主函數(shù)含有各個子函數(shù),整個函數(shù)是完整的。這個是將網(wǎng)上的互信息法進行改進,適用性更好。
代碼片段和文件信息
%確定仿真數(shù)據(jù)spcv2(空簧失氣),速度200,1通道(車體前部加速度)數(shù)據(jù)的互信息
clear
Data1=load?(‘t.mat‘);
Data=Data1(1:20487);
c=2048*0;
h=c+1:c+2000;
x=Data(h);%取2048個數(shù)據(jù)
for?t=0:20
a=t+1:length(x)+t;
y=Data(c+a);%x延遲個數(shù)據(jù)后的y數(shù)據(jù)
drelx=drawelem2(x);%對序列x進行不同元素的提取并按從小到大進行排序
drely=drawelem2(y);%對序列y進行不同元素的提取并按從小到大進行排序
stx=statx2(x);
sty=statx2(y);
MI(t+1)=mutualinformation22(xdrelxstxydrelysty);
end
MI
for?i=1:19
????if?MI(i+1) ????????t=i;
????????break
????end
end
t
figure(1)
plot(0:20MI‘--b.‘)
grid
xlabel(‘延遲時間‘);
ylabel(‘互信息‘);
%調(diào)用函數(shù)1
function?drelx=drawelem2(x)
%提取數(shù)組中不同元素,按從小到大排序?
%es=[1?2?3?3];%需提取的矩陣
es=sort(x);
%es=fix(esx*100)/100;
j=1;%設(shè)置初值
for?i=1:length(es)-1%矩陣各元素
評論
共有 條評論