您好,欢迎访问三七文档
自适应噪声对消器clearallclct=0:1/1000:10-1/1000;s=sin(2*pi*t);snr=10;s_power=var(s);%var函数:返回方差值linear_snr=10^(snr/10);factor=sqrt(s_power/linear_snr);noise=randn(1,length(s))*factor;x=s+noise;%由SNR计算随机噪声x1=noise;%噪声源输入x2=noise;w1=0;%权系数初值w2=0;e=zeros(1,length(x));y=0;u=0.05;fori=1:10000%LMS算法y=w1*x1(i)+w2*x2(i);e(i)=x(i)-y;w1=w1+u*e(i)*x1(i);w2=w2+u*e(i)*x2(i);endfigure(1)subplot(3,1,1)plot(t,x);title('带噪声正弦信号')axis([010-1.21.2]);subplot(3,1,2)plot(t,noise);title('噪声信号')axis([010-1.21.2]);subplot(3,1,3)plot(t,e);title('自适应噪声对消器')axis([010-1.21.2]);
本文标题:自适应噪声对消器
链接地址:https://www.777doc.com/doc-5340443 .html