Vous êtes sur la page 1sur 52

V.E.S.I.T.

Department of Electronics and


Telecommunication

DIGITAL
COMMUNICATION

D-14
(THIRD YEAR EXTC )

Subject :- Digital Communication Engineering

Lab:-402

Faculty Name :- Mrs. Sharmila Sengupta/ Mrs Monali Chaudhari


Class: - D- 14
Branch: - Electronics and Telecommunication
Semester:-

Sr. no.

Name of Experiments

1
Measurement of Bit Error Rate using COMMSIM software
2
Measurement of Coding gain (MATLAB) using Cyclic Code (study experiment )
3

Study of Binary Phase Shift Keying

Study of Binary Frequency Shift Keying

Using C-generation of Linear Block Code

Study of QAM and find its Bandwidth efficiency

Study of QPSK using Digital Storage oscilloscope and find its Bandwidth efficiency

Study of MSK generation and Detection (Study experiment )

Implementation of Huffman code using C

10

Comparison of M-PSK with M-QASK using Constellation diagram

11

Study of Equalizers (study experiment)

12

A) Comparision MQAM with noise and without noise


B) Plot of Eye Diagram using different Cuts off frequencies using COMMSIM

EXEPERIMENT NO:- 1

AIM: Measurement of Bit Error Rate using COMMSIM software.


THEORY:
Basic definition:
In digital transmission, the number of bit errors is the number of received bits of a data
stream over a communication channel that have been altered due
to noise, interference, distortion or bit synchronization errors.
The bit error rate or bit error ratio (BER) is the number of bit errors divided by the total number of
transferred bits during a studied time interval. BER is a unitless performance measure, often
expressed as a percentage.
Basic SNR parameter for Digital Communication Systems:
Just like S/N ration is a figure of merit in analog systems, Eb/N0 which is a normalized version of
SNR is a figure of merit for Digital Communication Systems.
Hence Eb = STb = S/Rb .(unitless)
N0
N/W N/W
Where Eb = bit energy
S = signal power
Tb = bit time
N0 = noise power spectral density
N = noise power
W = bandwidth
Rb = bit rate
Here Eb/N0 is just a version of S/N normalized by bandwidth and bit rate as follows:
Hence Eb = S .. W
N0 N R
Another important metric of performance it the plot of bit-error probability PB versus Eb/N0. For
Eb/N0x0, PB P0.
Also we see that as the ratio Eb/N0 increases the probability of error decreases.
Eb/N0 as a natural figure of merit:
Analog signals are infinite in time and hence they have infinite energy. So energy cannot be a useful
parameter to characterize this waveform. Hence they are characterized by energy per unit time i.e.
Power signal. Power signal has an infinite energy and finite average power.
However, in digital communication we transmit symbols within a particular window of time. If we
calculate the power of such waveforms averaged over a time then it comes to a zero. So power is not
a useful way to characterize them and hence we call them Energy signal.
Trade off between error performance and bandwidth:
From the graph we see that if the operating point is moved from point A to point B then the value of
Eb/N0 increases. If the system has a maximum available power of 8dB then we use coding to reduce
the error probability keeping the Eb/N0 same. Here we add redundancy to our message and hence it
increases the rate and correspondingly the bandwidth. So there is a trade-off between bandwidth and
error performance. Both uncoded and coded graphs have been shown.
Coding Gain:

Now suppose that we want to reduce the power requirement without increasing the error probability
then we have to shift the operating point from point D to point E. This can be done by using the
technique of coding. We define coding gain in this case. Coding Gain can be defined as the reduction
in that can be realized through the use of the code. Coding gain G can be expressed in dB such as
G (dB) = (Eb/N0) u (dB) - (Eb/N0) c (dB).
BER in general depends upon the input-output behaviour. It is related with probability of error by the
following formula
BER = (M-1) Pe
M/2
Conclusion:
Pe = 0.5 erfc ((Eb/N0)0.5)
Here from the practical values we see that as we go on increasing the value of M the probability of
error goes on increasing since the Euclidean distance goes on decreasing. This is also proved by the
theoretical values. However this is not satisfied when we consider the case of BPSK and QPSK.
Also as we increase the value of Eb/N0 the probability of error decreases.
BPSK

QPSK

8PSK

16PSK

BER vs. Eb/No(dB)

EXEPERIMENT:- 2
AIM: Study of cyclic codes and measurement of coding gain

PROBLEM STATEMENT: g(d)=d3 +d2+1


List all the code words by converting Gunsyst to Gsyst . Verify parity of messages using polynomial
division method. Draw encoder diagram and verify code word of the same message. Draw decoder
diagram and decode an all 1s received codeword. Find the coding gain by using the formula
r= k/n
THEORY:
A binary code is said to be cyclic if it exhibits two fundamental properties:
1. Linearity property: The sum of two code words is also a valid code word.
2. Cyclic property: Any cyclic shift of a code word is also a code word.
Property restates the fact that a cyclic code is a linear block code. To restate property 2 in
mathematical terms, let the n-tuple(x0, x1, x2, ........ xn-1) denote the code word of an (n,k) linear block
code. The code is cyclic code if n-tuples
(xn-1,x0,........,xn-2), (xn-2,xn-1,..........,xn-3).........,(x1,x2,.....,x0) are all code words.
This property suggests that we can treat the elements of a code word as of length n as the coefficients
of a polynomial of degree (n-1). That is, the code word with elements x 0, x1,....xn-1 may be represented
in the code word polynomial as follows:
x(D)= x0+x1D+..................+xn-1Dn-1
where D is an arbitrary real variable. Each power of D in the polynomial x(D) represents a one-bit
cyclic shift in time. Hence, multiplication of the polynomial x(D) by D may be viewed as a cyclic
shift or rotation to the right, subject to the constraint D n=1. This helps in restoring the polynomial
Dx(D) to order n-1 and the rightmost bit x n-1 is fed back at the right. This special form of polynomial
multiplication is referred to as multiplication modulo Dn-1.
GENERATOR POLYNOMIAL FOR CYCLIC CODES:
An (n,k) cyclic code word is specified by the complete set of code word polynomials of degree (n-1)
or less,which contains a polynomial of minimum degree (n-k) as a factor denoted by g(D) called the
generator polynomial of the code. The degree of g(D) is equal to the number of parity bits in the
code. The generator polynomial g(D) is equivalent to the generator matrix G as a description of the
code.
PROPERTIES:
1. The generator polynomial of an (n, k) cyclic code is unique in that it is the only code word
polynomial of minimum degree (n-k).
The generator polynomial of an (n, k) cyclic code can be expanded as follows:
n-k-1
g (D)= 1 + giDi + Dn-k
i=1
where gi is a coefficient equal to 0 or 1. That is, g(D) has two terms with coefficient 1
separated by (n-k-1) terms with undetermined coefficients.

