資源簡介
混沌信號是用龍格庫塔方法產生的,自己編寫的同步擠壓小波變換程序用以分離正余弦函數/ECG信號的混沌干擾
代碼片段和文件信息
%%?Generating?chaotic?signals產生混沌信號
%?Duffing?x‘‘+cx‘-f^2*x+d*x^3=P*cos(f*t);
L=10000;
h=0.04;??????%step
f0=0.2;c=0.05;d=1;f=2;P=10;
Fs=10;
u=zeros(1L);
v=zeros(1L);
%?二階微分方程的四階龍格庫塔方法
for?i=1:L-1
????k1=v(i);
????l1=-c*v(i)+f0^2*u(i)-d*u(i)^3+P*cos(f*i/10);
????k2=v(i)+1/2*h*k1;
????l2=-c*(v(i)+1/2*h*l1)+f0^2*(u(i)+1/2*h*l1)-d*(u(i)+1/2*h*l1)^3+P*cos(f*(i/Fs+h/2));
????k3=v(i)+1/2*h*k2;
????l3=-c*(v(i)+1/2*h*l2)+f0^2*(u(i)+1/2*h*l2)-d*(u(i)+1/2*h*l2)^3+P*cos(f*(i/Fs+h/2));
????k4=v(i)+h*k3;
????l4=-c*(v(i)+h*l3)+f0^2*(u(i)+h*l3)-d*(u(i)+h*l3)^3+P*cos(f*(i/Fs+h));
????u(i+1)=u(i)+h*(k1+2*k2+2*k3+k4)/6;
????v(i+1)=v(i)+h*(l1+2*l2+2*l3+l4)/6;
end
cha=u(round(L/2):L);
figure(1);
%%?input?signals?給輸入信號加入混沌干擾
t=0:1/Fs:(length(cha)-1)/Fs;
m=sin(3*t)+cos(5*t);
%?[data1Fstim]=rdsamp(‘mitdb/100‘[]length(cha));
%?t=0:1/Fs:(length(cha)-1)/Fs;
%?data2=data1(:1)‘;
%?m=data2;
f=m+cha;
subplot(311);
plot(tcha);
title(‘e‘);
subplot(312);
plot(tm);
title(‘m‘);
subplot(313);
plot(tf);
title(‘m+e‘);
%%?CWT
figure(2);
W_ab=cwt(f1:200‘db1‘‘plot‘);
title(‘Th
- 上一篇:通用彈道仿真計算程序V1.0-源碼
- 下一篇:基于遺傳算法的旅游全國的路徑最優問題
評論
共有 條評論