MIMO_(matlab发射端迫零预处理)
实现发射端迫零预处理,4x4
clc; clear; Tx = 4; %发送天线 Rx = 4; %接收天线 SNRdB = 30; %信噪比 N = 1000000; %序列长度 for SNR = 0 : SNRdB error = 0; for i = 1:N x = round(rand(Tx,1)); %产生0,1序列 Bpsk = x*2-1; %Bpsk调制 H = sqrt(1/2)*(randn(Tx,Rx) + 1j*randn(Tx,Rx)); %信道 W = inv(H); %求逆 a = sqrt(4/trace(W*W)); %求a s = a*H*W*Bpsk; %无噪声 sigma = 1/(10^(SNR/10)); noise = sqrt(sigma/2)*(randn(Tx,1)+1i*randn(Tx,1)); r = s + noise; %接收信号 y = (((1/a)*r)>=0)-(((1/a)*r)<0); %解调 error = error + sum(y~=Bpsk); end ber1(SNR+1) = error/(4*N); %计算误码率 end figure x=0:SNRdB; grid on semilogy (x,ber1,-ok);hold on; axis([0 SNRdB 10^-4 1]);xlabel(SNR(dB));ylabel(BER); legend(迫零预处理); title(迫零预处理)
结果如图所示: