Matlab 程序,请高手帮忙解释一下,最好每一句都有解释,谢谢帮忙~! 50
forn=1:1:2000s=sin(0.075*pi*n);fori=1:1:2000v=0.8*randn(2000,1);ar=[1,1/2];v1=filter(...
for n=1:1:2000
s = sin(0.075*pi*n);
for i=1:1:2000
v = 0.8*randn(2000,1);
ar = [1, 1/2];
v1 = filter(1,ar,v);
x = s + v1;
ma = [1, -0.8, 0.4 , -0.2];
v2 = filter(ma,1,v);
L = 5;
hlms = adaptfilt.lms(5);
hnlms = adaptfilt.nlms(5);
[mumaxlms,mumaxmselms] = maxstep(hlms,x)
[mumaxnlms,mumaxmsenlms] = maxstep(hnlms);
hlms.step = mumaxmselms/30;
hnlms.step = mumaxmsenlms/20;
[ylms,elms] = filter(hlms,v2,x);
[ynlms,enlms] = filter(hnlms,v2,x);
bw = firwiener(L-1,v2,x);
yw = filter(bw,1,v2);
ew = x - yw;
elms = x –ylms;
enlms = x – ynlms;
sw(i)=sw(i-1)+ew;
slms(i)=slms(i-1)+elms;
snlms(i)=snlms(i-1)+enlms;
sw(i);
slms(i);
snlms(i);
end
sumw= sw(i)/n;
suml= slms(i)/n;
sumn= snlms(i)/n;
sumw;
suml;
sumn;
end 展开
s = sin(0.075*pi*n);
for i=1:1:2000
v = 0.8*randn(2000,1);
ar = [1, 1/2];
v1 = filter(1,ar,v);
x = s + v1;
ma = [1, -0.8, 0.4 , -0.2];
v2 = filter(ma,1,v);
L = 5;
hlms = adaptfilt.lms(5);
hnlms = adaptfilt.nlms(5);
[mumaxlms,mumaxmselms] = maxstep(hlms,x)
[mumaxnlms,mumaxmsenlms] = maxstep(hnlms);
hlms.step = mumaxmselms/30;
hnlms.step = mumaxmsenlms/20;
[ylms,elms] = filter(hlms,v2,x);
[ynlms,enlms] = filter(hnlms,v2,x);
bw = firwiener(L-1,v2,x);
yw = filter(bw,1,v2);
ew = x - yw;
elms = x –ylms;
enlms = x – ynlms;
sw(i)=sw(i-1)+ew;
slms(i)=slms(i-1)+elms;
snlms(i)=snlms(i-1)+enlms;
sw(i);
slms(i);
snlms(i);
end
sumw= sw(i)/n;
suml= slms(i)/n;
sumn= snlms(i)/n;
sumw;
suml;
sumn;
end 展开
1个回答
展开全部
for n=1:1:2000 ‘赋值语句,令n=1,2,3,4....2000
s = sin(0.075*pi*n); s=sin(0.075nπ)
for i=1:1:2000 同上
v = 0.8*randn(2000,1); randn(2000,1)是随机产生一个2000X1的矩阵
ar = [1, 1/2]; ar是行矩阵
v1 = filter(1,ar,v); 这个还不太明白,大体是根据1和ar两个矢量从v中得到v1
x = s + v1; 加法
ma = [1, -0.8, 0.4 , -0.2]; 行向量
v2 = filter(ma,1,v); 同上
L = 5; 赋值
下面是比较专业的函数,没见过,抽时间看一下再回答你吧
s = sin(0.075*pi*n); s=sin(0.075nπ)
for i=1:1:2000 同上
v = 0.8*randn(2000,1); randn(2000,1)是随机产生一个2000X1的矩阵
ar = [1, 1/2]; ar是行矩阵
v1 = filter(1,ar,v); 这个还不太明白,大体是根据1和ar两个矢量从v中得到v1
x = s + v1; 加法
ma = [1, -0.8, 0.4 , -0.2]; 行向量
v2 = filter(ma,1,v); 同上
L = 5; 赋值
下面是比较专业的函数,没见过,抽时间看一下再回答你吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询