能运行,结果不对,自己看不出来问题,急啊!!!
a=0.3; % 设置a的初值;
Te=1;
k=0;
t=0:1000-1
for ttt=1:length(t)
fs(ttt)=0;
end
s=exp(i*2*pi*10/1000*t+i*2*pi*10*(t/1000).^2);
hudu=5;
for k1=1:lenth(t)-1
x(k1)=0;
if (k1==1)
y(1)=0.3;
else
y(k1)=0;
end
end
%用morlet小波进行分析;
kk=length(t);
count=1;
for count=1:lenth(t)-1
wa=cwt(s,a,'morl');
fai=angle(wa);
for k2=2:kk
y(k1)=hudu/((fai(k1)-fai(k1-1))/Te); %求Db;
if ( abs(y(k1)-y(k1-1))/abs(y(k1-1))<0.001) %判断是否满足条件;
k=k+1;
x(k)=y(k1-1); %赋值;
a=x(k); %继续求a;
count=count+1;
break;
end
end
end