2. Any multiple of the generator polynomial g(D) is a code word polynomial as shown by
x(D)= a(D)g(D)mod(Dn-1) where a(D) is a polynomial in D.
GENERATION OF NON-SYSTEMATIC CODE WORDS:
The non-systematic code words can be obtained by multiplication of message polynomial
with the generator polynomial.
For example, Given that g(D)= 1+ D2
Let the message be 1010.
Therefore, m(D)= 1+ D2 ( from left to right )
The non-systematic code word is then given by,
x(D)=m(D).g(D)
=(1+D2)(1+D2)=1+D2+ D2+D4
=1+ D4
GENERATION OF SYSTEMATIC CODE WORDS:
Step 1: Multiply the message polynomial m(D) by Dn-k to get Dn-km(D).
Step 2: Divide the shifted message polynomial D n-km(D) by the generator
polynomial
g(D) to obtain the remainder b(D).
Step 3: Add the remainder poly. b(D) to the shifted msg. poly. to obtain the code word poly.
x(D).
For example, g(D)= 1+D+ D2
m(D)= 1010
= 1+ D2
Step 1: Dn-km(D)=D3(1+ D2 )
=D3+D5
Step 2: Dn-km(D)

= D3+D5

g(D)

1+D+D2

After performing division, we get b (D) = D2


Step 3: The code word poly. x (D) is given by
x (D) = [ Dn-km(D)] Ex-OR[ b(D)]
= D2+D3+D5
Therefore, the code word vector is given by : [001:1010]
Where 001 refers to parity bits and 1010 refers to the message bits.
APPLICATIONS:
Bose-Chaudhari Hocquenqhem (BCH) Codes are the extensions of the cyclic codes.
EXEPERIMENT:- 3
BINARY PHASE SHIFT KEYING MODULATION TECHNIQUES
OBJECTIVE:
Study of Carrier Modulation Techniques by binary Phase Shift Keying method.

EQUIPMENTS:
Experimentor Kits ADCL-01.
Connecting chords.
Power supply.
1
2
CIRCUIT DIAGRAM:-

THEORY:
In Binary Phase Shift Keying (BPSK) modulation technique, the modulated output switches between
in-phase and out-of phase component of the carrier for every 'one' to' zero' transitions of modulating

signal. The carrier frequency chosen for BPSK modulation are 500 KHz (0 Degree) and 500KHz
(180 Degree).
CARRIER GENERATOR block on ADCL-01 generates the carrier waves 500 KHz (0 Degree) and
500KHz (180 Degree), which are available at SIN 1 and SIN 2 posts. The BPSK modulator is also
built around the 2 to 1 Analog Multiplexer, which switches between the 500 KHz (0 Degree) and 500
KHz (180Degree) signals for all one to zero transitions occurring in the transmitted data stream.
The phase detector works in the principle of squaring loops. First step in BPSK detection is the sine
to square wave conversion using a Schmitt trigger. This enables the BPSK detector to be built
around digital ICs. The Biphase splitter basically doubles the frequency component of the modulated
data and also ensures that the out of phase component of the modulation signal does not reach the
PLL. The PLL recovers the carrier frequency from the output of the phase splitter, but the frequency
of the recovered carrier is twice that of the transmitted carrier. So a Divide by 2 counters is used to
divide the frequency of the PLL output by 2, thus recovering the reference carrier. The delay flip-flop
is used to compare the phase of the incoming data and the reference carrier thereby recovering the
data.
1

Refer to Block Diagram & Carry out the following connections and switch settings.
Connect power supply in proper polarity to the kit ADCL-01 & switch it on. Select Data
pattern of simulated data using switch SW1.

Connect SDATA generated to DATA IN of NRZ-L CODER.

Connect the NRZ-L DATA output to the control input C1 of the Carrier Modulator logic.

Connect carrier component SIN 1 to IN1 of the Carrier Modulator Logic.

Connect carrier component SIN 2 to IN2 of the Carrier Modulator Logic.

Connect carrier modulated signal MOD OUT on ADCL-01 to the MOD IN of the BPSK
DEMODULATOR.

Observe SINE TO SQUARE CONVERTER output

Observe SQUARING LOOP output.

Observe DIVIDE BY 2 outputs.

Observe the BPSK DEMODULATED data at the output of the BPSK DEMODULATOR at b(t)
OUT.

Use RESET switch for clear observation of data output, if recovered data mismatches with
respect to transmitter data.

OBSERVATION:

Input NRZ-L Data at CONTROL INPUT.

Carrier frequency SIN 1 and SIN 2.

Carrier modulated signal at MOD OUT.

BPSK Demodulated signal at b (t) OUT.


Observe output of SINE TO SQUEARE CONVERTOR, SQUARING LOOP;

DIVIDE BY 2 on test points provided.

FREQUENCY SHIFT KEYING


AIM: To Study frequency shift keying
APPARATUS; FSK Sigma kit, DSO, CRO probes patch cords
CIRCUIT DIAGRAM:-

THEORY : In FSK frequency of the carrier is shifted according to the binary SL(t) = 2Ps cos wL
GENERATION OF BFSK:
The block dig. of BFSK consists of two oscillators which produce carrier frequency fh (640 KHz ) & fL (320
KHz ). The oscillators are applied to the I/p of multipliers (Balanced Modulators ).the other two i/p to the
multiplier are the binary data i/ps Ph (t) [NRZ ] &PL (T) [ NRZ ] inverse .the multipliers o/ps are then added
together to get the BFSK signal . thus when a binary (0 ) is transmitted NRZ= 1 &NRZ INVERSE = 0 &
vice versa .Thus the transmitted signal will either have the frequency Fh or FL.

SPECTRUM OF BFSK:The BFSK o/p in terms of variables Ph(t) &PL(t) is


VBFSK (t) = 2PsPh cos (wht+ h )+ 2PsPL cos (wht+ L )
Here

Ph (t)= 1/2+1/2 Ph (t)

