In this example, we will see how we can model a simple communication channel. We will consider two cases : A simple Additive Gaussian noise channel and Rayleigh fading channel. Our signals are complex variables here which signifies both I and Q components.
|Fig1: Communication System
A channel is the medium between the transmitter and receiver. The signals (for example electromagnetic waves) transmitted from the source face different materials in the medium (air, water, buildings, dust or static charges around) it may increase the signal strength or decrease it by some random factor. This is called fading and this factor is called fading variable.
It can also add some random component to the transmitted signal. We can see this as additive noise. When this component follows a Gaussian distribution we call it additive Gaussian Noise.
Let us generate a random bit stream which signifies the date need to be sent. We choose the probability of 1 occurring is 0.6. First we generate a random uniform random vector.
Now let us turn all the elements bigger than 0.4 to 1 and rest to 0. Note that since the original vector is uniform between 0 and 1, the output vector will have 1 with 0.6 probability.
We can further modulate this signal using any modulation scheme. Let us choose few of modulation schemes and compare their outputs.
This means -1 denotes 0 bit and +1 denotes 1 bit. let us change all the 0s to -1 and 1s to +1. The transmitted signal can we written as
Note that each -1 and 1 denotes a sin pulse with phase -180 and +180 with time length equal to symbol duration . We will not consider the anolog signal which is in form concatenated sin signals. The receiver considers whole duration pulse as one and decide the phase. This requires synchronization which is not covered in this tutorial.
B) QPSK or QAM
Let us first divide the signal into I and Q data streams components. Each even numbered data bit is for Q.
The transmitted signal can we written as
x=zeros(500,1);x(dI==0 && dQ==0)=sqrt(1/2)*(1+1j);
x(dI==0 && dQ==1)=sqrt(1/2)*(-1+1j);
x(dI==1 && dQ==1)=sqrt(1/2)*(-1-1j);
x(dI==1 && dQ==0)=sqrt(1/2)*(1-1j);
1. Additive gaussian Noise
Let us first consider the simple channel which just adds the Gaussian noise. noise vector is of the same dimension , one noise value for each symbol duration and each noise value is independent of previous
symbol. We choose the noise variance as 0.01 and mean as 0.
So the output signal which is received at receiver is
Let us consider the fading which multiplies to the transmitted signal. As previous, here also each value is independent. We consider Rayleigh fading which means each symbol is Rayleigh distributed. .
We implement simple decoder which computes the phase of signal (as both of them are PSK) and decide upon this. For BPSK, it is equivalent to the following rule
dhat= 1 if y >0
dhat =0 if y<0
for QPSK, the rule is
dIhat = 1 if imaginary part of y<0 otherwise dIhat=1;
dQhat = 1 if real part of y<0 otherwise dQhat=1;
Let us implement both of these
Now let us compare the bit error rate which is defined as the ratio of error bit to the total bits transmitted.