?? mmse_q.m
字號(hào):
function [p_MMSE]=MMSE_Q(snr_in_dB)
% Wireless Communications
% ZF & MMSE : Simulation
E=1;
tap=2;
SNR=10^(snr_in_dB/10);
sgma=E/sqrt(SNR);
p_MMSE=0;
N=5000;
for i=1:N,
x=1/sqrt(2)*(sign(randn(2,1))+sqrt(-1)*sign(randn(2,1)));
h0=(randn(2,1)+j*randn(2,1))*sqrt(1/2);
h1=(randn(2,1)+j*randn(2,1))*sqrt(1/2);
% pass the channel
H=diag(h0)+diag(h1(1:tap-1),-1);
y=H*x;
% add AWGN
y=y+(randn(2,1)+j*randn(2,1))*sgma/sqrt(2);
% MMSE equalizer
Ryy=H*H'+sgma^2*eye(tap);
Ryx=H;
C=(inv(Ryy)*Ryx)';
d=1/sqrt(2)*(sign(real(C*y))+sign(imag(C*y))*sqrt(-1));
p_MMSE=p_MMSE+sum(x~=d);
end;
p_MMSE=p_MMSE/tap/N;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -