You are on page 1of 19

NARAYANA

ENGINEERING COLLEGE
GUDUR

ADVANCED COMMUNICATION SYSTEMS LAB MANUAL

DEPARTMENT OF
ELECTRONICS AND COMMUNICATION
ENGINEERING
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY ANANTAPUR
M.Tech I year II Semester (DSCE) L T P C
0032
(17D38207) ADVANCED COMMUNICATION SYSTEMS LAB
Note:
1) Minimum of 10 Experiments have to be conducted
2) All Experiments may be Simulated using MATLAB and to be verified using related
training kits.

1. Measurement of Bit Error Rate using Binary Data


2. Determination of output of convolution Encoder for a given sequence
3. Determination of output of convolution Decoder for a given sequence
4. Efficiency of Direct Sequence Spread Spectrum Technique
5. Simulation of Frequency Hopping (FH) Spread- Spectrum
6. Implementation of an optimum receiver for the AWGN channel.
7. Measurement of the effect of Inter-Symbol Interference.
8. Design of FSK system
9. BPSK Modulation and Demodulation Techniques
10. DQPSK Modulation and Demodulation Techniques
11. 8-QAM Modulation and Demodulation Techniques
12. OFDM Transceiver design
13. Performance evaluation of CDMA system
14. Implementation of QPSK Modulation with Rayleigh Fading and AWGN channel

NARAYANA ENGINEERING COLLEGE::GUDUR


LIST OF EXPERIMENTS TO BE CONDUCTED
EXP NO:1 Measurement of BIT ERROR RATE (BER) using DATE:
binary data

Aim: To measure BER of binary data

Apparatus:
Personal Computer
Matlab software

Theory:
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.
The bit error probability pe is the expectation value of the BER. The BER can be considered
as an approximate estimate of the bit error probability. This estimate is accurate for a long
time interval and a high number of bit errors.
As an example, assume this transmitted bit sequence:
0110001011
and the following received bit sequence:
0010101001
The number of bit errors (the underlined bits) is in this case 3. The BER is 3 incorrect bits
divided by 10 transferred bits, resulting in a BER of 0.3 or 30%.
Procedure:
1. Switch on the personal computer
2. Open mat lab software
3. Open new editor m file
4. Write the program
5. Save it in the particular folder
6. Debug the program for verification
Source Code:
clc; % Clears the command window
clear all; % Clears the work space
close all; % Clears the figure window
n=32; % Length of code word
k=15; % Length of messages
dmin=6; % Minimum distance
ebno=1:20;
ber_block=bercoding(ebno,'block','hard',n,k,dmin);
berfit(ebno,ber_block); % Plots BER points & fitted curve
xlabel('ebno(db)'); % Reprsenting x axis
ylabel('bit error probability'); % Representing y axis
title('ber upper bound vs ebno, with best curve fit'); % Representing title

Result: Bit Error Rate is measured using binary data.

Determination of output of Convolutional Encoder


EXP NO:2 for a given sequence DATE:

Aim: To Determine the output of convolutional encoder for a given sequence

Apparatus:
Personal Computer
Matlab software

Theory:
Convolutional codes are used extensively in numerous applications in order to
achieve reliable data transfer, including digital video, radio, mobile communication, and
satellite communication. To convolutionally encode data, start with k memory registers, each
holding input bit. Unless otherwise specified, all memory registers start with a value of 0. The
encoder has n modulo-2 adders, and n generator polynomials — one for each adder. An input
bit m1 is fed into the leftmost register. Using the generator polynomials and the existing
values in the remaining registers, the encoder outputs n bits. Now bit shift all register values
to the right and wait for the next input bit. If there are no remaining input bits, the encoder
continues output until all registers have returned to the zero state.

Procedure:
1. Switch on the personal computer
2. Open matlab software
3. Open new editor m file
4. Write the program
5. Save it in the particular folder

Source Code:
clc; % Clears the command window
clear all; % Clears the workspace
close all; % Clears the figure window
g=input('enter the generator polynomial coefficient') ; % Providing Input
[n,k]=size(g) % Calculates n and constrained
lengths
m=k-1 % Number of registers
state=zeros(1,m) % Set registers to zero
input1=input('enter the message bits') % Input the message bits
b=zeros(1,m) % Generate row matrix of length m
inputx=[input1,b] % Zero Padding
[trash,h]=size(inputx)
outputy=[]
for x=1:h
input=inputx(1,x)
for i=1:n
output(i)=g(i,1)*input
for j=2:k
z=g(i,j)*state(j-1)
output(i)=xor(output(i),z)
end
end
state=[input,state(1:m-1)]
outputy=[outputy,output] % New element added to sequence
end
outputy % Final encoder output

Result: Output of convolutional encoder is determined for a given sequence


Determination of output of Convolutional Decoder
EXP NO:3 for a given sequence DATE:

Aim: To determine output of convolutional Decoder for a given sequence

Apparatus:
Personal Computer
Matlab software

Theory:
Several algorithms exist for decoding convolutional codes. For relatively small values
of k, the Viterbi algorithm is universally used as it provides maximum likelihood
performance and is highly parallelizable. Viterbi decoders are thus easy to implement in
VLSI hardware and in software on CPUs with SIMD instruction sets. Longer constraint
length codes are more practically decoded with any of several sequential decoding
algorithms, of which the Fano algorithm is the best known. Unlike Viterbi decoding,
sequential decoding is not maximum likelihood but its complexity increases only slightly
with constraint length, allowing the use of strong, long-constraint-length codes. Such codes
were used in the Pioneer program of the early 1970s to Jupiter and Saturn, but gave way to
shorter, Viterbi-decoded codes, usually concatenated with large Reed-Solomon error
correction codes that steepen the overall bit-error-rate curve and produce extremely low
residual undetected error rates. Both Viterbi and sequential decoding algorithms return hard
decisions: the bits that form the most likely codeword. An approximate confidence measure
can be added to each bit by use of the Soft output Viterbi algorithm.

Procedure:
1. Switch on the personal computer
2. Open matlab software
3. Open new editor m file
4. Write the program
5. Save it in the particular folder
6. Debug the program for verification

Source Code:
clc; % Clears the command window
clear all; % Clears the workspace
close all; % Clears the figure window
tb=2;
% Length of positive integer scalar
t=poly2trellis([3],[7,5]); % Converting the convolution code
polynomials encoded_sequence=[1 1 0 0 1 1]
decoded= vitdec(encoded_sequence,t,tb,'trunc','hard'); % Decoding using Viterbi Algorithm

Result: The output of convolutional decoder is determined for a given sequence.


Direct sequence spread spectrum technique
EXP NO:4 DATE:

Aim: To verify Direct sequence spread spectrum technique

Apparatus:
Personal Computer
Matlab software

Theory:
Direct-sequence spread spectrum has been adopted for many current and future
communication systems, and it is also used widely for military communication networks and
systems. One of the motivations for employing direct-sequence spread spectrum is its ability
to combat fading due to multipath propagation. Different spread-spectrum techniques are
available, but all have one idea in common: the key (also called the code or sequence)
attached to the communication channel. The manner of inserting this code defines precisely
the spread-spectrum technique. The term "spread spectrum" refers to the expansion of signal
bandwidth. The formal definition of spread spectrum is more precise: an RF communications
system in which the baseband signal bandwidth is intentionally spread over a larger
bandwidth by injecting a higher frequency signal (Figure 1). As a direct consequence, energy
used in transmitting the signal is spread over a wider bandwidth, and appears as noise. The
ratio (in dB) between the spread baseband and the original signal is called processing gain.
Typical spread-spectrum processing gains run from 10dB to 60dB.To apply a spread-
spectrum technique, simply inject the corresponding spread-spectrum code somewhere in the
transmitting chain before the antenna (receiver). (That injection is called the spreading
operation.) The effect is to diffuse the information in a larger bandwidth. Conversely, you can
remove the spread-spectrum code (called a despreading operation) at a point in the receive
chain before data retrieval. A despreading operation reconstitutes the information into its
original bandwidth. Obviously, the same code must be known in advance at both ends of the
transmission channel. (In some circumstances, the code should be known only by those two
parties.)

Procedure:
1. Switch on the personal computer
2. Open matlab software
3. Open new editor m file
4. Write the program
5. Save it in the particular folder
6. Debug the program for verification
Source Code:
clc; % Clears the command window
clear all; % Clears the workspace
close all; % Clears the figure window
% Generating the bit pattern with each bit 6 samples long
b=round(rand(1,20)); % Round the nearest uniformly
%distributed pseudo random numbers
pattern=[]; % Construct pattern generator object
for k=1:20
if b(1,k)==0
sig=zeros(1,6) % Create array of all zeros
else
sig=ones(1,6) % Creates array of all ones
end
pattern=[pattern sig];
end
plot(pattern);
axis([-1 130 -0.5 1.5]);
title('\bit\if original bit sequence');
% Generating the pseudorandom bit pattern for spreading
spread_sig=round(rand(1,120)); % Round the nearest uniformly
%distributed pseudorandom numbers
figure,
plot(spread_sig); % Plot spread signal
axis([-1 130 -0.5 1.5]);
title('\bit\if pseudorandom bit sequence');
% Add title to current axis
% XOR ing the pattern with spread signal
hopped_sig=xor(pattern,spread_sig); % Perform the logical exclusive or
%operation
% Modulating the Hopped signal
dsss_sig=[];
t=[0:100];
fc=0.1;
c1=cos(2*pi*fc); % Creates the cosine signal1
c2=cos(2*pi*fc*t+pi); % Creates the cosine signal2
for k=1:120
if hopped_sig(1,k)==0; % If the hopped signal is zero then
%perform the signal1
dsss_sig=[dsss_sig c1]
else
dsss_sig=[dsss_sig c2] % If the hopped signal is zero then
%perform the signal2
end
end
figure,
plot(dsss_sig);
axis([-1 212 -1.5 1.5]);
figure,
plot(abs(fft(dsss_sig))); % Plotting the fft of dsss signal
title('absolute value of dsss'); % Plots absolute value if the discrete
% sequence spread spectrum signal

Result: Direct Sequence Spread Spectrum Technique is Verified

Design of Frequency Shift Keying System


EXP NO:5 DATE:

AIM:-
To plot the wave form for Binary Frequency Shift Keying (BFSK) signal using MATLAB for
a stream of bits.
Apparatus:
Personal Computer
Matlab software

Theory:-
In frequency-shift keying, the signals transmitted for marks (binary ones) and spaces (binary
zeros) are respectively.

This is called a discontinuous phase FSK system, because the phase of the signal is
discontinuous at the switching times. A signal of this form can be generated by the following
system.

If the bit intervals and the phases of the signals can be determined (usually by the use of a
phase-lock loop), then the signal can be decoded by two separate matched filters:

The first filter is matched to the signal S1(t)and the second to S2(t) Under the assumption that
the signals are mutually orthogonal, the output of one of the matched filters will be E and the
other zero (where E is the energy of the signal). Decoding of the bandpass signal can
therefore be achieved by subtracting the outputs of the two filters, and comparing the result to
a threshold. If the signal S1(t) is present then the resulting output will be +E, and if S2(t) is
present it will be –E. Since the noise variance at each filter output is En/2, the noise in the
difference signal will be doubled, namely _2 =En. Since the overall output variation is 2E,
the probability of error is:
MATLAB PROGRAM:-
clear;
clc;
b = input('Enter the Bit stream \n '); %b = [0 1 0 1 1 1 0];
n = length(b);
t = 0:.01:n;
x = 1:1:(n+1)*100;
for i = 1:n
if (b(i) == 0)
b_p(i) = -1;
else
b_p(i) = 1;
end
for j = i:.1:i+1
bw(x(i*100:(i+1)*100)) = b_p(i);
end
end
bw = bw(100:end);
wo = 2*(2*pi*t);
W = 1*(2*pi*t);
sinHt = sin(wo+W);
sinLt = sin(wo-W);
st = sin(wo+(bw).*W);
subplot(4,1,1)
plot(t,bw)
grid on ; axis([0 n -2 +2])
subplot(4,1,2)
plot(t,sinHt)
grid on ; axis([0 n -2 +2])
subplot(4,1,3)
plot(t,sinLt)
grid on ; axis([0 n -2 +2])
subplot(4,1,4)
plot(t,st)
grid on ; axis([0 n -2 +2])
Fs=1;
figure %pburg(st,10)
periodogram(st)
OBSERVATION:-
Output waveform for the bit stream [0 1 0 0 1 1 1 0]
Output waveform for the bit stream [1 0 1 1 0 0 0 1]
Implementation of QPSK Modulation with Rayleigh
EXP NO:6 Fading and AWGN channel DATE:

AIM:-
To plot the wave forms for QPSK signal subjected to rayleigh AWGN using MATLAB.
Apparatus:
Personal Computer
Matlab software

THEORY:-
Quadrature Phase Shift Keying (QPSK) is the digital modulation technique.Quadrature Phase
Shift Keying (QPSK) is a form of Phase Shift Keying in which two bits are modulated at
once, selecting one of four possible carrier phase shifts (0, Π/2, Π, and 3Π/2). QPSK perform
by changing the phase of the In-phase (I) carrier from 0° to 180° and the Quadrature-phase
(Q) carrier between 90° and 270°. This is used to indicate the four states of a 2-bit binary
code. Each state of these carriers is referred to as a Symbol.

Rayleigh fading is a statistical model for the effect of a propagation environment on a radio
signal, such as that used by wireless devices.Rayleigh fading models assume that the
magnitude of a signal that has passed through such a transmission medium (also called a
communications channel) will vary randomly, or fade,according to a Rayleigh distribution —
the radial component of the sum of two uncorrelated Gaussian random variables.
Additive white Gaussian noise (AWGN) is a channel model in which the only impairment
to communication is a linear addition of wideband or white noise with a constant spectral
density (expressed as watts per hertz of bandwidth) and a Gaussian distribution of amplitude.

MATLAB PROGRAM:-
clear all;
close all;
format long;
bit_count = 10000;
Eb_No = -3: 1: 30;
SNR = Eb_No + 10*log10(2);
for aa = 1: 1: length(SNR)
T_Errors = 0;
T_bits = 0;
while T_Errors < 100
uncoded_bits = round(rand(1,bit_count));
B1 = uncoded_bits(1:2:end);
B2 = uncoded_bits(2:2:end);
qpsk_sig = ((B1==0).*(B2==0)*(exp(i*pi/4))+(B1==0).*(B2==1)...
*(exp(3*i*pi/4))+(B1==1).*(B2==1)*(exp(5*i*pi/4))...
+(B1==1).*(B2==0)*(exp(7*i*pi/4)));
ray = sqrt(0.5*((randn(1,length(qpsk_sig))).^2+(randn(1,length(qpsk_sig))).^2));
rx = qpsk_sig.*ray;
N0 = 1/10^(SNR(aa)/10);
rx = rx + sqrt(N0/2)*(randn(1,length(qpsk_sig))+i*randn(1,length(qpsk_sig)));
rx = rx./ray;
B4 = (real(rx)<0);
B3 = (imag(rx)<0);
uncoded_bits_rx = zeros(1,2*length(rx));
uncoded_bits_rx(1:2:end) = B3;
uncoded_bits_rx(2:2:end) = B4;
diff = uncoded_bits - uncoded_bits_rx;
T_Errors = T_Errors + sum(abs(diff));
T_bits = T_bits + length(uncoded_bits);
end
figure; clf;
plot(real(rx),imag(rx),'o'); % Scatter Plot
title(['constellation of received symbols for SNR = ', num2str(SNR(aa))]);
xlabel('Inphase Component'); ylabel('Quadrature Component');
BER(aa) = T_Errors / T_bits; 22
disp(sprintf('bit error probability = %f',BER(aa)));
end
figure(1);
semilogy(SNR,BER,'or');
hold on;
xlabel('SNR (dB)');
ylabel('BER');
title('SNR Vs BER plot for QPSK Modualtion in Rayleigh Channel');
figure(1);
EbN0Lin = 10.^(Eb_No/10);
theoryBerRay = 0.5.*(1-sqrt(EbN0Lin./(EbN0Lin+1)));
semilogy(SNR,theoryBerRay);
grid on;
figure(1);
theoryBerAWGN = 0.5*erfc(sqrt(10.^(Eb_No/10)));
semilogy(SNR,theoryBerAWGN,'g-+');
grid on;
legend('Simulated', 'Theoretical Raylegh', 'Theroretical AWGN');
axis([SNR(1,1) SNR(end-3) 0.00001 1]); 23

OBSERVATION:-
Output data:-
bit error probability = 0.211700
bit error probability = 0.197600
bit error probability = 0.169700
bit error probability = 0.151700
bit error probability = 0.119500
bit error probability = 0.107600
bit error probability = 0.091600
bit error probability = 0.077700
bit error probability = 0.063000
bit error probability = 0.055400
bit error probability = 0.044400
bit error probability = 0.036600
bit error probability = 0.030600
bit error probability = 0.023700
bit error probability = 0.020300
bit error probability = 0.017300
bit error probability = 0.011000
bit error probability = 0.009650
bit error probability = 0.007350
bit error probability = 0.006700
bit error probability = 0.005167
bit error probability = 0.004233
bit error probability = 0.003767
bit error probability = 0.002400
bit error probability = 0.001983
bit error probability = 0.001529
bit error probability = 0.001122
bit error probability = 0.001055
bit error probability = 0.000777
bit error probability = 0.000644
bit error probability = 0.000452
bit error probability = 0.000446
bit error probability = 0.000306
bit error probability = 0.000289

OBSERVATION:-
8-QAM Modulation and Demodulation Techniques
EXP NO:7 DATE:

AIM:-
To plot the wave form for 8 quadrature amplitude modulated signal (QAM) using MATLAB
for a stream of bits.

THEORY:-
Quadrature amplitude modulation (QAM) is both an analog and a digital modulation scheme.
It conveys two analog message signals, or two digital bit streams, by changing (modulating)
the amplitudes of two carrier waves, using the amplitude-shift keying (ASK) digital
modulation scheme or amplitude modulation (AM) analog modulation scheme. The two
carrier waves, usually sinusoids, are out of phase with each other by 90° and are thus called
quadrature carriers or quadrature components — hence the name of the scheme. The
modulated waves are summed, and the resulting waveform is a combination of both phase-
shift keying (PSK) and amplitude-shift keying (ASK), or (in the analog case) of phase
modulation (PM) and amplitude modulation. In the digital QAM case, a finite number of at
least two phases and at least two amplitudes are used. PSK modulators are often designed
using the QAM principle, but are not considered as QAM since the amplitude of the
modulated carrier signal is constant. QAM is used extensively as a modulation scheme for
digital telecommunication systems. Spectral efficiencies of 6 bits/s/Hz can be achieved with
QAM.
The 4-QAM and 8-QAM constellations
Time domain for an 8-QAM signal
MATLAB PROGRAM:-
clc
close all
m=8
k=log2(m);
n=9e3;
nsamp=1;
x=randint(n,1);
stem(x(1:20),'filled');
title('bit sequence');
xlabel('bit index');
ylabel('bit amplitude');
xsym=bi2de(reshape(x,k,length(x)/k).','left-msb');
figure;
stem(xsym(1:10));
title('symbol plot');
xlabel('symbol index');
ylabel('symbol amplitude');
y=modulate(modem.qammod(m),xsym);
ytx=y;
ebno=10
snr=ebno+10*log(k)-10*log10(nsamp);
yn=awgn(ytx,snr);
27
yrx=yn;
scatterplot(y);
scatterplot(yrx,30);
OBSERVATION:-

You might also like