t=0:0.0001:0.1; %时间间隔为0.0001,说明采样频率为10000Hz
x=square(2*pi*1000*t); %产生基频为1000Hz的方波信号
n=randn(size(t)); %白噪声
f=x; %在信号中加入白噪声
figure(1);
subplot(2,1,1);
plot(t,f); %画出原始信号的波形图
ylabel(
'幅值(V)'
);
xlabel(
'时间(s)'
);
title(
'原始信号'
);