Maximal Ratio Combining Example in Matlab
Maximal Ratio Combining Example in Matlab
Matlab
In the old days, communication between a transmitter and receiver was
simple. The transmitter sent out a single signal through one antenna, which
eventually arrived at a single antenna at the receiver, probably along with a
little noise.
I was pondering this question back in the early 2000s. As luck would have
it, I attended a conference where many papers had to handle this very issue.
Only all the presenters seemed to know what the answer was, and it was
called maximal ratio combining (MRC).
Most of their papers briefly presented how to do it. Have a look!
that?
4. Try ideas for hours in Matlab. Eventually get
same performance as shown in paper.
And of course the work would be wasted if it we dont also doProfessional
Reputation Enhancement by Matlab. This involves first academifying your
code by replacing for-loops with matrix operations and trying to do as much
as possible on each single line via nested parentheses, then forwarding it and
a PDF of the paper on to the boss and colleagues describing the technique
as this simple idea I stumbled across that you quickly coded up and
yawn yeah, it works
Id like to think Im more mature now so let me just give you the quick
download on maximal ratio combining.
1. MRC is just a weighted average of the multiple
copies
2. The weight for each is the SNR of the channel it
came from
3. Not SNR in dB! Just plain ol' unitless SNR
4. The SNR of the resulting average is the sum of
all the channel SNRs
5. Not SNR in dB! Just plain ol' unitless SNR
For (4) to be true, the noise in each of the channels has to be independent. If
the noise is correlated well, Im sure theres a paper out there thatll show
you what to do, and I bet it involves some sinister autocovariance matrix (in
fact, that might be the R in the paper I sampled above).
While I wont touch that one with a 10 ft. pole, I will let you steal my code
for normal MRC below!
Actually
Actually is %2.2f
Background
We use the same constraints as defined in the Selection Diversity and Equal Gain Combining
(EGC) post. Let me repeat the same.
1. We have N receive antennas and one transmit antenna.
2. The channel is flat fading In simple terms, it means that the multipath channel has only one
tap. So, the convolution operation reduces to a simple multiplication. For a more rigorous
discussion on flat fading and frequency selective fading, may I urge you to review Chapter 15.3
Signal Time-Spreading from [DIGITAL COMMUNICATIONS: SKLAR]
3. The channel experienced by each receive antenna is randomly varying in time. For the
receive antenna, each transmitted symbol gets multiplied by a randomly varying complex
number
. As the channel under consideration is a Rayleigh channel, the real and imaginary
parts of
and variance
4. The channel experience by each receive antenna is independent from the channel
experienced by other receive antennas.
5. On each receive antenna, the noise
with
and
The noise on each receive antenna is independent from the noise on the other receive antennas.
6. At each receive antenna, the channel
7. In the presence of channel
antenna is
where
is the received symbol on the
is the channel on the
receive antenna,
receive antenna,
receive antenna.
receive
i.e sum of the channel powers across all the receive antennas.
Note: The equations in the post refers the note on Receive diversity by Prof. RaviRaj Adve.
receive antenna is
.
Given that we are equalizing the channel with
, with the
.
Effective bit energy to noise ratio in a N receive antenna case is N times the bit energy to
noise ratio for single antenna case. Recall, this gain is same as the improvement which we got
in Receive diversity for AWGN case
Click here to download Matlab/Octave script for plotting effective SNR with Maximal Ratio
Combining in Rayleigh channel
Figure: Effective SNR with Maximal Ratio Combining in Rayleigh fading channel
is a Rayleigh distributed
is
.
is the sum of
is,
.
If you recall, in the post on BER computation in AWGN, with bit energy to noise ratio of
, the
, where
.
Refer Equation 11.12 and Equation 11.13 in Section 11.3.1 Performance with Maximal Ratio
Combining in [DIG-COMM-BARRY-LEE-MESSERSCHMITT]. Again, I do not know the proof
Click here to download Matlab/Octave script for simulating BER for BPSK in Rayleigh channel
with Maximal Ratio Combining
Figure: BER plot for BPSK in Rayleigh channel with Maximal Ratio Combining
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% All rights reserved by Krishna Pillai, http://www.dsplog.com
% The file may not be re-distributed without explicit authorization
% from Krishna Pillai.
% Checked for proper operation with Octave Version 3.0.0
% Author
: Krishna Pillai
% Email
: [email protected]
% Version
: 1.0
% Date
: 28th September 2008
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Script for computing the SNR improvement in
% Rayleigh fading channel with Maximal Ratio Combining
clear
N = 10^3; % number of bits or symbols
% Transmitter
ip = rand(1,N)>0.5; % generating 0,1 with equal probability
s = 2*ip-1; % BPSK modulation 0 -> -1; 1 -> 0
nRx = [1:20];
Eb_N0_dB =
[25]; % multiple Eb/N0 values
for jj = 1:length(nRx)
for ii = 1:length(Eb_N0_dB)
n = 1/sqrt(2)*[randn(nRx(jj),N) + j*randn(nRx(jj),N)]; % white
gaussian noise, 0dB variance
h = 1/sqrt(2)*[randn(nRx(jj),N) + j*randn(nRx(jj),N)]; % Rayleigh
channel
% Channel and noise Noise addition
sD = kron(ones(nRx(jj),1),s);%sD = 1;
y = h.*sD + 10^(-Eb_N0_dB(ii)/20)*n;