Here

PL (t)= 1/2+1/2 PL (t )

Where Ph (t) & PL (t ) are bipolar variables which alternate between 1& -1 therefore the spectrum equation
on substitution is given as .
VBSK (t) = Ps/2 cos (wht+ h ]+ Ps/2 cos (wLt+ L]+ Ps/2 wh cos (wht+ h ]+
cos (wLt+ L]

Ps/2 wL

BFSK RECIEVER:
The BFSK receiver consist of two band pass filters one with centre frequency Fh & FL since FH-FL =2fb
the o/ps of the filter do not overlap . The BPF pass their corresponding mains lobes without much distortion
the o/ps of the filters are applied to the envelope detectors are compared by the comparator is used then o/p of
the comparator is the bit sequence b(t )
CIRCUIT DETAILS OF FREQUENCY SHIFT KEYING MODULATION AND DEMODULATION
WITH NOISE.
The FSK Modulation and Demodulation with noise consist of following sections.
1. Digital Data Generator section
2. ASK modulator using Balanced Modulator.
3. Carrier Generator.
4. Adder section.
5. Gaussian Noise Generator Section.
6. Noise Adder section
7. FSK demodulator using PLL detector
8. Integrated & Dump Filter (Matched Filter)
9. Comparator Section
10. Power supply section
Output 2K2 preset is used to vary output level. The outputs are two ASK Modulated signals.

3) RF Carrier Generator section: The function of this section is to generate phase synchronized carrier signal with respect to modulating digital
NRZ input. It converts 640KHz and 320 KHz. TTL Clock signal in to 640KHz and 320KHz. Sine wave
carriers signal using pie filter of lOOuH coil and two 100 Pf capacitors. These signal are given as carrier
signal to balanced modulators as one input.
(4) Adder section: This section adds two input signals with unity gain. This is used to add to ASK signals to converts into FSK
signal.
(5) Gaussian Noise Generator section: Four-transistor circuit is used to generate Gaussian noise signal. The amplitude pot varies its amplitude from
FSK signal.
(6) Noise Adder section: This section adds FSK modulated signal and Gaussian noise signal. The output is Noisy FSK signal.
(7) FSK demodulator: This circuit is based on PLL made of 1C 4046. The free running frequency of PLL is set at 320 KHz value.
Hence when FSK signal having two frequency 320 KHz and 640 KHz is given to it input, it produced
demodulated signal locked to 320 KHz. Hence output is raw data signal. This signal is then given to squarer
circuit.
(8) Integrated & Dump Filter (Matched Filter)
This section integrates the noisy FSK demodulated signal and then it is dumped at bit clock interval at the
output. The output is maximized at bit sampling pulse.
(7) Comparator section;
This Section converts integrated output of Matched filter into pure recovered data using comparator 1C 311.
(6) Power supply section:
The regulated power supply is used for different supply voltages.
Following output D.C. Voltages are required to operate FSK Modulation demodulation system.
+ 15V, 250mA, -15V, 250mA, + 5V, 250mA + 5V, 250mA
Three terminal regulators are used for different output voltages i.e. 1C 7805 for + 5V, 1C 7815 for + 15V, 1C
7915 for-15V, 7905 for-5V
These ICs are supplied different dc input voltages by two Bridge rectifiers consisting of D1-D4 and D5-D8 &
Iwo 1000/25 EC and 1000/10 EC. The capacitors at each input & each output are for filtering purpose.

PROCEDURE FOR FSK


Connect CRO channel-1 at carrier clock socket & observe it
Connect CRO channel-1 at bit clock socket & observe it
Connect CRO channel-1 at word clock socket & observe it
Connect CRO channel-1 at NRZ Data socket & observe it
Connect CRO channel-1 at NRZ Data Inverse socket & observe it
Connect CRO channel-1 at RF Career socket (in career generator section) for frequency 320 kHz &640 kHz.
& observe the waveform on CRO
Connect CRO channel-1 at NRZ Data socket& CRO channel-2 at the output of balanced modulator-1 &
observe ASK output
Connect CRO channel-1 at NRZ Data socket& CRO channel-2 at the output of balanced modulator-2&
observe ASK output
Apply both the output of balanced modukators-1&2 to adder section &check FSK output on CRO
Connect CRO channel-1 at Gaussian noise output & observe it keep noise level minimum.
observe recovered raw data signal t the o/p of Fsk demodulator
observe received pure NRZ data at the o/p of Data squarer
add Gaussians noise by rotating noise level pot & observe its effect on all received signals
OBSERVATION TABLE:SRNO

SIGNAL

1.

NRZ DATA

2.

NRZ DATA INVERSE

3.

CARRIER-1

4.

CARRIER-2

5.

BM-1O/P

6.

BM-2 O/P

7.

ADEER O/P

8.

FSK DEMOD. O/P

9.

COMP. O/P

CONCLUSION:-

AMPLITUDE

FREQUENCY

Thus according to change in I/p binary data the frequency of the o/p waveform is varied between 320k &640
kHz.

Linear Block Codes using Turbo C++.

AIM : To implement Linear Block Codes using Turbo C++.


Consider a systematic block code whose parity check equations are:
P 1 = m1 + m 2 + m 4
P 2 = m1 + m 3 + m 4
P 3 = m 1 + m2 + m 3
P 4 = m 2 + m3 + m 4
where mj are messages and Pi are check bits.
Find:
1. Find generator matrix and parity check matrix.
2. Find the number of errors that can be corrected by the code.
3. Is the vector 10101010 a code word?
4. Is the vector 01011100 a code word?
APPARATUS : Turbo C++
THEORY :

Given that,
P 1 = m1 + m 2 + m 4
P 2 = m1 + m 3 + m 4

P 3 = m 1 + m2 + m 3
P 4 = m 2 + m3 + m 4
The parity matrix is,

P=

[ ]
1
1
0
1

1
0
1
1

1
1
1
0

0
1
1
1

Now, the generator matrix G is of the form,


G = [ P Ik ]

G=

1
1
0
1

1
0
1
1

1
1
1
0

0 1
1 0

1 0
1 0

0
1
0
0

0
0
1
0

0
0
0
1

It is an (8,4) LBC.
n = 8, k=4, p = (n-k) = 4.
G = [ P Ik ] is the parity check matrix.

H will be of the form , H = [In-k PT]

H=

1
0
0
0

