?? ws2.m
字號:
p=0.1;N=500000;
u=randn(1,N);c=sqrt(p);
u=u*c;power_u=var(u);
figure(1)
subplot(221)
plot(u(1:100));grid;
ylabel('u(n)');
title('the Gaussian white noise');
n=200;
step=4*pi/n;
t=-3*pi:step:3*pi;
y=A*sin(t);
subplot(222)
plot(t,y);grid;
xlabel('t');ylabel('y');
title('the input signal y=Asin(2*pi*f*t)');
A=0.03;
a=1;
b=1;
U=a^2/(4*b);
d=0:0.01:2;
SNR=2^0.5*2.*exp(-2*U./(d.^2))./(d.^2);
subplot(223);
plot(d,SNR);grid;
xlabel('d/V');ylabel('SNR/dB');
title('the relation between S/N and noise strength ');
a1=0:0.1:2
d1=1.05;
U1=a1.^2/(4*b);
SNR1=2^0.5*2.*exp(-2.*U1/(d1^2))/(d1^2);
subplot(224);
plot(a1,SNR1);grid;
xlabel('a1');ylabel('SNR/dB');
title('the relation between S/N and a1 ');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -