assignment 2
DESCRIPTION
TRANSCRIPT
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
i
ASSIGNMENT
Module Code ESD 529
Module Name Real Time Software Engineering
Course M.Sc in Real time embedded systems
Department Computer engineering
Name of the Student Bhargav Rajivbhai Shah
Reg. No CHB0911001
Batch Full-Time 2011.
Module Leader Chandan .N
PO
STG
RA
DU
ATE
EN
GIN
EER
ING
AN
D M
AN
AG
EM
EN
T P
RO
GR
AM
ME –
(P
EM
P)
M.S.Ramaiah School of Advanced Studies Postgraduate Engineering and Management Programmes(PEMP)
#470-P Peenya Industrial Area, 4th Phase, Peenya, Bengaluru-560 058
Tel; 080 4906 5555, website: www.msrsas.org
ii
Declaration Sheet Student Name Bhargav Rajivbhai Shah
Reg. No CHB0911001
Course Real time embedded systems Batch Full-Time2011
Batch Full-Time2011
Module Code ESD 525
Module Title Real Time Software Engineering
Module Date to 5.11.2011
Module Leader Chandan .N
Extension requests: Extensions can only be granted by the Head of the Department in consultation with the module leader.
Extensions granted by any other person will not be accepted and hence the assignment will incur a penalty.
Extensions MUST be requested by using the „Extension Request Form‟, which is available with the ARO.
A copy of the extension approval must be attached to the assignment submitted.
Penalty for late submission Unless you have submitted proof of mitigating circumstances or have been granted an extension, the
penalties for a late submission of an assignment shall be as follows:
Up to one week late: Penalty of 5 marks
One-Two weeks late: Penalty of 10 marks
More than Two weeks late: Fail - 0% recorded (F)
All late assignments: must be submitted to Academic Records Office (ARO). It is your responsibility to
ensure that the receipt of a late assignment is recorded in the ARO. If an extension was agreed, the
authorization should be submitted to ARO during the submission of assignment.
To ensure assignment reports are written concisely, the length should be restricted to a limit
indicated in the assignment problem statement. Assignment reports greater than this length may
incur a penalty of one grade (5 marks). Each delegate is required to retain a copy of the
assignment report.
Declaration The assignment submitted herewith is a result of my own investigations and that I have conformed to the
guidelines against plagiarism as laid out in the PEMP Student Handbook. All sections of the text and
results, which have been obtained from other sources, are fully referenced. I understand that cheating and
plagiarism constitute a breach of University regulations and will be dealt with accordingly.
Signature of the student Date
Submission date stamp (by ARO)
Signature of the Module Leader and date Signature of Head of the Department and date
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
iii
Abstract ____________________________________________________________________________
Multiple Inputs, Multiple Output (MIMO) technology is a wireless technology that uses
multiple transmitters and receivers to transfer more data at the same time. MIMO technology
takes advantage of a radio-wave phenomenon called multipath where transmitted information
bounces off walls, ceilings, and other objects, reaching the receiving antenna multiple times via
different angles and at slightly different times. As a part a of this assignment detail analysis is
documented on the criteria for choosing MIMO, functions of MIMO and merits/demerits of
MIMO technology.
As main object of the part b, 2/3 convolution encoder is designed for the given
generator matrix and time domain approach is applied to analyzed the results. Based on the
design trellis diagram and viterby diagram is created for the same.
As main objective of the part c is to implement the 2/3 convolution encoder on matlab
platform, analyze the results and plot the curve of BER/SNR for some random message
sequence.
iv
Contents ____________________________________________________________________________
Contents
Declaration Sheet ......................................................................................................................... ii Abstract ....................................................................................................................................... iii Contents ........................................................................................................................................iv
List of Figures .............................................................................................................................. v List of Symbols ............................................................................................................................vi PART-A ......................................................................................................................................... 7 CHAPTER 1 .................................................................................................................................. 7
1.1 Introduction ..................................................................................................................... 7 1.2 Criteria for choosing MIMO technology ........................................................................ 7 1.3 Functions of MIMO ........................................................................................................ 7
1.3 Merits of MIMO ............................................................................................................. 8 1.5 Demerits of MIMO .......................................................................................................... 9 1.4 Application of MIMO ..................................................................................................... 9 1.5 Conclusion ...................................................................................................................... 9
PART-B ...................................................................................................................................... 10 CHAPTER 2 Generator matrix and analysis ......................................................................... 10
2.1 Introduction ................................................................................................................... 10 2.2 Generation of flip-flop diagram ..................................................................................... 10 2.3 Time domain approach ................................................................................................... 12
2.3.1 Bit padding ................................................................................................................. 12
2.4 Look up table .................................................................................................................. 13
2.5 State diagram .................................................................................................................. 14 2.6 Trellis analysis ................................................................................................................ 15
2.4 Viterbi algorithm ............................................................................................................ 15 PART-C ...................................................................................................................................... 18 CHAPTER 2 BER vs. SNR analysis ........................................................................................ 18
3.1 Introduction ...................................................................................................................... 18
2.1 Algorithm and results analysis ......................................................................................... 18 CHAPTER 4 .............................................................................................................................. 24 REFRENCE ............................................................................................................................... 25 BIBILOGRAPGY ..................................................................................................................... 26
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
v
List of Figures ____________________________________________________________________________
Figure 2. 1 Flip-Flop diagram ................................................................................... 11 Figure 2. 2 Output string structure ............................................................................ 12 Figure 2. 3 State diagram .......................................................................................... 15
Figure 2. 4 Terllis diagram ........................................................................................ 16 Figure 2. 5 Viterbi diagram ....................................................................................... 16
Figure 3. 1 Separation of the input sequence ............................................................ 19 Figure 3. 2 C1,C2 and C3 output ............................................................................... 21
Figure 3. 3 Output of code rate .................................................................................. 22 Figure 3. 4 Result of BER ......................................................................................... 23 Figure 3. 5 Result of deconv ..................................................................................... 23
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
vi
List of Symbols ____________________________________________________________________________
Symbol Description
GSM
GPRS
EDGE
CDMA
Mbps
Global system for mobile communication
General packet radio service
Enhanced data GSM environment
Code division multiple access
Mega Bytes per second
MIMO
HSPA
3GPP
EM field
SNR
Multiple input multiple output
High speed packet access
Third generation partnership project
Electromagnetic field
Signal to Noise Ratio
.
7
PART-A
CHAPTER 1
1.1 Introduction
The number of wireless service users in the world has increased by over 500% in the past
decade. Consumers are now demanding higher data rates to support applications like Internet
access, video, and gaming. Current cellular technologies like the global system for mobile
communications (GSM) based general packet radio service (GPRS), enhanced data GSM
environment (EDGE) and code division multiple access (CDMA) can only partially meet the high
data rate demand. Data rates of up to 100Mbps are possible using multiple-input multiple-output
(MIMO) wireless communication technology, now a part of cellular standards like the IEEE 802.16
(WiMAX) [1], high speed packet access (HSPA) , and the third generation partnership project
(3GPP) . Cellular service providers need to make the shift to MIMO to be compliant with the latest
standards and to cater to the growing demands for high data rates. Current cellular standards like
use multiple antennas at the base station to provide diversity gain. In contrast, MIMO wireless
technology makes use of multiple antennas at both the transmitter (base station) and receiver
(mobile terminals) in combination with specially designed algorithms to provide both capacity and
diversity gains using the same bandwidth and power as single antenna systems [2].
1.2 Criteria for choosing MIMO technology
In conventional wireless communications, a single antenna is used at the source, and another
single antenna is used at the destination. In some cases, this gives rise to problems with multipath
effects. When an electromagnetic field (EM field) is met with obstructions such as hills, canyons,
buildings, and utility wires, the wave fronts are scattered, and thus they take many paths to reach
the destination. The late arrival of scattered portions of the signal causes problems such as fading,
cut-out (cliff effect), and intermittent reception (picket fencing). In digital communications systems,
it can cause a reduction in data speed and an increase in the number of errors. The use of two or
more antennas, along with the transmission of multiple signals (one for each antenna) at the source
and the destination, eliminates the trouble caused by multipath wave propagation, and can even take
advantage of this effect.
1.3Functions of MIMO
MIMO can be sub-divided into three main categories, preceding, spatial multiplexing or SM,
and diversity coding.
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
8
Pre-coding is multi-layer ray forming in a narrow sense or all spatial processing at the
transmitter in a wide-sense. In (single-layer) ray forming, the same signal is emitted from each of
the transmit antennas with appropriate phase (and sometimes gain) weighting such that the signal
power is maximized at the receiver input. The benefits of ray forming are to increase the signal gain
from productive combining and to reduce the multipath fading effect. In the absence of scattering,
ray forming results in a well defined directional pattern, but in typical cellular conventional beams
are not a good analogy. When the receiver has multiple antennas, the transmit ray forming cannot
simultaneously maximize the signal level at all of the receive antennas, and proceeding is used.
Spatial multiplexing requires MIMO antenna configuration. In spatial multiplexing, a high
rate signal is split into multiple lower rate streams and each stream is transmitted from a different
transmit antenna in the same frequency channel. If these signals arrive at the receiver antenna array
with sufficiently different spatial signatures, the receiver can separate these streams, creating
parallel channels free. Spatial multiplexing is a very powerful technique for increasing channel
capacity at higher Signal to Noise Ratio (SNR).
Diversity Coding techniques are used when there is no channel knowledge at the transmitter.
In diversity methods a single stream (unlike multiple streams in spatial multiplexing) is transmitted,
but the signal is coded using techniques called space-time coding. The signal is emitted from each
of the transmit antennas using certain principles of full or near orthogonal coding. Diversity
exploits the independent fading in the multiple antenna links to enhance signal diversity. Because
there is no channel knowledge, there is no beam forming or array gain from diversity coding.
1.3 Merits of MIMO
1. MIMO‟s higher speeds are critical for letting wireless networks handle data-intensive multimedia
files. The increased bandwidth also lets wireless networks serve more users at a given data rate than
they could without MIMO.
2. MIMO technology focus on better-quality signals, MIMO networks use less radio transmission
power than other wireless networks, so there is less battery drain on portable systems and less
chance of interference with or from other systems
3. MIMO sends transmissions along multiple paths, most of the signals can avoid objects and other
sources of interference that cause fading and interruptions.
4. MIMO‟s signaling properties could also help create more robust wireless security. It would be
difficult for hackers to set up their receivers to properly receive all of the signals that have been
broken up and sent via multiple antennas along different paths.
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
9
1.5 Demerits of MIMO
1. Designing MIMO systems, which send signals over multiple transmission paths, is complicated
process.
2. MIMO‟s biggest technical challenge may be the increased processor-energy consumption caused
by the processing complexity required to handle signals traveling multiple
1.4 Application of MIMO
The applications of MIMO technology are describes below:
MIMO techniques are used to develop UWB.
MIMO Technique is used to develop Spectrum Sensing in Cognitive Radio.
MIMO Techniques are used for Split Ring Array Antenna for WLAN Applications.
Use of MIMO Techniques to Sensing of Cardiopulmonary Activity[7]
Multiple MIMO scenarios for Power Management in Wireless Sensor Networks[6]
MIMO Techniques for Mobile WiMAX Systems.[5]
MIMO Techniques for UTRA Long Term Evolution
Application of Advanced MIMO Techniques to Military Communications
MIMO Communication for Cellular Networks
Cluster-based Virtual MIMO Transmission Scheme for Wireless Sensor Networks[3]
1.5 Conclusion
By growing the need of higher data rates and higher speed, MIMO is the best option for
satisfying this need these growing of future wireless communication.
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
10
PART-B
CHAPTER 2 Generator matrix and analysis ________________________________________________________________________________
2.1 Introduction
To control or mitigate the distortion during the data transmission in the digital
communication systems, error control coding is used in various communication system. The
primary function of an error control encoder –decoder pair is to enhance the reliability of message
during transmission of the information caring symbols though a communication channel. In all
types of communication the channel introduce noise and interface to corrupt the transmitted signal.
At the receiver ,the channel corrupted transmitted signal is recovered.bit error may result during
transmission .The number of bit error is depend upon the amount of noise and interface in the
communication system. Among error correction codes, convolution codes are the most widely used
in the practical communication system. These codes develop strong mathematical structure which is
used for error correction.
The importance of application specific encoder design in realizing the performance
requirements of present and future high speed digital communication systems is readily apparent. In
this part of assignment flip-flop diagram is created from the given generator matrix. On the basis of
flip-flop diagram state diagram and trellis diagram is created and analyzed.
2.2 Generation of flip-flop diagram
In this, for 2\3 convolution generator one message sequence [Ma] is divided in to two
sequence by serial to parallel converter. Output of the serial to parallel converter is m1 with odd
numbered bits from Ma sequence and m2 with even numbered bits from Ma sequence. The main
condition for message sequence is length of the massage sequence should be grater then length of
generator polynomial (L<M).
Input of serial to parallel converter (original message sequence) is:
Ma=[ 1 0 1 0 1 0 1 0]
M(length of massage )= 8 bit
L(length of generator polynomial )= 4 bit
L<M condition is satisfied for given input massage sequence Ma.
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
11
This original massage sequence is fed in to the serial to parallel converter .Output of the serial to
parallel converter is two massage sequence em and om.
em=[0 0 0 0 ]
om=[1 1 1 1]
Three polynomials are given to draw flip-flop diagram.
Given generator polynomials are :
G1=[1 0 1 1]
G2=[1 1 0 1]
G3=[1 0 1 0]
There are three generator vectors are available. That represents that three x-or gates are available in
diagram.From the given generator polynomial flip-flop diagram is created.
Figure 2. 1 Flip-Flop diagram
The flip-flop diagram is used to study the states of circuit. The above image shows the flip-flop
diagram of 2\3 convolution encoder. In that two input sequence is is fed in parallel form.
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
12
2.3 Time domain approach
The equation 1 gives time domain approach of convolution codes .where em is first message
sequence and om is second message sequence. G is generator matrix. X(i) is output sequence for
same generator matrix.
……………………………………………………..(1)
2.3.1 Bit padding
Bit padding is used to flush the states of the flip-flops. Here original length of om and em is
4 bit and three extra bits are added to the right next to LSB of both message sequence.this padded
zeros will flush the states of flip-flops to the zero.
em=[0 0 0 0 0 0 0 ]
om=[1 1 1 1 0 0 0]
By putting the value is above equation 1 :
X(0)=G(0)*em(0)
X(1)=G(0)*em(1) G(1)*em(0)
X(2)=G(0)*em(2) G(1)*em(1) G(2)*em(0)
X(3)=G(0)*em(3) G(1)*em(2) G(2)*em(1) G(3)*em(0)
X(4)=G(0)*em(4) G(1)*em(3) G(2)*em(2) + G(3)*em(1)
X(5)=G(0)*em(5)+ G(1)*em(4)+ G(2)*em(3)+ G(3)*em(2)
X(6)=G(0)*em(6)+ G(1)*em(5) G(2)*em(4) + G(3)*em(3)
X(7)=G(0)*em(7)+ G(1)*em(6)+ G(2)*em(5)+ G(3)*em(4)
We have to do the same analysis for the om sequence and then concate the output in the even-odd
manner as shown in figure.
Figure 2. 2 Output string structure
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
13
By applying the same equation for first generator matrix :
G1=[1 0 1 1]
X(0)=1 X(1)=0 X(2)=1 X(3)=0 X(4)=0 X(5)=0 X(6)=1
X(7)=1 X(8)=0 X(9)=0 X(10)=0 X(11)=0 X(12)=1 X(13)=0
G2=[1 1 0 1]
X(0)=1 X(1)=0 X(2)=0 X(3)=0 X(4)=0 X(5)=0 X(6)=1
X(7)=0 X(8)=0 X(9)=0 X(10)=1 X(11)=0 X(12)=1 X(13)=0
G3=[1 0 1 0]
X(0)=1 X(1)=0 X(2)=0 X(3)=0 X(4)=0 X(5)=0 X(6)=1
X(7)=0 X(8)=0 X(9)=0 X(10)=1 X(11)=0 X(12)=1 X(13)=0
So final three sequences are,
={ 1 0 1 0 0 0 1 0 0 0 0 0 1 0}
={ 1 0 0 0 0 0 1 0 0 0 1 0 1 0}
={ 1 0 0 0 0 0 1 0 0 0 1 0 1 0}
The final transmitted pattern ={ 111,000,100,000,000,000,111,000,000,000,011,000,111,000}
2.4 Look up table
The encoder for convolution code uses a table look up to do the encoding. The look up table
consists of four items.
1. Input bit
2. The State of the encoder, which is one of the 8 possible states for the example (3,2,4) code
3. The output bits. For the code (3,2,4), since 3 bits are output, the choices are 000,001, 010,
011,101,110,111,100.
4. The output state which will be the input state for the next bit.
For the code (3,2,4) given the polynomials of figure 2.1, the following lookup table is created.
I/P Input state
S S2 S3
Output state
S S2 S3
Output sequence
C1 C2 C3
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
1
0
1
0
1
1
1
0
0
0
0
0
1
1
1
0
0
0
1
1
0
0
1
0
1
0
0
1
1
0
0
0
1
0
0
1
1
1
0
0
1
1
0
0
1
1
1
1
1
0
0
0
1
1
1
1
1
1
0
1
0
1
0
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
14
0
1
0
0
0
0
1
1
0
1
0
0
0
0
1
0
0
1
0
1
0
1
1
1
0
0
1
1
0
1
1
1
0
0
1
0
0
1
0
1
0
1
0
0
1
1
1
1
0
1
0
0
1
1
0
1
1
0
1
0
0
1
1
1
1
1
1
1
0
1
1
1
1
1
0
1
0
1
1
0
Table 2. Look-up table
This look up table uniquely describes the code (3,2,4). It is different for each code depending on the
parameters and the polynomials used.
Graphically, there are two ways in which we can look at the encoder to gain better understanding of
its operation. These are
1. State Diagram
2. Trellis Diagram.
3. Viterbi Diagram
2.5 State diagram
The State diagram is the way to analyze the situation of convolution code, a useful
technique to treat as the directed graph where each possible state of code and the directed edge go
from one node to another if it is possible to go after a run from one to other. State diagram is used
to analyze states of flip-flop diagram, the states of the given encoder. Initially state of all flip-flops
is zero. By giving m1 and m2 sequence to the input of the encoder states of encoder will change.
And the output sequence will change according to current and previous state.
This is a lot simplified model. Each of the edges has an input and the output value. The
basic idea is that the coder starts in the null state (all the memory cells equal to zero) and, in order
to encode the messages, you take the edge of the corresponding input given, and take the output of
the same edge. On the next run, you start from the node where you finished the last run
Figure 2.3 shows the state diagram for 2\3 convolution encoder. Each circle represents the
state at any instant time, the encoder resides in one of the stages. The lines to and from shows the
state transition that are possible at the arrival of the bit. Only two event can be happen at each time
arrival of bit 1 or arrival of bit 0.Each of that allows the encoder to jump from one stage to another
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
15
tate. The state diagram contain the same information which contain by the lookup table.
Figure 2. 3 State diagram
2.6 Trellis analysis A convolution encoder is often seen as a finite state machine. Each state corresponds to
some value of the encoder's register. Given the input bit value, from a certain state the encoder can
move to two other states. These state transitions constitute a diagram which is called a trellis
diagram. The trellis diagram is drawn by lining all the possible states in the vertical axis. Then we
connect each state to the next state by possible codeword for that state. There are only two choice is
possible at each state .this are determine by the arrival of either 0 or 1.the dotted lines shows the
output state by giving the input 1 to the state and solid line represent the state by giving the input
0.Figure2.4 show the trellis diagram for designed 2/3 convolution encoder.
2.4 Viterbi algorithm
Viterbi algorithm reconstructs the maximum-likelihood path given the input sequence. Let's
suppose that for every possible encoder state we know a path with minimum metric ending in this
state. For any given encoder state there is two (and only two) states from which the encoder can
move to that state, and for both of these transitions we know branch metrics. So, there are only two
paths ending in any given state on the next step. One of them has lesser metric, it is a survivor path.
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
16
The other path is dropped as less likely. Thus we know a path with minimum metric on the next
step, and the above procedure can be repeated.
Figure 2. 4 Terllis diagram
A Viterbi algorithm consists of the following two major parts:
1. Branch metric calculation – calculation of a distance between the input pair of bits and the
possible “ideal” pairs .
2. Path metric calculation – for every encoder state, calculate a metric for the survivor path
ending in this state (a survivor path is a path with the minimum metric).
Figure 2. 5 Viterbi diagram
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
17
Figure 2.5 shows the viterbi decoding structure for give 2/3 convolution encoder with the message
sequence [ 1 0 1 0 1 0 1 0].
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
18
PART-C
CHAPTER 2 BER vs. SNR analysis ________________________________________________________________________________
3.1 Introduction
One of the changes that modern digital communications systems have brought to radio
engineering is the need for end-to-end performance measurements. The measure of that
performance is usually bit-error rate (BER), which quantifies the reliability of the entire radio
system from “bits in” to “bits out,” including the electronics, antennas and signal path in between.
BER is defined by:
BER=
Noise is the main enemy of BER performance. Noise is a random process, defined in terms
of statistics. The noise introduced by the circuitry is described with a Gaussian probability density
function, while the signal path is usually described with a Rayleigh probability density function. A
Rayleigh, or fading, signal path is not “noise” in the intuitive sense of the familiar hissing sound of
“white noise,” but it is a random process that is analyzed in the same manner as Gaussian noise.
Without going into detail, the mathematical representations of these functions allow the
analysis of a system to help predict its performance. Further study of noise and statistical signal
analysis is highly recommended.
In digital communications, signal-to-noise ratio, often written S/N or SNR, is a measure
of signal strength relative to background noise. The ratio is usually measured in decibels (dB). If the
incoming signal strength in microvolts is Vs, and the noise level, also in microvolts, is Vn, then the
signal-to-noise ratio, S/N, in decibels is given by the formula.
S/N = 20 log10(Vs/Vn)
Vs = Vn, then S/N = 0. In this situation, the signal borders on unreadable, because the noise
level severely competes with it. In digital communications, this will probably cause a reduction in
data speed because of frequent errors that require the source (transmitting) computer or terminal to
resend some packets of data.
3.2 Algorithm and results analysis
In 2/3 convolution, the original message m sequence is divided in to two sequence named em and
om.
for i=1:length(m);
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
19
if mod(i,2)==0;
em(e)=m(i);
e=e+1;
else
om(e1)=m(i);
e1=e1+1;
end
end
This part of the algorithm divide the original message sequence in to two sequence on the basis of
even and odd elements .Even elements are stored in em and odd elements are stored om.This both
strings are input for the convolution encoder.
Figure 3. 1 Separation of the input sequence
Figure 3.1 shows the output of the algorithm which discussed above. The original message
sequence is m=[ 1 0 1 0 1 0 1 0] that is divided in to even-odd sequences on=[1 1 1 1 ] and om=[0
0 0 0].
Convolution of both message sequence and with the given generator matrix is done by inbuilt
function of the matlab. conv is the inbuilt library function of matlab, which is used to convolute two
sequence. The part of code which is shown below is responsible for the convolution the message
sequence with the generator polynomial. Due to the ex-or operation, the answer of the convolution
is given to the mod inbuilt library function which works like a ex-or operation on the output
sequence.
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
20
xe1=mod(conv(em,g{1}),2);
xo1=mod(conv(om,g{1}),2);
xe2=mod(conv(em,g{2}),2);
xo2=mod(conv(om,g{2}),2);
xe3=mod(conv(em,g{3}),2);
xo3=mod(conv(om,g{3}),2);
Six output sequences are created by convoluting the both message sequence with all generator
matrix. The elements in the one pair of the output sequence is even/odd elements of the final output
C1,C2 and C3.xe1 is having the all even elements of the C1 and xo1 is having all odd elements of
the C1.As same xe2,xo2,xe3 and xo3 is having elements of the C2 and C3 .
for as=1:length(xo1);
gm=gm+1;
f1(gm)=xo1(as);
f2(gm)=xo2(as);
f3(gm)=xo2(as);
gm=gm+1;
f1(gm)=xe1(as);
f2(gm)=xe2(as);
f3(gm)=xe3(as);
end
bh=input('press 1 to see C1,C2,C3')
if bh==1
disp('C1')
disp(f1)
disp('C2')
disp(f2)
disp('C3')
disp(f3)
end
The above part of the codes firms a output string by combining the even and odd elements .figure
shows the output this piece of code.
The final transmitted pattern is constructs by bit wise concating three output string.
rea=0;
for i=1:length(f1)
rea=rea+1;
final(rea)=f1(i);
rea=rea+1;
final(rea)=f2(i);
rea=rea+1;
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
21
final(rea)=f3(i);
end
disp(final)
The above part of the code will construct the transmitted pattern by picking one bit from the
c1,c2and c3.The first transmitted pattern is c1(1)c2(1)c3(1).The results of this part of code is shown
in figure 3.2 .
Figure 3. 2 C1,C2 and C3 output
Basically code rate is the ratio of the encoded message sequence to the original message sequence.
Code rate of the transmitted pattern is calclculated.
fb=num2str(length(m)/(length(f1)+length(f2)+length(f3)));
disp(['Measured R = ',num2str(length(m)/(length(f1)+length(f2)+length(f3)))])
This is the responsible part of the algorithm for measured code rate. Figure 3.3 shows the result of
the measured code rate with the input sequence of 8-bit.
After the data has been transmitted the random noise is added to the signal due to the noisy channel.
Here program is adding the random noise to the transmitted pattern.
noise = randn(1,length(final));
recsig=noise+final;
This piece of the code works as the noisy channel for the receiver. This will generate the random
variable string as the same length of the transmitted pattern and add that random noise to the
sequence to be transmitted side.
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
22
Figure 3. 3 Output of code rate
After the pattern need to de-convolute that recovering to retrieve the original message.
if dec==1
de1=abs(deconv(xe1,g{1}));
do1=abs(deconv(xo1,g{1}));
cg=0;
for as=1:length(do1);
cg=cg+1;
msg(cg)=do1(as);
cg=cg+1;
msg(cg)=de1(as);
end
disp('inserted msg is : ');
disp(msg);
end
The above piece of the code is responsible for the de-convolution of the original message sequence.
For the de-convolution inbuilt library function deconv has used .The output of the de-convoluted
sequence is shown in the figure.
Bit error rate is the ratio of the difference between the received bits and the transmitted nits to the
number of the msg length.The part of the subroutine is the responsible for the calculating the bit
errors rate . ro=mod(abs(round(recsig)),2);
err=0;
for i=1:length(final)
if final(i)==ro(i)
err=err+1;
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
23
end
end
error=error+err;
end
fe=round((error/length(noise)))
disp('number of error in the recived pattern is :')
disp(fe)
The results of this code is the bit error rate of the transmitted message. That is shown by figure 3.4.
Figure 3. 4 Result of BER
Figure 3. 5 Result of deconv
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
24
CHAPTER 4
Module learning outcomes ______________________________________________________________________________
4.1 Learning outcome
This module helped me to understand the approaches of designing and analysing the embedded
communication system. The use of tools such as Matlab has made me understand the concepts of
developing the prototype for digital communication systems. In this module I even learn different types
of codes which are used in the communication system.
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
25
REFRENCE ________________________________________________________________________________
[1] V. Erceg et.al., “IEEE 802.16 Broadband Wireless Access Working Group,” IEEE 802.16.3c-
01/29r4, http://ieee802.org/16,Jul. 2001.
[2] D. Gesbert, M. Shafi, D. Shiu, P. J. Smith and A. Naguib, “From Theory to Practice: An
Overview of MIMO Space-Time Coded Wireless Systems,” IEEE Jrnl. on Select. Areas Comm.,
vol. 21, no. 3, pp. 281 - 302, Apr. 2003
[3]http://www.it-paper.com/research-on-cluster-based-virtual-mimo-transmission-scheme-for-
wireless-sensor-networks.html
[4] http://comsoc.ieee-bv.org/2011/11/december-talk-application-of-advanced-mimo-techniques-to-
military-communications/
[5] http://www.sequans.com/pdf/mimo_whitepaper.pdf
[6]http://www.wltl.ee.upatras.gr/Archive/Papers/Multiple%20MIMO%20scenarios%20for%20Pow
er%20Management.pdf
[7] http://www.winlab.rutgers.edu/~samar/public/mimo_sensing_aces05.pdf
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
26
BIBILOGRAPGY ________________________________________________________________________________
1. Chandan N., Embedded Communication System, Course Notes – M.S.Ramaiah School of
Advanced Studies, Bangalore, December, 2011
2. www.mathworks.com
3. John G Proakis,Digital Signal Processing (4th Edition), Pearson Education.
4. http://www.efjohnsontechnologies.com/resources/dyn/files/75831/_fn/bit-error-rate
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
27
Appendix ________________________________________________________________________________ clc clear all
%****** ask for user input message sequence *******%
m=input('Enter your msg sequence:'); dis=input('Enter your code rate :'); g{1}=[1 0 1 1]; g{2}=[1 1 0 1]; g{3}=[1 0 1 0]; dbs = -1:10; if dis==(2/3)
%% this part of code will saparate the even and odd bits from msg sequence
e=1; e1=1; for i=1:length(m); if mod(i,2)==0; em(e)=m(i); e=e+1; else om(e1)=m(i); e1=e1+1; end end disp('the sequence em :') disp(em) disp('the sequence om :') disp(om)
n=length(g);
% convolution with even and odd msg sequence with all generatr matriX.
xe1=mod(conv(em,g{1}),2); xo1=mod(conv(om,g{1}),2); xe2=mod(conv(em,g{2}),2); xo2=mod(conv(om,g{2}),2); xe3=mod(conv(em,g{3}),2); xo3=mod(conv(om,g{3}),2);
% concation of the even and odd encded output
cn=1; gm=0; for as=1:length(xo1); gm=gm+1; f1(gm)=xo1(as); f2(gm)=xo2(as); f3(gm)=xo2(as); gm=gm+1; f1(gm)=xe1(as); f2(gm)=xe2(as); f3(gm)=xe3(as); end bh=input('press 1 to see C1,C2,C3')
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
28
if bh==1 disp('C1') disp(f1) disp('C2') disp(f2) disp('C3') disp(f3) end
loda=input('Press 2 to see the fianl pattern:'); %Assemble code word from f1,f2 ,f3outputs rea=0; for i=1:length(f1) rea=rea+1; final(rea)=f1(i); rea=rea+1; final(rea)=f2(i); rea=rea+1; final(rea)=f3(i); end disp(final)
lo=input('Press 3 to transmit pattern:') if lo==3 fb=num2str(length(m)/(length(f1)+length(f2)+length(f3))); disp(['Measured R = ',num2str(length(m)/(length(f1)+length(f2)+length(f3)))])
end %% decoding algo................. dec=input('press 1 to deconvolute the recoved sqquence') if dec==1 de1=abs(deconv(xe1,g{1})); do1=abs(deconv(xo1,g{1})); cg=0; for as=1:length(do1); cg=cg+1; msg(cg)=do1(as); cg=cg+1; msg(cg)=de1(as); end disp('inserted msg is : '); disp(msg); end fu=input('press 4 to see the number of errors in recoved bits:') dbs = -1:10; if fu==4 error=0; for p=1:length(dbs); noise = randn(1,length(final)); recsig=noise+final; ro=mod(abs(round(recsig)),2); err=0; for i=1:length(final) if final(i)==ro(i) err=err+1; end end error=error+err; end fe=round((error/length(dbs)))
MSRSAS - Postgraduate Engineering and Management Programme - PEMP
29
disp('number of error in the recived pattern is :') disp(fe) end
elseif dis==(1/3) b1=mod(conv(m,g{1}),2) b2=mod(conv(m,g{2}),2) b3= mod(conv(m,g{3}),2) rea1=0; for ik=1:length(f1) rea1=rea1+1; final3(rea1)=f1(ik); rea1=rea1+1; final3(rea1)=f2(ik); rea1=rea1+1; final3(rea1)=f3(ik); end disp(final3)
else disp('Enter valid code rate') end