0
1
0
0

0
0
1
0

0 1
0 1

0 1
1 0

1
0
1
1

0
1
1
1

1
1
0
1

Let y be the received code word and x be the transmitted code word.
If e is the error pattern, then
y=x e
yHT = xHT eHT
But, x = MG;
M = [ m1 m2 m3 m4]
yHT = MGHT eHT

but, GHT = 0.
yHT = eHT = Syndrome = S
(1) Given the received codeword,
y1 = 10101010
Consider a single bit error pattern,
1

H = 0

Thus,

yH

= [1 0 1 0 1 0 1 0]

= [ 0 0 1 1] = S1

Syndrome is non-zero, it is not a valid codeword. As S 1 does not correspond


to any row of HT, thus it has a 2-bit error.
(2) y2 = 01011100

yH

= [01011100] 0

= [ 0 0 0 0] = S2

Since, the Syndrome is an all zero syndrome;


y = 01011100 is a valid codeword.

By hamming bound,
t

n-k

i=0

Ci

2n-k = 24 = 16
16 8C0 + 8C1 = 9
=> t = 1
Thus, the code can correct an error of 1 bit only.
APPLICATIONS :
(1) Linear block code is used in error correction and detection schemes.
(2) Properties of linear block codes are used in many applications. E.g.
Syndrome-Coset uniqueness property of linear block codes is used in
Trellis shaping, one of the best known in shaping codes. The same
property is used in sensor networks for distributed source coding.
(3) Binary linear codes are ubiquitous in electronic devices and digital storage
media. E.g. Reed Solomon code (a type of linear block codes) is used to
store digital data on a compact disc.

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<math.h>
int d[20][4],x[20][8];
void bin(int i,int n)
{
int j;
for(j=n-1;j>=0;j--)
{
switch( (d[i][j]))
{
case 2:
d[i][j]=0;
d[i][j-1] += 1;
break;
case 3:
d[i][j]=1;
d[i][j-1] += 1;
break;
default:
break;
}
}
}
int code(int n)
{

LINEAR BLOCK CODES

int k=2,i,j;
for(i=0;i<n-1;i++)
k *= 2;
for(i=0;i<20;i++)
{
for(j=0;j<4;j++)
d[i][j]=0;
x[i][j]=0;
}
d[1][n-1]=1;
//cout<<k;
for(i=2;i<k;i++)
{
for(j=0;j<n;j++)
{
if(j==n-1)
d[i][j] = d[i][j]+d[i-1][j]+1;
else
d[i][j] = d[i][j]+d[i-1][j];
}
bin(i,n);
}
return (k);
}
void main()
{
clrscr();
int f,a,b,n,k,i,j,p[10][10],g[10][10],h[10][10],ht[10][10],y[10],s[10];
cout<<"enter the total no. of bits, n";
cin>>n;
cout<<"enter the no. of msg bits, k";
cin>>k;
for(i=0;i<k;i++)
{
cout<<"\n\n enter the co-efficients for row"<<i+1<<endl;
for(j=0;j<k;j++)
{
cin>>p[j][i];
g[j][i]=p[j][i];
}
}
for(i=0;i<k;i++)
{
for(j=k;j<n;j++)
{
if(j==i+k)
g[i][j]=1;
else
g[i][j]=0;
}
}
cout<<"\n\nG = ";
for(i=0;i<k;i++)
{
cout<<endl<<"\n\t";

for(j=0;j<n;j++)
cout<<g[i][j];
}
a=code(k);
for(i=0;i<a;i++)
{
for(j=0;j<n;j++)
{
for(b=0;b<k;b++)
x[i][j]=x[i][j]^(d[i][b]&g[b][j]);
}
}
int dm=n+1,t=n+1,w;
for(i=1;i<a;i++)
{
if(t<dm)
dm=t;
t=0;
for(j=0;j<n;j++)
t = t+x[i][j];
}
cout<<endl<<"\n\n Dmin =";
cout<<"\t"<<dm;
t=((dm-1)/2);
w=dm-1;
cout<<endl<<"\nThe system can detect upto "<<w<<" errors" ;
cout<<endl<<"\nThe system can correct upto "<<t<<" errors" ;
do
{
cout<<endl<<"\nenter the received code y = ";
for(i=0;i<n;i++)
{
cin>>y[i];
}
for(i=0;i<k;i++)
{
for(j=0;j<k;j++)
{
if(i==j)
h[i][j]=1;
else
h[i][j]=0;
}
}
for(i=0;i<k;i++)
{
for(j=k;j<n;j++)
h[i][j]=p[j-k][i];
}
cout<<"\n\nH = ";
for(i=0;i<k;i++)
{
cout<<endl<<"\n\t";
for(j=0;j<n;j++)
cout<<h[i][j];
}
for(i=0;i<k;i++)

{
for(j=0;j<n;j++)
ht[j][i]=h[i][j];
}
cout<<"\n\nHt = ";
for(i=0;i<n;i++)
{
cout<<endl<<"\n\t";
for(j=0;j<k;j++)
cout<<ht[i][j];
}
for(i=0;i<k;i++)
s[i]=0;
for(i=0;i<k;i++)
{
for(j=0;j<n;j++)
s[i]=s[i]^(y[j]&ht[j][i]);
}
cout<<endl;
cout<<"\nsyndrome =";
for(i=0;i<(k);i++)
cout<< " "<<s[i];
b=0;
for(i=0;i<k;i++)
b += s[i];
if(b==0)
cout<<endl<<"\nThe Rxd. code has no. errors";
else
{
int c=n+1;
b=0;
for(i=0;i<n;i++)
{for(j=0;j<k;j++)
{
if(s[j]==ht[i][j])
b++;
}
if(b==4)
c=i;
b=0;
}
if(c==n+1)
cout<<endl<<"\nThe Rxd. code has more than "<<t<<" errors";
else
cout<<endl<<"\nFrom Syndrome Table "<<c<<" bit is in error";
}
cout<<"\n\n press 1 to continue or 0 to exit";
cin>>f;
}while(f==1);
}
OUTPUT:
enter the total no. of bits,n 8
enter the no. of msg bits, k 4

enter the co-efficients for row1


1
1
0
1
enter the co-efficients for row2
1
0
1
1
enter the co-efficients for row3
1
1
1
0
enter the co-efficients for row4
0
1
1
1
G=

11101000
10110100
01110010
11010001
Dmin = 4
The system can detect upto 3 errors
The system can correct upto 1 errors
enter the received code y = 1
0
1
0
1
0
1
0
H=

Ht =

10001101
01001011
00101110
00010111

1000
0100
0010
0001
1110
1011
0111
1101

syndrome = 0 0 1 1
The Rxd. code has more than 1 errors
press 1 to continue or 0 to exit0

EXEPERIMENT:- 6
CONSTELLATION DAIGRAM AND BANDWIDTH EFFICIENCY OF QAM
AIM:

To study the constellation diagram of QAM.


Study of bandwidth efficiency in Quadrature Amplitude modulation techniques.

EQUIPMENT:

Experiment Kit ADCL-05.


Connecting Chords.
Power supply.
THEORY:

CONSTELLATION DIAGRAM
BLOCK DIAGRAM FOR OBSERVATION OF CONSTELLATION DIAGRAM
The constellation diagram or geometrical representation is as shown in fig.1 below. The
points in signal space corresponding to each of the eight possible Transmitted signals
are indicated by dots. For each such signal we can recover three bits rather than one.
The distance of a signal point from the origin is (Es)^1/2 which is the square root of the
signal energy associated with the symbol, that is Es=Ps * Ts = Ps(2Tb). As we know the
ability to determine a bit without error is measured by the distance in signal space
between points corresponding to the different values of the bit. We note from fig. that
points
Which differ in a single bit are separated by the distance d = 2(Ps)^1/2 Tb =2(Eb)^1/2
where Eb is the energy contained in a bit transmitted for a time Tb. This distance for
QPSK is the same as for BPSK.
Hence, altogether, we have the important result that, in spite of the reduction by a
factor of two in the bandwidth required by QPSK in comparison with BPSK, the noise
immunity of the two systems are the same. The number of dot points appearing in the
constellation diagram depends on the number of symbol generated due to I, Q and C
bit. The position of dot points in the quadrant of the constellation diagram is also
depends on the symbol Generated due to the I, Q and C bit as shown above. The fig.2
shows examples of constellation diagram. In diagram the data pattern used is
111001010011100101110000. If we plot the expected data pattern of I, Q and C bit as
shown in fig.2, then there are 8 symbols generated as 000, 001, 010, 011, 100, 101,
110, 111 thus there are 8 dots appearing in the constellation diagram in all four
quadrants. Bandwidth efficiency of QAM is defined by the ratio of bit transmission
speed in QAM to Bandwidth of QAM signal. It is given by
Bandwidth Efficiency = Fb / Bw
Where, Fb is Bit transmission speed and
Bw is the bandwidth of signal transmitted.
The more the bandwidth efficiency more is the data transfer within the same bandwidth
of signal transmission.
PROCEDURE:
(A)Study of constellation diagram.

Refer to the block diagram and carry out the following connections and Switch settings.
Connect power supply in proper polarity to the kit ADCL-05 and ADCL-06 switch it on.
Select Data pattern of simulated data using switch SW1, SW2, SW3.
Connect SDATA generated to DATA IN of NRZ-L CODER.
Connect the NRZ-L coded data at DATA OUT to the DATA IN of the TRIBIT CODER.
Connect the clock generated SCLOCK to CLK IN of TRIBIT CODER.\

Connect the Tribit data I BIT, Q BIT & C BIT to control input C1, C2 and C3 of CARRIER
MODULATOR respectively.
Connect sine carrier to input of CARRIER MODULATOR as follows:
SIN 1 to IN 1.
SIN 2 to IN 2.
SIN 3 to IN 3.
SIN 4 to IN 4.
Connect QAM modulated signal MOD OUT on ADCL-05 to the MOD IN of the QAM
DEMODULATOR on ADCL-06.
Output of second squarer at SQUARER 1
Output of second squarer at SQUARER 2
Recovered carrier of 2 MHz at PLL
Four sampling clocks at the output of Sampling Clock Generator
Two added outputs at the output of ADDER
Connect I BIT, Q BIT & C BIT outputs of QAM Demodulator to I BIT IN, Q BIT IN & C
BIT IN posts of Data Decoder.
Put switch SW3 on QAM mode.
Similarly we can observe the constellation diagram for DQAM. For this
Follow the procedure no 4, and then connect X & Y port of constellation block to X-channel
and Y-channel of CRO respectively.
Observe the decoded data at DATA OUT post of data decoder. Compare the decoded data with
SDATA on ADCL-05.
Now connect X & Y port of CONSTELLATION BLOCK to X-channel and Y-channel of
CRO respectively.
(B)Bandwidth efficiency of QAM technique.

Measure the transmission clock at S.CLOCK post i.e. 250 KHz.


Divide this clock by the number of bits transmitted simultaneously, i.e.3 Bits in this case (I, Q
& C Bits).
Transmission clock is the bit transmission speed (250 KHz) and Bandwidth of modulator is
clock divide by the number of bits transmitted (i.e. 250 KHz / 3 = 83.33 KHz).
From the above data, calculate bandwidth efficiency by substituting these values in the
formula as follows; Bandwidth Efficiency = Fb / Bw
i.e. =250/83.33 = 3
OBSERVATIONS:
ON KIT ADCL-05.

Input NRZ-L coded Data at DATA OUT of NRZ-L coder.

Tribit coded data I BIT, Q BIT & C BIT at the output of tribit coder.

Carrier signal SIN 1 to SIN 4.

QAM modulated signal at MOD OUT of carrier modulator.

ON KIT ADCL-06.

Output of first squarer at SQUARER 1.

Output of second squarer at SQUARER 2.

Recovered carrier of 2MHz at PLL.

Four sampling clocks at the output of SAMPLING CLOCK GENERATOR.

Two added outputs at the output of ADDER.

Recovered data bits (I, Q & C bits) at the output of ENVELOPE

DETECTORS.

Receiver decoding clocks at DECODER TIMING LOGIC.

Recovered NRZ-L data from I & Q bits at the output of DATA DECODER.

CONCLUSION:
It is observed from the constellation diagram that, the symbol generated due to I bit, Q
bit & C bit have eight possible values and lies in four quadrants. Also from the
constellation diagram we can determine the distance between the two symbols. The
transmitted signal, if it changes, changes phase by 90 deg. Rather than by 180 deg. as
in BPSK. Bandwidth Efficiency generally depends on the number of bits transmitted
simultaneously.

EXEPERIMENT:- 7
OBSERVATION OF THE CONSTELLATION DAIGRAM FOR I & Q DATA BITS.
AND STUDY OF BANDWIDTH EFFICIENCY OF QPSK.
OBJECTIVE:

To study the constellation diagram of QPSK data format.


Study of bandwidth efficiency in Quadrature Phase shift keying

EQUIPMENT:

Experimentor Kits ADCL-02


Connecting Chords.
Power supply.

CIRCUIT DIAGRAM:-\

THEORY
The constellation diagram or geometrical representation is as shown in fig 1.below the points in
signal space corresponding to each of the four possible transmitted signal is indicated by dots. For
each such signal we can recover two bits rather than one. The distance of a signal point from the
origin is (Es)^1/2 which is the square root of the signal energy associated with the symbol, that is
Es=Ps * Ts = Ps(2Tb). As we know the ability to determine a bit without error is Measured by the
distance in signal space between points corresponding to the different values of the bit. We note
from fig. that points which differ in a single bit are separated by the distance d = 2(Ps)^1/2 Tb = 2
(Eb)^1/2 where Eb is the energy contained in a bit transmitted for a time Tb. This distance for
QPSK is the same as for BPSK.
Hence, altogether, we have the important result that, in spite of the reduction by a factor of two in the
bandwidth required by QPSK in comparison with BPSK, the noise immunity of the two stems are the
same. The number of dot points appearing in the constellation diagram depends on the number of
symbol generated due to I and Q bit. The position of dot points in the quadrant of the constellation
diagram is also depends on the symbol generated due to the I and Q bit as shown above. The fig
below shows some examples of different constellation diagram.

In fig.2 the data pattern used is 01011010. if we plot the expected data pattern of I and Q bit as
shown in fig 2 , then there are 4 symbol generated as 01,11,10 and 00. thus there are 4 dots
appearing in the constellation diagram in all four quadrant.
Bandwidth efficiency of QPSK is defined by the ratio of bit transmission speed in QPSK to
Bandwidth of QPSK signal. It is given by
Bandwidth Efficiency = Fb / Bw
Where, Fb is Bit transmission speed and
Bw is the bandwidth of signal transmitted.
The more the bandwidth efficiency more is the data transfer within the same bandwidth of signal
transmission.

PROCEDURE:

Refer to Block Diagram & Carry out the following connections and switch Settings
Connect power supply in proper polarity to the kit ADCL-02/03 & switch it on.
Select Data pattern of simulated data using switch SW1.
Connect SDATA generated to DATA IN of NRZ-L CODER.
Connect the coded data NRZ-L DATA to the DATA IN of the DIBIT CONVERSION.
Connect the clock generated SCLOCK to CLK IN of DIBIT CONVERSION
Observe the coded signal I bit & Q bit on oscilloscope.
8)Connect I bit to X-channel of CRO & Q bit to Y-channel of CRO.
Put the CRO in X-Y mode.
10)Observe the constellation diagram on oscilloscope as shown in the block diagram and
refer theory to observe different types of constellation diagram.
11) Observe the constellation diagram for DQPSK modulation also by
referring connection of DQPSK from experiment no.2.

Bandwidth efficiency of QPSK technique.

Measure the transmission clock at CLK IN post i.e. 250 KHZ.


Divide this clock by the number of bits transmitted simultaneously, i.e. 2 bits In this case ( I &
Q Bits ).
Transmission clock is the bit transmission speed (250 KHz) and
Bandwidth of modulator is clock divided by the number of bits transmitted (125 KHz).
From the above data, calculate bandwidth efficiency by substituting these Values in the
formula as follows
Bandwidth Efficiency = Fb / Bw
i.e. =250/125 = 2

OBSERVATION ON KIT ADCL-02


Observe the following coded signal on one of the oscilloscope and INPUT
DATA / NRZ-L on second channel simultaneously and plot it on the paper.
Coded data I bit.

CONCLUSION:
It is observed from the constellation diagram that, the symbol generated due to I bit & Q bit have four
possible values and lies in four quadrants. Also from the constellation diagram we can determine the
distance between the two symbols and can conclude that after each time Tb either be or bo (i.e. I or
Q bit) can change, but both cannot change at the same time. After each time Tb, the transmitted
signal, if it changes, changes phase by 90 deg. rather than by 180 deg. as in BPSK.
Bandwidth Efficiency generally depends on the number of bits transmitted simultaneously.

EXEPERIMENT:AIM: Study of Minimum Shift Keying (MSK).


THEORY: In MSK, the transmitted signal is
VMSK(t) = 2Ps[be(t) * sin 2(t/4Tb)] * cos ot + 2Ps[bo(t) * cos 2(t/4Tb)] * sin ot
The above equation can be written as
VMSK(t) = 2Ps[{bo(t) + be(t)}/s] * sin (o + )t + 2Ps[{bo(t) + be(t)}/2] * sin (o - )t
Where; = 2/4Tb = 2*(fb/4)
In MSK, the two frequencies f H and fL are chosen to insure that the two possible signals are
orthogonal over the bit interval Tb. Thus
sin Ht * sin Ltdt = 0

; over the limits 0 to Tb

The above equation will be satisfied provided it is arranged, with m and n integers, that
2 * (fH fL) * Tb = n
and

2 * (fH + fL) * Tb = m

Furthermore, using equation for , we get


fH = fo + (fb/4)

and

fL = fo - (fb/4)

Using the above equations, we find that


fb * Tb = fb * (1/fb) = 1 = n
and

fo = (m/4) * fb

The above equation shows that since n=1, fH and fL are as close together as possible for orthogonality
to prevail. It is for this reason that the system is called Minimum Shift Keying. Equation shows that
frequency fo is an integral multiple of fb/4. Thus
fH = (m + 1) * (fb/4)
and

fL = (m 1) * (fb/4)

POWER SPECTRAL DENSITY OF MSK:


The baseband waveform which multiplies the sinot in MSK is
p(t) = 2Ps * bo(t) * cos (/2) * fo * t

-Tb t Tb

The waveform p(t) has a power spectral density Gp(f) given by


Gp(f) = (32Eb/2) * [{cos 2f/fb}/{1 (4f/fb)2}]2

The power spectral density for the total MSK signal is


GMSK (f) = (8/2) Eb [{(cos 2(f fo)/fb )/(1 {4(f fo)/fb}2)}2 +
{(cos 2(f + fo)/fb)/(1 {4(f + fo)/fb}2)}2]
The plots of power spectral densities of QPSK (which is same as OQPSK) and MSK are shown on
graph paper. The main lobe in MSK is wider than the main lobe in QPSK. In MSK the bandwidth
required to accommodate this lobe is 2*3/4fb = 1.5fb while it is only 1.0fb in QPSK. However in MSK
the side lobes are very greatly suppressed in comparison to QPSK. In QPSK G(f) falls off as 1/(f) 2,
while in MSK G(f) falls off as 1/(f)4. It turns out that in MSK 99% of the signal power is contained in
a bandwidth of about 1.2fb while in QPSK the corresponding bandwidth is about 8fb.
PHASE CONTINUITY IN MSK:
The MSK transmitted signal can be written as

VMSK(t) = bo(t) * 2Ps * sin[ot + bo(t)be(t)t]


And let

= ot + bo(t)be(t)t

For convenience we represent the phase as +(t) and -(t) where

And

+(t) = (o + )t

; bo(t) * be(t) = +1

-(t) = (o - )t

; bo(t) * be(t) = -1

Which have been plotted on graph paper.


Consider a change first in be(t), which will cause a phase change which is a multiple of 2, which is
equivalent to no change at all. Now consider the effect of change in bo(t). In this case the phase
change in (t) will be an odd multiple of , that is, a phase change equivalent to . But this will cause
the coefficient bo(t) will also change sign, yielding an additional phase change. Hence, a change in
bo(t) produces no net phase discontinuity.
Thus the phase continuity in MSK has been established.
APPLICATIONS:
GSM
MERITS:
Continuous phase.
Smooth signal.
No amplitude variations when passed through filters.
ICI is reduced as side lobes are small.

DEMERITS:
Complicated.
Bandwidth= 1.5fb

EXEPERIMENT:AIM:-COMPARISON OF MPSK AND MQASK USING MATLAB.


THEORY: When N bits are lumped together so that in this N bit symbol, extending over the time
NTb, there are 2N=M possible symbols.
MPSK
These symbols are represented by sinusoids of duration NTb=Ts which differ from one another
by the phase 2*/M. Thus MPSK is represented as
Vm= (2Ps) *[ cos(o + m)]
Symbol phase angle is given as

(m=0,1,2,..M-1)

m = (2m + 1) * /M
Considering orthonormal waveforms as coordinate axes the transmitted signal is
Vm= [(2Ps) * cosm] * cos ot [(2Ps)* sinm] * sin ot
Now defining po and pe by
Po= (2Ps) * sinm
Pe= (2Ps) * cosm
Hence the equation becomes
Vm= Pe * cos ot Po * sin ot
where both Pe and Po change every NTb=Ts and can assume any of M possible values.
CONSTELLATION DIAGRAM

MQASK
In MPSK we transmit, in any symbol interval, one signal or another which are distinguished from one
another in phase but all are of same amplitude. However MQASK is a system wherein the signal
vectors differ not only in their phase but also in their amplitude. It involves direct modulation of
carriers in quadrature.
A typical signal can be represented as
VQASK = ki{[(2Ps) * cosm] * cos ot [(2Ps)* sinm] * sin ot }
where i = 0 to 3.
Where we have considered orthonormal waveforms as coordinate axes.
CONSTELLATION DIAGRAM

COMPARISON
The advantage of using the amplitude and phase shift varying system as the description suggests is
that we are able to improve the noise immunity of the system.
Hence the noise immunity of a MQASK system is always better as compared to a MPSK system
considering the same no. of bits clubbed together.
Also the MQASK system has a lower error rate as compared to its MPSK counterpart.
The distance between signals is greater for MQASK when compared.
However the bandwidth remains the same for both.Also the type of receiver used are same.
Thus considering all these factors we can say that MQASK system is better than its MPSK
counterpart.

EXEPERIMENT:- 10
AIM: To study Huffman coding
THEORY:
The Huffman code is a source code whose average word length approaches the fundamental
limit set by the entropy of a discrete memory less source namely H.The Huffman code is
optimum in the sense that no other decodable set of code-words has a smaller average codeword length for a given discrete memory less source. The essence of the algorithm used to
synthesize the code is to replace the prescribed set of source statistics of a discrete memory
less source with a simpler one. This reduction process is continued in a step-by-step manner
until we are left with a final set of source statistics (symbols) of only two, for which (0,1) is
an optimal code. Starting from this trivial code, we then work backward and thereby construct
an optimal code for a given source

Specifically, the Huffman encoding algorithm proceeds as follows:


1. The source codes are listed in order of decreasing of decreasing probability. The two source
symbols of lowest probability are assigned a 0 and a 1.(This part of the step is referred to as a
splitting stage).
2. These two source symbols are regarded as being combined into a new source symbol with
probability equal to the sum of the two original probabilities.(The list of source symbols and
therefore source statistics is thereby reduced in size by one) The probability of the new
symbol is in list in accordance with its value.
3. The procedure is repeated until we are left with a final list of source statistics (symbols) of
only two for which a 0 and a 1 are assigned.
The code for each (original) source symbol is found by working backward and
tracing the sequence of 0s and 1s assigned to that symbol as well as its successors.
It is noteworthy that the Huffman encoding process is not unique. In particular, we
may have two variations in the process that are reasonable for the non uniqueness of the code.
First, at the splitting stage in the construction of a Huffman code, there is arbitrariness in the way
a 0 or a 1 are assigned to the last two symbols. Second, ambiguity arises when the probability of a
combined symbol (obtained by adding the last two probabilities pertinent to a particular step) is
found to equal another probability in the list. We may proceed by placing the probability of the
new symbol as high as possible. Alternatively, we may place it as low as possible.(It is presumed
that whichever way the placement is made-high or low, it is consistently adhered to throughout
the encoding process.) But, this time, noticeable differences arise in the code words in the
resulting source codes can have different lengths. Nevertheless, the average code word length
remains the same.
As a measure of the variability in code word lengths of a source code, we define the
variance of the average code word length l over the ensemble of source symbols as

