www.pudn.com > channel.zip > channel.m


function y = channel(sig2, Mt, Mr, x, H, N);
% function y = channel(sig2, Mt, Mr, x, H, N)
%
% Channel transmission simulator
%
% inputs:
%   sig2 - noise variance
%   Mt - number of Tx antennas
%   Mr - number of Rx antennas
%   x - vector of complex input symbols (for MIMO, this is a matrix, where each column
%       is the value of the antenna outputs at a single time instance)
%   H - frequency selective channel - represented in block-Toeplitz form for MIMO transmission
%   N - number of symbols transmitted in OFDM frame
%
% outputs:
%   y - vector of channel outputs (matrix for MIMO again, just like x matrix)

% create noise vector sequence (each row is a different antenna, each column is a
% different time index)  note: noise is spatially and temporally white
noise = sqrt(sig2)*1/sqrt(2)*(randn(Mt*N,1) + j*randn(Mt*N,1));

y = H*x + noise;