DIGITAL COMMUNICATIONS LABORATORY MA NU AL (R13) III – B. Tech., II-Semester ECE DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING RAMACHANDRA COLLEGE OF ENGINEERING, ELURU – 534 007 Accredited by NAAC with “ B ++” Grade (Approved by AICTE, New Delhi & Affiliated to JNTUK: Kakinada) West Godavari District, Andhra Pradesh
98
Embed
(R13) III B. Tech., II-Semester ECE - Ramachandra … LAB MANUAL 15-11-2016.pdfDIGITAL COMMUNICATIONS LABORATORY MANUAL (R13) III – B. Tech., II-Semester ECE DEPARTMENT OF ELECTRONICS
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
DIGITAL COMMUNICATIONS
LABORATORY MANUAL
(R13) III – B. Tech., II-Semester
ECE
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
RAMACHANDRA COLLEGE OF ENGINEERING, ELURU – 534 007
Accredited by NAAC with “B++” Grade
(Approved by AICTE, New Delhi & Affiliated to JNTUK: Kakinada) West Godavari District, Andhra Pradesh
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 2
DIGITAL COMUNICATIONS LAB
(R13) III – B. Tech., ECE II- Semester
Index
S. No. Name of the Experiment
1. Time division multiplexing.
2. Pulse code modulation.
3. Differential pulse code modulation.
4. Delta modulation.
5. Frequency shift keying.
6. Phase shift keying
7. Differential phase shift keying.
8. Companding
9. Source Encoder and Decoder
10. Linear Block Code-Encoder and Decoder
11. Binary Cyclic Code - Encoder and Decoder
12. Convolution Code - Encoder and Decoder
Experiments Beyond the syllabus Using MATLAB
13. Companding
14. ASK
15. Minimum Shift Keying (MSK)
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 3
GENERAL INSTRUCTIONS:
1. The experiments have been designed to be performed within the 3-hour
laboratory time.
2. To successfully complete the experiment in one lab turn, come prepared to
the laboratory.
3. Read the experiment in advance.
4. List and collect the components for the experiment.
5. Be sure that the specifications and values of the components are as per
design.
6. Follow the experimental steps judiciously.
7. Record stepwise observations using proper test instruments.
8. Get the observation signed by the instructor.
9. Always take safety precautions while performing experiments.
GUIDANCE FOR THE LABORATORY REPORT:
1. Format of the report
Exp. No: Expt. Title: Date:
Objective:
List of instruments and components:
Theory in brief
Procedure, Observations, Graph if any
Result
2. Write the experimental observations and measurements stepwise.
3. Plot the graph neatly. Always label the axes and indicate units too. Wherever
frequency response is to be drawn, use the semi-log graph paper.
4. Compare the results with theoretical values with remarks/comments.
5. Wherever necessary, sketch the circuit diagram neatly and label the components.
.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 4
1. TIME DIVISION MULTIPLEXING
AIM: To study the characteristics of Time Division Multiplexing and Demultiplexing
EQUIPMENT REQUIRED:
1. TDM Multiplexer & De-Multiplexer trainer
2. Digital Storage Oscilloscope
3. Digital Multimeter.
4. 2 No’s co-axial cables (standard accessories with trainer)
Note: Storage oscilloscope is desired for satisfactory observation of TDM wave
forms
THEORY:
Time Division Multiplexing enables the joint utilization of a single channel by
different message signals without mutual interference. The important feature of
Pulse Amplitude Modulation is conservation of time. This can be achieved by using
Time Division Multiplexing. That is for a given message signal, transmission of the
associated PAM wave engages the communication channel for only a fraction of the
sampling interval on a periodic basis. Hence, some of the time interval between
adjacent pulses of the PAM wave is cleared for use by other independent message
signals on a time shared basis.
In TDM each input signal is first passed through low pass filter in order to
restrict the bandwidth. The pre – alias filter is then applied to a commutator, which
is usually implemented using electronic switching circuitry. The function of
commutator is twofold: (1) To take a narrow sample of each of the N input
messages at a rate 𝑓𝑠 that is slightly higher than 2𝑊 , where 𝑊 is the cutoff
frequency of the pre – alias filter, and (2) To sequentially interleave these N samples
inside a sampling interval 𝑇𝑠 = 1/𝑓𝑠. Indeed, this latter function is the essence of the
time division multiplexing operation. The multiplexed signal is then appl ied to a
Pulse Amplitude Modulator, the purpose of which is to transform the multiplexed
signal into a form suitable for transmission over the communication channel.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 5
CIRCUIT DIAGRAMS:
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 6
PROCEDURE:
Multiplexer:
1. Study the theory of operation.
2. Connect the trainer TDM Multiplexer to the mains and switch on the power
supply.
3. Measure the output of the regulated power supply i.e. +5 V and -5 V with the
help of digital multimeter.
4. Observe the output of the AF generator-1 using CRO; it should be a Sine
wave of 400 Hz frequency with 3 𝑉𝑝−𝑝amplitude.
5. Observe the output of the AF generator-2 using CRO it should be a Sine
wave of 200 Hz frequency with 3 𝑉𝑝−𝑝 amplitude.
6. Verify the operation of logic source with multimeter/scope, output should be
+5 V in logic1 position and 0 V in logic "0" position.
7. Observe the output of the Clock generator using CRO; it should be a Square
wave of 500 Hz to 15 kHz frequency with 5 𝑉𝑝−𝑝amplitude.
8. Now connect the CH 1 & CH 2 Inputs of the TDM multiplexer to the outputs
of the AF Generator 1 and 2 respectively.
9. Connect Control input of the TDM multiplexer to the output of the logic
source.
10. Put control signal (logic source) at logic 1 condition and observe the output
of the TDM multiplexer with the help oscilloscope, by this we can notice that
the output of the TDM multiplexer is a signal which has been connected to
CH1 input. In this condition the signal at CH 2 input has no effect on
multiplexer output.
11. Similarly put logic source at logic 0 position and observe the output of the
TDM multiplexer. Now notice that the output of the TDM multiplexer is a
signal which has been connected to the CH 2 input and the signal at CH 1
input has no effect on multiplexer output.
12. Now disconnect logic source and connect clock output to the control input.
13. Observe TDM wave form using CRO at different values of clock frequency,
input signal voltage levels and sketch them.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 7
WAVEFORMS:
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 8
Note1: After setting the clock frequency and input signals to desire values
put storage scope in STOP mode so that you can view stable display of
waveforms.
Note2: Sample wave forms given in Figures are drawn at 1 kHz sampling
clock, you can take at any clock frequency.
Similarly you can observe and plot the TDM waveforms for different inputs i.e. DC
signals alone, AC & DC instead of AC signals.
Note1: DC Signals (voltages) can be connected from an external sources and
care should be taken in case voltage levels i.e. maximum voltage input
voltage must be in range of ± 4.8 V.
Note2: You can use even normal scope, when you observe the TDM wave
form for DC inputs.
De-multiplexer:
1. Study the theory of operation.
2. Connect the trainer TDM DE-multiplexer to the mains and switch on the
power supply.
3. Measure the output of the regulated power supply i.e. +5 V and -5 V with the
help of digital multimeter.
4. Verify the operation of logic source with multimeter/scope, output should be
+5 V in logic "1" position and 0 V in logic 0 position.
5. Observe the output of the Clock generator using CRO; it should be a Square
wave of 500 Hz to 15 kHz frequency with 5 Vp amplitude.
6. Connect TDM-PAM signal to input of TDM de-multiplexer from TDM
multiplexer with the help of co-axial cable (supplied with trainer).
7. Connect control input to logic source output.
8. Keep CRO in dual mode; connect one input to CH 1 output and another
input to CH 2 output.
9. Put logic source to 1 position and observe CH 1 and CH 2 outputs. You can
notice that the entire TDM signal is transferred to CH 1 output and has no
signal at CH 2 output.
10. Similarly put logic source to "0" positions and observe CH 1 and CH 2
outputs. Now the entire TDM signal is transferred to CH 2 output and has
no signal at CH 1 output. By the above two steps you can notice that the
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 9
entire TDM signal is transferred to CH 1 output when control input is "1"
and to CH 2 output when control input is "0".
11. Now disconnect logic source and connect clock from the transmitter (i.e.,
AET- 55M) through a coaxial cable.
12. Observe CH 1 and CH 2 outputs. You will notice that the outputs are
natural top sampled PAM signals.
13. Connect CH 1, CH 2 outputs to low pass filters and observe the output of the
filters and compare them with the original AF Signals ( at multiplexer inputs)
using CRO. You will notice that both the signals are same in frequency and
shape. Signal amplitude may be attenuated during smoothing process and
this can be achieved by taking amplifiers output. Select AC/DC coupling
depending on the input signal.
Observation on effect of synchronization:
Disconnect clock from multiplexer (AET-55M) and connect to local oscillator (i.e.,
clock generator output from AET-55D) with remaining setup as it is. Observe CH 1
and CH 2 outputs and compare them with the previous results. These signals are
little bit distorted in shape. This is because lack of synchronization between clock
at multiplexer and clock at de-multiplexer. You can get further perfection in output
wave forms by adjusting the locally generated clock.
RESULT:
VIVA QUESTIONS:
1. Define Multiplexing.
2. Define bandwidth.
3. Define synchronization.
4. What is the purpose of pre – alias filter?
5. What is the purpose of commutator?
6. Define Nyquist rate.
7. Define cross talk.
8. What is the purpose of reconstruction filters?
9. What are the applications of Time Division Multiplexing?
10. Define equalization in TDM.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 10
2. PULSE CODE MODULATION & DEMODULATION
AIM: To Study & understand the operation of the Pulse code modulation &
Demodulation.
EQUIPMENT REQUIRED:
1. PCM Modulator trainer
2. PCM Demodulator trainer
3. Storage Oscilloscope
4. Digital multimeter
5. 2 No’s of co-axial cables (standard accessories with trainer)
6. Patch chords
Note: Storage oscilloscope is desired for satisfactory observation of PCM wave
forms
THEORY:
Pulse modulation: A form of modulation in which a pulse train is used as the
carrier. Information is conveyed by modulating some parameter of the pulses with a
set of discrete instantaneous samples of the messages signal. The minimum
sampling frequency is the minimum frequency at which the modulating waveform
can be sampled to provide the set of discrete values without a significant loss of
information.
PCM: In pulse code modulation (PCM) only certain discrete values are allowed for
the modulating signals. The modulating signal sampled, as in other forms of pulse
modulation. But any sample falling within a specified range of values is assigned a
discrete value. Each value is assigned a pattern of pulses and the signal
transmitted by means of this code. The electronic circuit that produces the coded
pulse train from the modulating waveform is termed a coder or encoder. A suitable
decoder must be used at the receiver in order to extract the original information
from the transmitted pulse train.
PROCEDURE:
1. Connect the trainer (Modulator) to the mains and switch on the power
supply.
2. Observe the output of the AF generator using CRO; it should be a Sine wave
of 200 Hz frequency with 3 𝑉𝑃−𝑃 amplitude.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 11
3. Verify the output of the DC source with multimeter / scope, output should
vary from 0 to +5 V.
4. Observe the output of the Clock generator using CRO, they should be 64
kHz and 4 kHz frequency of square wave with 5 𝑉𝑃−𝑃 amplitude.
CIRCUIT DIAGRAMS:
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 12
WAVEFORMS:
Note: These clock signals are internally connected the circuit so no external
connections are required.
5. Connect the trainer (De Modulator) to the mains and switch on the power
supply.
6. Observe the output of the clock generator using CRO; it should be 64 kHz
square wave with 5 𝑉𝑃−𝑃 amplitude.
PCM OPERATION (WITH DC INPUT)
MODULATION:
1. Set DC source to some value say 1 V with the help of multimeter and
connect it to the A/D converter input and observe the output LED’s.
2. Note down the digital code i.e., output of the A/D converter and compare
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 41
Please note that in the above tables the letters abcd in the input table and output table , that
means whatever bit is there in place of a the same bit appears in the o/p in place of a , the
same for bcd.
The dc levels used in the trainer kit (with up/down keys)
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 42
12 bit code
DAC Code
Decimal value dc-level volts
0000_0000_0000 0 0.000
0000_0001_0000 16 0.012
0000_0001_1111 31 0.023
0000_0010_1110 46 0.034
0000_0011_1110 62 0.045
0000_0110_0000 96 0.070
0000_0111_1100 124 0.091
0100_0000_0000 1024 0.750
0111_1100_0000 1984 1.453
1000_0000_0000 2048 1.500
1100_0000_0000 3072 2.250
1111_1000_0000 3968 2.906
The 13th bit is the sign bit, when 0 the value is positive, when 1 the value is negative.
The reason for choosing unequal steps and more values at the lower level is to observe the
variation properly at low levels, where as at higher levels there will not be much difference
when values chosen are closer.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 43
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 44
The kit signal chain has the following blocks
Signal Generator:
The kit generates -3 to +3 DC Voltage at the input by using the UP/DOWN keys in DC
mode.
The kit also generates a fixed ac waveform when the switch is in AC Mode.
A/D Convertor:
This is a 16 bit A/D convertor, for commanding we need the following sizes of A/D , for
linear 8 bit, for A law 13 bit, for u law 14 bit. the most significant bit is used for signal sign ,
bit is 1 means negative from the 16 bit convertor we get the sign bit and 15 bit magnitude.
for linear case we take the most significant 7 bits from the magnitude and the sign bit to sign
bit.
for A law we take sign bit sign bit, most significant 12 bit as magnitude of the input.
for u law we are showing only the magnitude bits on LEDS. the sign bit is not shown.
The compressor:
The compressor converts the 12 bit magnitude to coded 7 bits ( A law).
these 7 bits along with the sign bit go out on the channel of communication.
The Expander:
The expander converts the 7 coded magnitude back to the original 12 bit magnitude ( A
law).
D/A:
The D/A is 16 bit implementation, the expander output sign bit gets loaded as sign bit , the
magnitude 12 bits get loaded to the most significant 12 bits of the D/A.
Procedure:
Use the Fluke87V (4 ½ digit) multi meter for observing the dc levels or any other suitable
dc volt meter with 0.05% accuracy, which can distinguish 1mv, since the we need to observe
the errors in dc level in the range of 0.001 volts/ i.e., 1 mv . if you are using 31/2 digit DMM
it should have 0-200 mv range to measure 000.0 to 199.9 mv
1. First observe the communication blocks in the signal chain 2. Apply a given dc voltage at the input by using the up/down keys, measure this
with multi meter. after reset it starts with 0 volts. 3. Note down the codes and the voltages as per the table given below. 4. Do this for both the linear mode and companded mod ( A Law). 5. Observe that higher Quantisation error Q/S in the case of linear mode compared
to the companded mode.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 45
6. Observe the quality improvement of a companded channel for a low level asc signal given by the kit itself in AC mode.
Experiment Procedure
COMPRESSOR/PCM CODER TRCHL
DECOMPRESSOR+PCM
DECODER
* * *
A/D * COMPRES * EXPAND * D/A
I/P 16 BIT * CODER * DECODER *
16
BIT O/P
* * *
* LEDS-8 *
LEDS-
13
LEDS-
13
UP
SIGNAL
FROM
MICRO
DC/SINE AC/DC
MODE
NRM/COMPAND
DN
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 46
Observations Table to be filled by the student
Without Companding With Companding A law
Coder
I/P
12 bit
Chl Code
7 bit
Decoder
O/P
12 bit
Error
Digital
Err/Sign
al
Chl
Code
7 bit
Decoder
O/P
12 bit
Error
Digital
Err/Sign
al
A B C D=C-A E=D/A B C D=C-A E=D/A
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 47
as the channel is fixed bandwidth ( i.e., it accomadates 8 bits for sample one bit for sign and
7 bits for magnitude)
if we do not use companding , then the lower 5 magnitude bits are truncated and only the
most significant 7 bits are taken from the input to be carried in the channel.
With companding, at lower levels the even the lower bits are carried in the channel code as
per the coding tables given for A law and u law.
Note-1: for u law note down 13 bits at A/D o/p and D/A i/p ( for A law it is 12 bit)
AC Signal Observation through companding process
Observe the improvement in waveshape for a low level ac waveform
by putting the kit in AC mode.
compare the waveforms
connect I/P wave form to DSO channel-1 ( trigger source ch1 )
connect O/P waveform to DSO channel-2
Observe the variation in channel-2 , by putting the mode switch in companding
and normal 8 bit linear chl mode.
Example Values
Without Companding With Companding
Coder
I/P
12 bit
Chl Code
7 bit
Lower 5
bits get
coutout
Decoder
O/P
12 bit
Lower 5
bits are 0’s
Error
Digital
Err/Sign
al
Chl
Code
7 bit
Decoder
O/P
12 bit
Error
Digital
Err/Sign
al
A B C D=C-A E=D/A B C D=C-A E=D/A
0x001 0x00 0x000 0x00 1/1=1 0x00
0x010 0x00 0x000 0x10 32/32=1 0x10
0x01F 0x00 0x000 0x1F 0x1F
0x02E 0x01 0x020 0x0E 14/46
=0.304
0x17
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 48
0x03E 0x01 0x1F
0x060 0x03 0x28
0x07C 0x03 0x2F
0x400 0x20 0xC0
0x7C0 0x3E 0x6F
0x800 0x40 0x70
0xC00 0x60 0x78
0xF80 0x7C 0x7F
From filling the above observation table please note that Err/Signal ratio has improved a
lot for lower signal levels and for higher levels as Err/S is already low , there is not
significant difference.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 49
9. SOURCE ENCODER AND DECODER Introduction Source Coding is a technique of compressing the source information size based on the
probability of occurrence of each information symbol.
Decoding is the reverse process to get back the full source information.
In every day we employ this in transferring big files, particularly image/voice files by
zipping them and transferring to the destination and unzipping at the destination.
Example: Huffman coding
Aim of the experiment To select an information having in-equal probability of occurrence of each symbol or having
redundancy in the information and applying a source code using one of the techniques i.e
Huffman coding, observing the size of the coded information, sending the minimized packet
, decoding at the receiving end getting back the full information sent.
Theory When we have to transmit a set of symbols over a communication channels, normally
choose no of bits to accommodate all the symbols for example 8 symbols can be coded using
3 bits, because 3 bits give us 2^3=8 combinations. With this type of normal binary
representation we can transfer any combination of symbols in any order. However if our
information to be transmitted has a set of symbols but the occurrence of symbols with
different frequencies we can employ a coding technique whereby we choose less no of bits
for the frequently occurring symbol and more bits for the less occurring symbol this way we
can represent our information which is a sequence of symbols with less no.of bits i.e.
reduced size.
In everyday language, we call this zipping.
Huffman coding is based on the frequency of occurrence of a data item (pixel in images).
The principle is to use a lower number of bits to encode the data that occurs more
frequently. Codes are stored in a Code Book which may be constructed for each image or a
set of images. In all cases the code book plus encoded data must be transmitted to enable
decoding.
The Huffman algorithm is now briefly summarized:
A bottom-up approach 1. Initialization: Put all nodes in an OPEN list, keep it sorted at all times (e.g., ABCDE). 2. Repeat until the OPEN list has only one node left:
(a) From OPEN pick two nodes having the lowest frequencies/probabilities, create a parent node of them.
(b) Assign the sum of the children's frequencies/probabilities to the parent node and insert it into OPEN.
(c) Assign code 0, 1 to the two branches of the tree, and delete the children from OPEN.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 50
The following points are worth noting about the above algorithm:
Decoding for the above two algorithms is trivial as long as the coding table (the statistics) is sent before the data. (There is a bit overhead for sending this, negligible if the data file is big.)
Unique Prefix Property: no code is a prefix to any other code (all symbols are at the
leaf nodes) -> great for decoder, unambiguous. If prior statistics are available and accurate, then Huffman coding is very good.
In the above example:
Number of bits needed for Huffman Coding is: 87 / 39 = 2.23
/* convert syndrome (H x data) to mask that corrects data error */
const unsigned char syndromeMask[PARITY_VALUES] =
{
0x00, /* syndrome = 0 0 0 */
0x10, /* syndrome = 0 0 1 */
0x20, /* syndrome = 0 1 0 */
0x08, /* syndrome = 0 1 1 */
0x40, /* syndrome = 1 0 0 */
0x04, /* syndrome = 1 0 1 */
0x02, /* syndrome = 1 1 0 */
0x01 /* syndrome = 1 1 1 */
};
The kit uses generator matrix g[4*4]=P:I=
0111000
1010100
1100010
1110001
where P[4*3]=
011
101
110
111
where I[4*4]=
1000
0100
0010
0001
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 59
Experiment Procedure
CHANNEL CODER
CHANNEL CODER CHL CODE CHANNEL DECODER
CHANNEL
CODE
LED PAIR-15*
I/P
MESSAGE
LED PAIR-14*
O/ P
MESSAGE
LEDPAIR-7*
CODER
LED PAIR-13*
DECODE
R
LEDPAIR-7*
LEDPAIR-6*
( Hamming
7,4)
LED PAIR-12*
LEDPAIR-6*
LEDPAIR-5*
LED PAIR-11*
LEDPAIR-5*
LEDPAIR-4*
LED PAIR-10*
LEDPAIR-4*
LEDPAIR-3
LED PAIR-9*
LEDPAIR-3
LEDPAIR-2
LED PAIR-8*
LEDPAIR-2
LEDPAIR-1
LEDPAIR-7*
LEDPAIR-1
LEDPAIR-0
LEDPAIR-6
LEDPAIR-0
LEDPAIR-5
1 0
CODE A BIT*
LEDPAIR-4
LED-
ERRDET
CLEAR
CODE ALL
LEDPAIR-3
LED-ERCOR
LED-DONE
LEDPAIR-2
LEDPAIR-1
DECODE
LEDPAIR-0
BITSE
L
ERRSE
T
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 60
RESETKIT
NORM
DEMO
/COD
E
Procedure:
Observe the signal chain , i.e. the input stage, coding stage, transmission stage and the decode stage
Put the mode selection switch in NORMAL mode and see the process and observe output
Student selects input message that is to be coded, by shifting the bits 0/1 by means of pressing the keys 0, 1, CLEAR.
Student codes this input message by pushing the key ‘CODE A BIT’ or by pushing ‘CODEALL’.
Now the message is coded and displayed in the transmission path. Student can now introduce an error in the transmission channel by means of pressing the keys BITSEL and ERRSET. On every push of the BITSEL one bit is selected in the channel
code, the selected bit will be completely in OFF mode at this stage, if the student presses ERRSET key, the OFF mode bit will be inverted to make it as an error.
Now the student pushes the DECODE key, the channel code is decoded and displayed as the Output message. If an error is detected in the channel code
ERRDETECTED LED glows, if an error is corrected from channel code then the ERRCORRECTED LED glows in the decoder Output stage.
Now put mode selection in CODE mode and repeat the process and observe the output changes.
Observe how the error detection and correction in code mode and hence the
implementation of Linear Block encoder and decoder. Pushing Demo mode switch will give a brief description of implementation of KIT
In this experiment hamming code (7.4) is employed. the input data is limited to 4 bits, once
it is coded the input data is placed in channel data positions 1..4(d0-d3), parity bits are place
in positions 5,6,7 (d4-d6) this is a systematic code. To set errors in a different position for the
same input data, press code-all key once, then it will be recoded and shown on channel
data and o/p gets cleared waiting for decode key once again.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 61
Observations Table
I/P Data
abcd
ChlCode
xyzabcd
ChlCode
With Err
O/p data
abcd
Err
Det
Err
Corr
1010 1011010 1011010 1010 No No
1011011 1010 Yes Yes
0011011 1010 Yes Yes
0011001 1001 Yes No
From the above observations, we can conclude and record the following points.
Errors in the transmission channel can be detected and corrected with linear block coding in
7,4 hamming code we can detect and correct single bit error in any position, we can detect 2 errors but with 2 errors we can not correct.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 62
11. BINARY CYCLIC CODE ENCODER AND DECODER In coding theory cyclic codes are the sub-class of linear block error correcting codes that
have convenient algebraic structures for efficient error detection and correction.
Aim of the experiment To observe that the errors received through a noisy channel can be removed / minimized by
employing the error detection and correction code, by using an algebraic structure.
Specification
The kit is implemented with 16 bit micro controller giving lot of flexibility in experimenting
Facility to inject a custom bit stream as an input message
Verification of the injected bit stream on LEDS
Verification of the code word on LEDS
Facility to add multiple errors
Facility to observe the decoded output
Facility to observe the status of decoding i.e. error detected and error corrected status on
LEDS
Option keys to select one of normal mode or code mode
Easy verification of where error is injected and what is the corresponding output.
Theory A linear code is called cyclic code if every cycle shift of code vector produces some other
code vector i.e. the cycle shift to the data in an array should also represent the data in the
same array.
Example: arr{(0000),(0101),(1010),(1111)}
There are two cyclic codes encoding techniques:
Nonsystematic: Encoded data is obtained by performing M(p) * G(p). Systematic : Coded data(C2C1C0) is obtained by performing pq * M(p)/G(p) and
resultant Encoded data will be in form of M3M2M1M0C2C1C0 Here M(p) is input Message/Data of p
G(p) is constant algebraic expression of p
q is constraint length i.e. Systamatic (7,4) gives q = n-k
n is channel length and
k is data length
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 63
Experiment Procedure Let us consider an example for implementation of the experiment
Q) Design the encoder for the Systematic (7,4) cyclic code generated by a polynomial G(p)
= p3 + p + 1 and decode the data transferred by syndrome decoding procedure for
knowing input.
The implementation of cyclic encoding and decoding kit is based on the same example as
per Reference 1. The encoded data output will be M3M2M1M0C2C1C0 which is can be
obtained from Systematic coding procedure and the decoding the data will be done by
syndrome decoding procedure to re generate input and correct the data received from any
noisy channel.
Procedure:
Observe the signal chain , i.e. the input stage, coding stage, transmission stage and the decode stage
Put the mode selection switch in NORMAL mode and see the process and observe
output Student selects input message that is to be coded, by shifting the bits 0/1 by means
of pressing the keys 0, 1, CLEAR. Student codes this input message by pushing the key ‘CODE A BIT’ or by pushing
‘CODEALL’.
Now the message is coded and displayed in the transmission path. Student can now introduce an error in the transmission channel by means of pressing the keys BITSEL and ERRSET. On every push of the BITSEL one
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 64
CHANNEL CODER CHL CODE CHANNEL DECODER
CHANNEL
CODE
LED PAIR-15*
I/P
MESSAGE
LED PAIR-14*
O/ P MESSAGE
LEDPAIR-7*
CODER
LED PAIR-13*
DECODER
LEDPAIR-7*
LEDPAIR-6*
LED PAIR-12*
LEDPAIR-6*
LEDPAIR-5*
LED-4*
LED PAIR-11*
LEDPAIR-5*
LEDPAIR-4*
LED-3
LED PAIR-10*
LEDPAIR-4*
LEDPAIR-3
LED-2
LED PAIR-9*
LEDPAIR-3
LEDPAIR-2
LED-1
LED PAIR-8*
LEDPAIR-2
LEDPAIR-1
LEDPAIR-7*
LEDPAIR-1
LEDPAIR-0
LEDPAIR-6
LEDPAIR-0
LEDPAIR-5
1 0
CODE A BIT*
LEDPAIR-4
LED-
ERRDET
CLEAR
CODE ALL
LEDPAIR-3
LED-ERCOR
LED-DONE
LEDPAIR-2
LEDPAIR-1
DECODE
LEDPAIR-0
BITSEL ERRSET
RESETKIT
NORM
/CODE DEMO
*For Future purpose/ No use for this Experiment
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 65
bit is selected in the channel code, the selected bit will be completely in OFF mode at this
stage, if the student presses ERRSET key, the OFF mode bit will be inverted to make it as an
error.
Now the student pushes the DECODE key, the channel code is decoded and displayed as the Output message. If an error is detected in the channel code
ERRDETECTED LED glows, if an error is corrected from channel code then the ERRCORRECTED LED glows in the decoder Output stage.
Now put mode selection in CODE mode and repeat the process and observe the output changes.
Observe how the error detection and correction in code mode and hence the implementation of Binary Cyclic encoder and decoder.
Pushing Demo mode switch will give a brief description of implementation of KIT
Observations Table
NORMAL SYSTEM WITHOUT CODING
I/P data
Set
Normal
Transmission
Errors in
Transmission
Chal
data
O/P
Data
Chal
data
O/P
Data
1010 1010 1010 1000 1000
SYSTEM WITH BINARY CYCLIC CODING
Chal
data
O/P
Data
Chal
data
O/P
Data
1010 1010xyz 1010 1000xyz 1010
**xyz (as per our discussion C2C1C0) in the channel data above indicates the hamming encoded bits of corresponding data.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 66
12. CONVOLUTION CODE ENCODER AND DECODER
This topic comes under channel coding techniques which are employed for the purpose of
detecting and correcting errors, occurring in the communication channel.
Convolution coding is a special case of error-control coding.
Unlike a block coder, a convolution coder is a memory based device. Even though a
convolution coder accepts a fixed number of message symbols and produces a
fixed number of code symbols, its computations depend not only on the current set of input
symbols but on some of the previous input symbols.
Normally represented as (n, m, k) code
Where,
n= no of output bits
m= no of message bits
k= no of constraint bits/ memory bits
Terms:
Trellis code, Viterbi decoding algorithm
Aim of the experiment Employ one of the convolution codes and observe its error correcting performance
and decode-ability.
Specification
The kit is implemented with 16 bit micro controller giving lot of flexibility in experimenting
Facility to inject a custom bit stream as an input message
Verification of the injected bit stream on LEDS
Verification of the code word on LEDS
Facility to add multiple errors
Facility to observe the decoded output
Facility to observe the status of decoding i.e. error detected and error corrected status on
LEDS
Option keys to normal mode or code mode
Easy verification of where error is injected and what is the corresponding output.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 67
Demo mode support
Trellis and State Diagrams
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 68
Theory
(a) Rate : Ratio of the number of input bits to the number of output bits. In this
example, rate is 1/2 which means there are two output bits for each input bit.
(b) Constraint length : The number of delay elements in the convolutional coding. In
this example, with there are two delay elements.
(c) Generator polynomial : Wiring of the input sequence with the delay elements to
form the output. In this example, generator polynomial is . The
output from the arm uses the XOR of the current input, previous input
and the previous to previous input. The output from the uses the XOR of
the current input and the previous to previous input.
Convolutional encoder is a finite state machine (FSM),
processing information bits in a serial manner
Thus the generated code is a function of input and the states of
the FSM
In this (n,k,L)=(2,1,2) encoder each message bits influences a
span of n(L+1)=6 successive output bits
Viterbi Decoding
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 69
Implemented Encoder in this Kit
Implemented Example in the this Kit (from MIT lecture reference)
In this example encoder the output sequence is P0[n]P1[n].
Please note the order of the memory bits and the state bits,
here latest input is shown to the left in the state bits.
any conventions is OK, our state diagram and the trellis diagram should follow the same
convention.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 70
The State Diagram of the above coder
The branch metric is used for hard decision decoding. In this example, the receiver
gets the parity bits 00.
The trellis is a convenient way of viewing the decoding task and understanding the
time evolution of the state machine.
Decoding Process using Trellis diagram and minimum hamming distance method:
The figures shown are for the implemented coder in this kit.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 71
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 72
The Viterbi decoder in action. The decoded message is shown. To produce this
message, start from the final state with smallest path metric and work backwards, and then
reverse the bits. At each state during the forward pass, it is important to remember the arc
that got us to this state, so that the backward pass can be done properly.
The Viterbi decoder in action. This picture shows 4 time steps. The bottom-most
picture is the same as the one just before it, but with only the survivor paths shown. We can
observe from the above figures that, that state machine can come to a current state from one
of the 2 previous states only. There will be a branch metric if it has come from previous state
x, another branch metric if it has come from previous state y. these two branch metrics
translate to two accumulated path metrics if we add the accumulate the metric of all the
allowed previous paths. Then we retain only one previous state which has lower path
metric.
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 73
Experiment Procedure
CHANNEL CODER CHL CODE CHANNEL DECODER
CHANNEL CODE
LED PAIR-15
I/P MESSAGE
LED PAIR-14
O/ P MESSAGE
LEDPAIR-7
CODER
LED PAIR-13
DECODER
LEDPAIR-7
LEDPAIR-6
LED PAIR-12
LEDPAIR-6
LEDPAIR-5
LED PAIR-11
LEDPAIR-5
LEDPAIR-4
LED PAIR-10
LEDPAIR-4
LEDPAIR-3
LED PAIR-9
LEDPAIR-3
LEDPAIR-2
LED PAIR-8
LEDPAIR-2
LEDPAIR-1
LEDPAIR-7
LEDPAIR-1
LEDPAIR-0
LEDPAIR-6
LEDPAIR-0
LEDPAIR-5
1 0
LED-DONE
LEDPAIR-4
LED-ERRDET
CLEAR
CODE ALL
LEDPAIR-3
LED-ERCOR
LEDPAIR-2
LEDPAIR-1
DECODE
LEDPAIR-0
BITSEL ERRSET
RESETKIT
*Code A Bit and Code All are having same functionality
#For Future Use
Observations Table
NORMAL SYSTEM WITHOUT CODING
I/P data Set Normal Transmission Errors in Transmission
Chal
data
O/P
Data
Chal
data
O/P
Data
1010 1010 1010 1000 1000
SYSTEM WITH BLOCK CODING
Changed
i/p
Chal
data
Chal
Data
O/P
Data
1010 101000
Note-1
111101111000
Note-2
111100110000 101000
RCE DIGITAL COMMUNICATIONS LAB
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 74
Note-1: Channel input increases such that the memory states should become Zero’s
Note-2:Channel data as per Convolution encoding
Experiment Procedure:
Observe the signal chain , i.e. the input stage, coding stage, transmission stage and the
decode stage
Put the mode selection switch in NORMAL mode and see the process and observe output
Student selects input message that is to be coded, by shifting the bits 0/1 by means of
pressing the keys 0, 1, CLEAR.
Student codes this input message by pushing the key ‘CODE A BIT’ or by pushing
‘CODEALL’. Note that after pressing this the input data gets shifted up and two 00 bits are
added at lower end. This is required in the convolution decoding process, the last two bits
should always be zero , the state should come back to 0 , to decode hence this automatic 0
addition.
Now the message is coded and displayed in the transmission path. Student can now
introduce an error in the transmission channel by means of pressing the keys BITSEL and
ERRSET. On every push of the BITSEL one bit is selected in the channel code, the selected bit
will be completely in OFF mode at this stage, if the student presses ERRSET key, the OFF
mode bit will be inverted to make it as an error.
Now the student pushes the DECODE key, the channel code is decoded and displayed as
the Output message. If an error is detected in the channel code ERRDETECTED LED glows,
if an error is corrected from channel code then the ERRCORRECTED LED glows in the
decoder Output stage.
Now put mode selection in CODE mode and repeat the process and observe the output
changes.
Observe how the error detection and correction in code mode and hence the implementation
of convolution encoder and decoder.
Pushing Demo mode switch will give a brief description of implementation of KIT
Coding Theory Back Ground Information
Terminology Systematic / non-systematic codes
In coding theory, a systematic code is any error-correcting code in which the input data is embedded in the encoded output. Conversely, in a non-systematic code the output does not
contain the input symbols. Linear Code In coding theory, a linear code is an error-correcting code for which any linear combination of codewords is also a codeword. Linear codes are traditionally partitioned
into block codes and convolutional codes, although turbo codes can be seen as a hybrid of these two types.[1]Linear codes allow for more efficient encoding and decoding algorithms than other codes (cf. syndrome decoding).
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING 75
Block code
In coding theory, block codes refers to the large and important family of error-correcting codes that encode data in blocks. There is a vast number of examples for block codes, many of which have a wide range of practical applications. The main reason why the concept of block codes is so useful is that it allows coding theorists, mathematicians, and computer
scientists to study the limitations of all block codes in a unified way. Such limitations often take the form of bounds that relate different parameters of the block code to each other, such as its rate and its ability to detect and correct errors. Examples of block codes are Reed–Solomon codes, Hamming codes, Hadamard codes, Expander codes, Golay codes, and Reed–Muller codes. These examples also belong to
the class of linear codes, and hence they are called linear block codes. Convolution code In telecommunication, a convolutional code is a type of error-correcting code in which
each m-bit information symbol (each m-bit string) to be encoded is transformed into an n-bit symbol, where m/n is the code rate (n ≥ m) and the transformation is a function of the last k information symbols, where k is the constraint length of the code. Convolution codes are used extensively in numerous applications in order to achieve reliable data transfer, including digital video, radio, mobile communication, and satellite
communication. These codes are often implemented in concatenation with a hard-decision code, particularly Reed Solomon. Prior to turbo codes, such constructions were the most efficient, coming closest to the Shannon limit. Turbo code