?? lmmse.asv
字號(hào):
clc
clear all
Nt = 2; % the number of transmitted antennas
Nr = 2; % the number of transmitted antennas
SNR = 20; % the system signal-to-noise ratio with dB
snr = 10.^(0.1*SNR); % the signal-to-noise with normal scale
snrp=snr;
T=2:1:30; % the number of symbol periods
Tp=T;
% Td=T-Tp;
hhh=zeros(1,length(T));
ggg=zeros(1,length(T));
hm=zeros(Nt*Nr,1); % channel mean
hh=eye(Nt*Nr); % channel covariance
% Hw=ones(Nr*Nt,1);
% Hw =sqrt(1/2)* (randn(Nr*Nt,1) + j* randn(Nr*Nt,1)); % channel
for ii = 1:length(T)
waitbar(ii/length(T));
Hw =sqrt(1/2)* (randn(Nr*Nt,1) + j* randn(Nr*Nt,1)); % channel
%%%% LMMSE estimator
p=eye(Tp(ii)*Nr,Nt*Nr); % training symbol
pp=inv(p'*p)*p'; % wei ni
vv=eye(Tp(ii)*Nr); % noise covariance
F=sqrt(snrp)*hh*p'*inv(snrp*p*hh*p'+vv');
f0=(eye(size(F*p))-sqrt(snrp)*F*p)*hm;
v=sqrt(1/2)*(randn(Nr*Tp(ii),1) + j*randn(Nr*Tp(ii),1)); % training noise
z=sqrt(snrp)*p*Hw+v; % receive
g=F*z+f0; % estimation
hhh(ii)=abs(Hw(2));
ggg(ii)=abs(g(2));
ww= waitbar(ii/length(T));
end
close(ww)
% figure
plot(T,hhh,'ko-')
hold on
plot(T,ggg,'k*-')
hold on
grid on
title('TX#-RX#')
% set(gca,'Xtick',[0,5,10,15,20,25,30],'Ttick',[-3,-2,-1,0,1,2,3,4,5])
axis([0 30 -3 5])
% xlabel('T')
% ylabel('h')
% legend('h','g')
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -