fs %信号采样频率。
s% signal %假设信号频率低,能整除f1和f2.如果不能。则需要插值
f1=1000;
f2=100;
n=1/fs; %
noise1=rand(1,1/f1);
noise2=rand(1,1/f2);
for i=1:length(signal)
for j =1:(f1/fs)
x((i-1)*(f1/fs)+j) = signal(i) +noise1(j);
end
end
for i=1:length(signal)
for j =1:(f2/fs)
x((i-1)*(f2/fs)+j) = signal(i) +noise1(j);
end
end
温馨提示:内容为网友见解,仅供参考