function x = it(n,fs,N,A)
n=100
bi=ones(7,1);
bs=ones(7,1);
og=zeros(7,n);
bi(1)=0.95;%基波幅值下限
bi(2)=0;%相位下限
bi(3)=0.2;%振荡幅度下限
bi(4)=0.11;%起始时间下限
bi(6)=10;%振荡频率比下限
bi(7)=0;%衰减系数下限
bs(1)=1.05;%基波幅值上限
bs(2)=2*pi;%相位上限
bs(3)=0.9;%振荡幅度上限
bs(4)=N/fs-0.06;%起始时间上限
bs(6)=40;
bs(7)=10;
og(1,:)=(bs(1)-bi(1))*rand(1,n)+bi(1);
og(2,:)=(bs(2)-bi(2))*rand(1,n)+bi(2);
og(3,:)=(bs(3)-bi(3))*rand(1,n)+bi(3);
og(4,:)=(bs(4)-bi(4))*rand(1,n);
og(5,:)=og(4,:)+0.03*rand(1,n)+0.01;
og(6,:)=round((bs(6)-bi(6))*rand(1,n)+bi(6));
og(7,:)=5*round((bs(7)-bi(7))*rand(1,n)+bi(7));
%%%参数初始化
x=[];
if A==0
for i=1:n
[sgn t]=PQgenerator(5,0,fs,N,og(2,i),og(4,i),og(5,i),og(3,i),og(6,i),og(7,i));
x=[x;sgn];
end
else
for i=1:n
[sgn t]=PQgenerator(5,1,fs,N,og(2,i),og(4,i),og(5,i),og(3,i),og(6,i),og(7,i));
x=[x;sgn];
end
end
- 1
- 2
前往页