Where p0,p1,..pk-1 are the source statistics and lk is the length of the code-word assigned to the
source symbol sk. It is usually found that when a combined symbol is as high as possible, the
resulting Huffman code has a significantly smaller variance than when it is moved as low as
possible. On this basis, it is reasonable to choose the former Huffman code over the latter.
APPLICATIONS:
1. Arithmetic coding can be viewed as a generalization of Huffman coding, in the sense that
they produce the same output when every symbol has a probability of the form 1/2 k; in
particular it tends to offer significantly better compression for small alphabet sizes.
2. Huffman coding today is often used as a "back-end" to some other compression methods.
DEFLATE (PKZIP's algorithm) and multimedia codecs such as JPEG and MP3 have a
front-end model and quantization followed by Huffman coding.
HUFFMAN PROGRAM:

#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
typedef struct que* queueptr;
typedef queueptr treeptr;
typedef struct que
{
float v;
int id;
char cd[10];
queueptr next;
queueptr prev;
treeptr rs;
treeptr ls;
treeptr f;
}queue;
queue el1;
queueptr front=&el1;
queueptr rear=front;
queueptr *storage;
int c=0;
void insert(queueptr,int);
void addend(queueptr);
void addfront(queueptr);
void add(queueptr,queueptr);
void gencd(queueptr);
void disp();
void main()
{
clrscr();
int n,m;
cout<<"n=";
cin>>n;
m=n;
//cout<<" xx "<<front;
*storage=front;
c++;
queueptr l,l1,l2;
l1=front;
cout<<"enter probabilities\n";
cout<<"m1\t";
cin>>front->v;
float s;
s=(front->v);
front->id=1;
front->next=NULL;
front->prev=NULL;
for(int i=2;i<=n;i++)
{
l=(queueptr)malloc(sizeof(queue));
l->id=i;
cout<<"m"<<i<<"\t";
cin>>l->v;
s=s+(l->v);

l->rs=NULL;
l->ls=NULL;
l->f=NULL;
l->prev=NULL;
l->next=NULL;
*(storage+c)=l;
c++;
l1=l;
//cout<<l<<endl;
strcpy(l->cd," ");
insert(l,i);
}
//if(s!=1)
//return;
while(n>2)
{
l=(queueptr)malloc(sizeof(queue));
l1=rear;
l2=rear->prev;
l1->prev=NULL;
l2->next=NULL;
rear=l2->prev;
rear->next=NULL;
l->rs=l1;
l->ls=l2;
l1->f=l;
l2->f=l;
l->f=NULL;
l->v=l1->v + l2->v;
n--;
insert(l,n);
}
strcpy(front->cd,"0");
front=front->next;
strcpy(front->cd,"1");
gencd(l);
cout<<"\n\n\ncodes\n";
for(i=0;i<m;i++)
{
l=*(storage);
//cout<<l<<endl;
cout<<"m"<<i+1<<"\t";
storage++;
printf("%6s",(l->cd));
cout<<endl;
}
getch();
}
void addend(queueptr l)
{
rear->next=l;
l->prev=rear;
l->next=NULL;
rear=l;
}
void add(queueptr l,queueptr l1)

{
l->next=l1;
l->prev=l1->prev;
l1->prev=l;
l->prev->next=l;
}
void addfront(queueptr l)
{
l->next=front;
front->prev=l;
l->prev=NULL;
front=l;
}
void insert(queueptr l,int i)
{
int k=1;
queueptr l1;
l1=front;
while(l->v <= l1->v)
{
k++;
l1=l1->next;
}
if(k==i)
{
addend(l);
}
else if(k==1)
{
addfront(l);
}
else
{
add(l,l1);
}
}
void disp()
{
queueptr l=front;
while(l!=NULL)
{
cout<<l->id<<"\t"<<l->v<<endl;
l=l->next;
}
}
void gencd(queueptr l)
{
queueptr l1,l2;
if(l->ls==NULL)
{
return ;
}
l1=l->ls;
l2=l->rs;

strcpy(l1->cd,l->cd);
strcat(l1->cd,"0");
strcpy(l2->cd,l->cd);
strcat(l2->cd,"1");
gencd(l1);
gencd(l2);
}
Output:
n=5
enter probabilities
m1
.5
m2
.25
m3
.125
m4
.0625
m5
.0625
codes
m1
0
m2
10
m3
110
m4
1110
m5
1111
Null pointer assignment

Study of Equalizers
AIM :- Study of Equalizers (Study Exeperiment)
EQUALISER
M=4;
x=randint(2000,1,M);
y=pskmod(x,M);
trainlen=100;
channel=[0.95;0.4;0.3;0.1+0.2i];
yr=filter(channel,1,y);
eq1=lineareq(8,lms(0.01));
eq1.SigConst=pskmod([0:M-1],M);
[symbolest,yr_eq]=equalize(eq1,yr,y(1:trainlen));
h=scatterplot(yr,1,trainlen,'bx');
hold on;
scatterplot(symbolest,1,trainlen,'g.',h);
scatterplot(eq1.SigConst,1,0,'r*',h);
legend('Filtered Signal','Equalized Signal','Ideal signal constellation');
hold off;
xr_noeq=pskdemod(yr,M);
xr_eq=pskdemod(yr_eq,M);
[ne_noeq,er_rate_noeq]=symerr(xr_noeq(trainlen+1:n),x(trainlen+1:n));
[ne_eq,er_rate_eq]=symerr(xr_eq(trainlen+1:n),x(trainlen+1:n));

(A) CONSTELLATION DIAGRAM OF M-QAM WITH NOISE


M=128;
x=randint(1000,1,M);

%uniformly distributed random integers

yl=qammod(x,M);

%modulation

yln=awgn(yl,10,'measured');

%SNR of 10dB

scatterplot(yln);

%constelaation diagram

ylr=qamdemod(yln,M);

%demodulation

[num_error,er_rate]=symerr(x,ylr);
y2n=awgn(y1,5,'measured');

%SNR of 5dB

scatterplot(y2n);

%constellation digram

y2r=qamdemod(y2n,M);

%demodulation

[num_error,er_rate]=symerr(x,y2r);

(B) CONSTELLATION DIAGRAM OF M-QAM WITHOUT NOISE


M=128;
x=randint(1000,1,M);
yl=qammod(x,M);
scatterplot(yl);
ylr=qamdemod(yl,M);
[num_error,er_rate]=symerr(x,ylr);

AIM: PLOT OF EYE DIAGRAMS USING DIFFERENT CUT-OFF FREQUENCIES


USING COMMSIM.

Vous aimerez peut-être aussi