mimo_zeroforcing.m

来自「MIMO_zeroforcing simulation」· M 代码 · 共 57 行

M
57
字号
function MIMO_zeroforcing

clear all;
close all;

M=2;    % modulation constellation points
TX=2;   % number of transmit antenna 
RX=2;   % number of receive antenna

N=5*TX*RX;   %data stream length
% AWGN nosie generation

SNR=[1:1:15];   %signal to noise ratio in dB
No=(10.^((-SNR/10)))/2;    %variance of the complex noise 
                          %SNR=10*log(Eb/No), Eb=1 for BPSK mod. with +-1
                          %the 1/2 factor for determination complex noise
                          

                         

% MIMO channel 

H=(randn(TX,N,length(No))+j*randn(TX,N,length(No)))/(sqrt(RX));
    % to normalize power of channel every tansmited siganl power divided between all of receiver antennas: RX  
    % here "sqrt" is used because of change the power to amplitude 
    
    
%   the BER calculating loop
for k=1:length(No)
                          
    % BPSK data transmition

    
    data=((2*round(rand(1,N)))-1);    %BPSK modulation
    % add AWGN nois


    % Multiplexin for transmition on Multiple antenna

    MultiplexData=reshape(data,TX,(N/TX));

    TransData=H*MultiplexData;



    % zeroforcing receiver

    Hinv=pinv(H);   % pseudoinverse of channel matrix 

    decorralator=Hinv*TransData;   %projecting received data on channel space ( zeroforcing or interference nulling )

    EstimData=pskdemod(decorralator,M);




⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?