# MATLAB代做-python代做-FPGA代做-LMS滤波

### 时间：2019-4-1 13:12:01 点击：

核心提示：MATLAB代做-python代做-FPGA代做-LMS滤波...
clear all; close all;clc;
J=sqrt(-1);
source_number=3;
source_doa=[20 15 -30 80];
sensor_number=9;
snapshot_number=1000;
A=exp(-J*(0:sensor_number-1)'*pi*sin(source_doa*pi/180));
W=zeros(sensor_number,1);
M=100;
for k=1:M
length=2000;
M1=2;
M2=2;
M3=2;
M4=2;
S1=randint(length,1,M1);
S2=randint(length,1,M2);%干扰1
S3=randint(length,1,M3);%干扰2
S4=randint(length,1,M4);
ps1=pskmod(S1,M1);
ps2=pskmod(S2,M2);
ps3=pskmod(S3,M3);
ps4=pskmod(S4,M4);
t=151:150+snapshot_number;
s=[ps1(t), ps2(t),ps3(t),ps4(t)].';
SN1=0; %信噪比为0db
SN2=0;
SN3=20;%干噪比为10db
SN4=30;%干噪比为10db
sn=[SN1 SN2 SN3 SN4]';
noise1=randn(snapshot_number,1);
noise2=randn(snapshot_number,1);
noise3=randn(snapshot_number,1);
noise4=randn(snapshot_number,1);
ps1n=sigmerge(ps1(t),noise1,SN1);
ps2n=sigmerge(ps2(t),noise2,SN2);
ps3n=sigmerge(ps3(t),noise3,SN3);
ps4n=sigmerge(ps4(t),noise4,SN4);
S=[ps1n-noise1,ps2n-noise2,ps3n-noise3,ps4n-noise4]';
noisex=randn(sensor_number,snapshot_number)+j*randn(sensor_number,snapshot_number);
X=A*S+noisex;
S1=S(1,:);
w1=zeros(sensor_number,1);
y(1)=w1'*X(:,1);
e(1)=S1(1,1)-y(1);
% u(1)=0.0000002;
for n=2:snapshot_number
%u(n)=(e(n-1)*e(n-1))/(S1(1,n-1)*S1(1,n-1))*u(1);
w1=w1+0.00000001*X(:,n-1)*conj(e(n-1));%计算1000次加权列向量，再求均值
y(n)=w1'*X(:,n);
e(n)=S1(1,n)-y(n);%递推求LMS 权矢量
end
W_lms(:,k)=w1;
W_lms=sum(W_lms,2)/M;
cc=0;
for d=-pi/2:0.01:pi/2
cc=cc+1;
A1(:,cc)=[exp(j*(0:sensor_number-1)*pi*sin(d))]';
f_lms(1,cc)=W_lms'*A1(:,cc);
end
end
d=-pi/2:0.01:pi/2;
d=d.*(180/pi);
figure;
f_lms=f_lms/abs(max(max(f_lms)));
plot(d,10*log10(abs(f_lms).^2));
legend('lms');
%axis([-100 100 -70 0]);
xlabel('到达角(deg)');
ylabel('阵列输出功率增益(dB)');
figure;
n=2:snapshot_number;
plot(n,e(n));

联系：highspeedlogic

QQ ：1224848052

Tags:LMS滤波

• 百度搜索
• 查阅资料过程中
• 论坛发现
• 百度贴吧发现
• 朋友介绍
• 没有相关文章
• 大名：
• 内容：