0% found this document useful (0 votes)
84 views31 pages

Cycle 2 Adc 18tel67

The document discusses pulse code modulation (PCM) and delta modulation. It describes: 1) PCM involves sampling an analog signal, quantizing the samples, encoding the quantized values into binary digits, transmitting the encoded signal, and reconstructing the analog signal at the receiver. 2) Delta modulation is a simpler form of PCM that encodes difference between successive samples into a 1-bit data stream, indicating increases or decreases in the signal. 3) Both modulation techniques are simulated using MATLAB to demonstrate encoding, decoding, and reconstruction of analog signals.

Uploaded by

Litlatoh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views31 pages

Cycle 2 Adc 18tel67

The document discusses pulse code modulation (PCM) and delta modulation. It describes: 1) PCM involves sampling an analog signal, quantizing the samples, encoding the quantized values into binary digits, transmitting the encoded signal, and reconstructing the analog signal at the receiver. 2) Delta modulation is a simpler form of PCM that encodes difference between successive samples into a 1-bit data stream, indicating increases or decreases in the signal. 3) Both modulation techniques are simulated using MATLAB to demonstrate encoding, decoding, and reconstruction of analog signals.

Uploaded by

Litlatoh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

PART B
EXPERIMENT: 01
PULSE CODE MODULATION AND DEMODULATION

AIM: To simulate the pulse code modulation and demodulation.


COMPONENTS REQUIRED: MATLAB Tool.

THEORY:
Modulation is the process of varying one or more parameters of a carrier signal in
accordance with the instantaneous values of the message signal. The message signal is
the signal which is being transmitted for communication and the carrier signal is a high
frequency signal which has no data, but is used for long distance transmission. There are
many modulation techniques, which are classified according to the type of modulation
employed. The digital modulation technique used is Pulse Code Modulation (PCM).
A signal is Pulse code modulated to convert its Analog information into a binary
sequence, i.e., 1s and 0s. The output of a PCM will resemble a binary sequence. The
following figure shows an example of PCM output with respect to instantaneous values
of a given sine wave.

Instead of a pulse train, PCM produces a series of numbers or digits, and hence this
process is called as digital. Each one of these digits, though in binary code, represents
the approximate amplitude of the signal sample at that instant.
Department of Electronics and Telecommunication Engineering, B.I.T 1
ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

In Pulse Code Modulation, the message signal is represented by a sequence of coded


pulses. This message signal is achieved by representing the signal in discrete form in
both time and amplitude.
Basic Elements of PCM
The transmitter section of a Pulse Code Modulator circuit consists of Sampling,
Quantizing and Encoding, which are performed in the Analog-to-digital converter
section. The low pass filter prior to sampling prevents aliasing of the message signal.
The basic operations in the receiver section are regeneration of impaired signals,
decoding, and reconstruction of the quantized pulse train. Following is the block
diagram of PCM which represents the basic elements of both the transmitter and the
receiver sections.

Low Pass Filter: This filter eliminates the high frequency components present in the
input analog signal which is greater than the highest frequency of the message signal, to
avoid aliasing of the message signal.

Department of Electronics and Telecommunication Engineering, B.I.T 2


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

Sampler: This is the technique which helps to collect the sample data at instantaneous
values of message signal, so as to reconstruct the original signal. The sampling rate must
be greater than twice the highest frequency component W of the message signal, in
accordance with the sampling theorem. Sampling is defined as, “The process of
measuring the instantaneous values of continuous-time signal in a discrete form.
“Sample” is a piece of data taken from the whole data which is continuous in the time
domain. To discretize the signals, the gap between the samples should be fixed. That gap
can be termed as a sampling period Ts.

Quantizer: Quantizing is a process of reducing the excessive bits and confining the data.
The sampled output when given to Quantizer, reduces the redundant bits and compresses
the value. The digitization of analog signals involves the rounding off of the values
which are approximately equal to the analog values. The method of sampling chooses a
few points on the analog signal and then these points are joined to round off the value to
a near stabilized value. Such a process is called as Quantization. The type of
quantization in which the quantization levels are uniformly spaced is termed as a
Uniform Quantization. The type of quantization in which the quantization levels are
unequal and mostly the relation between them is logarithmic, is termed as a Non-
uniform Quantization.

Encoder: The digitization of analog signal is done by the encoder. It designates each
quantized level by a binary code. The sampling done here is the sample-and-hold
process. These three sections (LPF, Sampler, and Quantizer) will act as an analog to
digital converter. Encoding minimizes the bandwidth used.

Department of Electronics and Telecommunication Engineering, B.I.T 3


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

Regenerative Repeater: This section increases the signal strength. The output of the
channel also has one regenerative repeater circuit, to compensate the signal loss and
reconstruct the signal, and also to increase its strength.

Decoder: The decoder circuit decodes the pulse coded waveform to reproduce the
original signal. This circuit acts as the demodulator.

Reconstruction Filter: After the digital-to-analog conversion is done by the regenerative


circuit and the decoder, a low-pass filter is employed, called as the reconstruction filter to
get back the original signal.

Algorithm:

1. Input the number of bits and the number of samples.

2. Perform the sampling of the input signal.

3. Perform quantization of the sampled signal.

4. Convert the decimal value to binary and convert the coded matrix into a coded row
vector

5. Perform demodulation of the PCM signal.

CODE:
clc;
close all;
clear all;
n=input('Enter n value for n-bit PCM system : ');
n1=input('Enter number of samples in a period : ');
L=2^n;
% Sampling Operation
x=0:2*pi/n1:4*pi; % n1 number of samples have to be selected
s=8*sin(x);
subplot(3,1,1);

Department of Electronics and Telecommunication Engineering, B.I.T 4


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

plot(s);
title('Analog Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
subplot(3,1,2);
stem(s);grid on; title('Sampled Signal');
ylabel('Amplitude--->');
xlabel('Time--->');

% Quantization Process
vmax=8;
vmin=-vmax;
del=(vmax-vmin)/L;
part=vmin:del:vmax; % level are between vmin and vmax with difference of del
code=vmin-(del/2):del:vmax+(del/2); % Contain Quantized values
[ind,q]=quantiz(s,part,code); % ind contain index number and q contain quantized
values

l1=length(ind);
l2=length(q);

for i=1:l1
if(ind(i)~=0) % To make index as binary decimal so started from 0 to N
ind(i)=ind(i)-1;
end
i=i+1;
end
fori=1:l2
if(q(i)==vmin-(del/2)) % To make quantize value in between the levels
q(i)=vmin+(del/2);
end
end
subplot(3,1,3);
stem(q);
grid on; % Display the Quantize values
title('Quantized Signal');
ylabel('Amplitude--->');
xlabel('Time--->');

Department of Electronics and Telecommunication Engineering, B.I.T 5


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

% Encoding Process
figure
code=de2bi(ind,'left-msb'); % Convert the decimal to binary
k=1;
fori=1:l1
for j=1:n
coded(k)=code(i,j); % convert code matrix to a coded row vector
j=j+1;
k=k+1;
end
i=i+1;
end
subplot(2,1,1); grid on;
stairs(coded); % Display the encoded signal
axis([0 100 -2 3]);
title('Encoded Signal');
ylabel('Amplitude--->');
xlabel('Time--->');

% Demodulation of PCM signal

qunt=reshape(coded,n,length(coded)/n);
index=bi2de(qunt','left-msb'); % Get back the index in decimal form
q=del*index+vmin+(del/2); % get back Quantized values
subplot(2,1,2);
grid on;
plot(q); % Plot Demodulated signal
title('Demodulated Signal');
ylabel('Amplitude--->');
xlabel('Time--->');

Department of Electronics and Telecommunication Engineering, B.I.T 6


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

OUTPUT WAVEFORMS:

RESULT: Pulse Code modulation is simulated and graphs are plotted.

Department of Electronics and Telecommunication Engineering, B.I.T 7


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

EXPERIMENT: 02
DELTA MODULATION AND ADAPTIVE DELTA MODULATION
AIM: To Simulate Delta modulation and Adaptive Delta modulation.

COMPONENTS REQUIRED: Matlab tool

THEORY:
Delta modulation (DM or Δ-modulation) is an analog-to-digital and digital-to-analog
signal conversion technique used for transmission of voice information where quality is
not of primary importance. DM is the simplest form of differential pulse-code
modulation (DPCM) where the difference between successive samples are encoded into
n-bit data streams. In delta modulation, the transmitted data are reduced to a 1-bit data
stream. Its main features are:

 The analog signal is approximated with a series of segments.


 Each segment of the approximated signal is compared of successive bits is
determined by this comparison.
 Only the change of information is sent, that is, only an increase or decrease of the
signal amplitude from the previous sample is sent whereas a no-change condition
causes the modulated signal to remain at the same 0 or 1 state of the previous
sample.

Fig 10.1: Block diagram of Delta Modulation

Department of Electronics and Telecommunication Engineering, B.I.T 8


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

However, there exists some noise in DM.


 Slope Over load distortion (when Δ is small)
 Granular noise (when Δ is large)
Slope Over Load Distortion: If the input signal amplitude changes fast, the step-by-
step accumulation process may not catch up with the rate of change. This happens
initially when the demodulator starts operation from cold-start but is usually of
negligible effect for speech. However, if this phenomenon occurs frequently (which
indirectly implies smaller value of auto-correlation co-efficient Rxx(τ) over a short time
interval) the quality of the received signal suffers. The received signal is said to suffer
from slope-overload distortion. An intuitive remedy for this problem is to increase the
step-size δ.

Granular Noise: If the step-size is made arbitrarily large to avoid slope-overload


distortion, it may lead to ‘granular noise’. Imagine that the input speech signal is
fluctuating but very close to zero over limited time duration. This may happen due to
pauses between sentences or else. During such moments, our delta modulator is likely to
produce a fairly long sequence of 101010…., reflecting that the accumulator output is
close but alternating around the input signal. This phenomenon is manifested at the
output of the delta demodulator as a small but perceptible noisy background. This is
known as ‘granular noise’. An expert listener can recognize the crackling sound. This
noise should be kept well within a tolerable limit while deciding the step-size. Larger
step-size increases the granular noise while smaller step size increases the degree of
slope-overload distortion. In the first level of design, more care is given to avoid the
slope-overload distortion. We will briefly discuss about this approach while keeping the
step-size fixed. A more efficient approach of adapting the step-size, leading to Adaptive
Delta Modulation (ADM).

Department of Electronics and Telecommunication Engineering, B.I.T 9


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

ADAPTIVE DELTA MODULATION (ADM)

 In digital modulation, we have come across certain problem of determining the


step-size, which influences the quality of the output wave.
 A larger step-size is needed in the steep slope of modulating signal and a smaller
stepsize is needed where the message has a small slope. The minute details get
missed in the process. So, it would be better if we can control the adjustment of
step-size, according to our requirement in order to obtain the sampling in a desired
fashion. This is the concept of Adaptive Delta Modulation.

Fig 10.1: Block diagram of Adaptive Delta Modulation

 ADM quantizes the difference between the value of the current sample and the
predicted value of the next sample. It uses a variable step height to predict the next
values, for the faithful reproduction of the fast varying values.

Algorithm:

1. Define the value of delta and amplitude of the signal.

2. Define the function Delta Modulation.

3. Generate the signal and plot.

4. Call the function in the main program and execute to obtain Delta modulated
signal.

Department of Electronics and Telecommunication Engineering, B.I.T 10


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

Code for DM:


function [y MSE]= Delta_Modulation(del,A)
t=0:2*pi/100:2*pi;
x=A*sin(t);
plot(x);
hold on
y=[0];
xr=0;
fori=1:length(x)-1
ifxr(i)<=x(i)
d=1
xr(i+1)=xr(i)+del;
else
d=0
xr(i+1)=xr(i)-del;
end
y=[y d];
end
stairs(xr);
hold off;
MSE=sum((x-xr).^2)/length(x);
end
Main program:
del=input('Enter the delta value:');
A=8;
[y MSE]=Delta_Modulation(del,A)

Department of Electronics and Telecommunication Engineering, B.I.T 11


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

Code for ADM:

%Function for ADMout


function [ADMout]= adeltamod(sig_in,Delta,td,ts)
if(round(ts/td)>=2)
Nfac=round(ts/td);%Nearest integer
xsig=downsample(sig_in,Nfac);
Lxsig=length(xsig);
Lsig_in=length(sig_in);
ADMout=zeros(Lsig_in);%Initialising output
cnt1=0; %Counters for no. of previous consecutively increasing
cnt2=0; %steps
sum=0;
fori=1:Lxsig
if(xsig(i)==sum)
elseif(xsig(i)>sum)
if(cnt1<2)
sum=sum+Delta; %Step up by Delta,
elseif(cnt1==2)
sum=sum+2*Delta; %Double the step size after
%first two increase
elseif(cnt1==3)
sum=sum+4*Delta; %Double step size
else
sum=sum+8*Delta; %Still double and then stop
%doubling there on
end
if(sum<xsig(i))
cnt1=cnt1+1;
else
cnt1=0;
end
else
if(cnt2<2)
sum=sum-Delta;
elseif(cnt2==2)
sum=sum-2*Delta;
elseif(cnt2==3)
sum=sum-4*Delta;
else
sum=sum-8*Delta;
Department of Electronics and Telecommunication Engineering, B.I.T 12
ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

end
if(sum>xsig(i))
cnt2=cnt2+1;
else
cnt2=0;
end
end
ADMout(((i-1)*Nfac+1):(i*Nfac))=sum;
end
end
end

Main program:
clear;
td=0.002;
t=[0:td:1];
sig_in=sin(4*pi*t);
Lsig=length(sig_in);
ts=0.02;
Delta=0.5;
[ADMout]=adeltamod(sig_in,Delta,td,ts);
plot(t,sig_in,'k',t,ADMout(1:Lsig),'b');

Department of Electronics and Telecommunication Engineering, B.I.T 13


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

OUTPUT WAVEFORMS:

Graph of DM (∆=0.2)

Graph of ADM
RESULT:

Delta modulation and Adaptive Delta modulation is simulated and graphs are
Plotted.

Department of Electronics and Telecommunication Engineering, B.I.T 14


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

EXPERIMENT: 03
EYE DIAGRAM
AIM: To Simulate the transmission of baseband signals with Raised cosine Transmitter
Filter and Plot Eye Diagram.
COMPONENTS: MATLab tool

THEORY:
The information symbol with a symbol period can be transmitted without
Inter symbol interference (ISI) by using Nyquist pulse,

The resultant waveform is ideally bandlimited to frequencies from Hz to Hz.


However, in typical transmission schemes, we do not hear of pulse shaping using sinc()
filters. Rather, pulse shaping using raised cosine filter is frequently used. Now objective
is to understand the motivation behind using raised cosine filtering for pulse
shaping.

Though the sinc filter achieves bandlimited transmission within Hz without inter
symbol interference, the sinc filter has the following issues:

1. The tail of the sinc filter decays slowly. Note that practical implementations cannot
use a filter which extends from to . To ensure that only filter taps having small
values are only ignored, need to use a filter of large length.
2. Small errors in timing synchronization at the receiver will result in significant
intersymbol interference. Reason: The error in timing synchronization means that the
sampling tme at the receiver is not aligned. This implies that filter tap values at
time etc are non-zero. Hence results in significant inter
symbol interference.

Department of Electronics and Telecommunication Engineering, B.I.T 15


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

Given so, there was a motivation to find filters which satisfies the Nyquist criterion, but
has a faster decay of the filter tail. A commonly used pulse shaping filter satisfying the
Nyquist criterion while having a faster decay is called the Raised cosine filters having
the following equation,

Where
is the excess bandwidth parameter and takes values from 0 to 1.
With =0, the raised cosine filter reduces to the classical Nyquist filter with zero excess

bandwidth outside .
With =1 it is called 100% excess bandwidth and does not occupy frequencies
outside .

The frequency response of the raised cosine filter is,

Eye diagram
An eye diagram is generated in an oscilloscope operating in the persistence mode by
observing the output of the filter with the symbol timing serving as the trigger. The
observation window can be set as 2 times the symbol period. An eye pattern, also known
as an eye diagram, is an oscilloscope display in which a digital signal from a receiver is
repetitively sampled and applied to the vertical input, while the data rate is used to trigger
the horizontal sweep. It is so called because, for several types of coding, the pattern looks
like a series of eyes between a pair of rails. It is a tool for the evaluation of the combined
effects of channel noise and Intersymbol interference on the performance of a baseband
pulse-transmission system. It is the synchronised superposition of all possible realisations
of the signal of interest viewed within a particular signaling interval.
Several system performance measures can be derived by analyzing the display. If the

Department of Electronics and Telecommunication Engineering, B.I.T 16


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

signals are too long, too short, poorly synchronized with the system clock, too high, too
low, too noisy, or too slow to change, or have too much undershoot or overshoot, this can
be observed from the eye diagram. An open eye pattern corresponds to minimal
signal distortion. Distortion of the signal waveform due to Intersymbol
interference and noise appears as closure of the eye pattern. When the input data is
random, the eye diagram which consists of many overlapped traces of the signal captures
visually all the paths which the waveform takes.
There are many measurements that can be obtained from an eye diagram

Amplitude measurements

 Eye amplitude
 Eye crossing amplitude
 Eye crossing percentage
 Eye height
 Eye level
 Eye signal-to-noise ratio
 Quality factor
 Vertical eye opening
Time measurements

 Deterministic jitter
 Eye crossing time
 Eye delay
 Eye fall time
 Eye rise time
 Eye width
 Horizontal eye opening
 Peak-to-peak jitter
 Random jitter
 RMS jitter
 CRC jitter
 Total jitter

Department of Electronics and Telecommunication Engineering, B.I.T 17


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

Interpreting Measurements

Eye-diagram feature Measures

Eye opening (height, peak to peak) Additive noise in the signal

Peak distortion due to interruptions in the


Eye overshoot/undershoot
signal path

Eye width Timing synchronization & jitter effects

Eye closure Intersymbol interference, additive noise

Algorithm:
1. Defines random BPSK modulated symbols (+1′s and -1′s).
2. Defines two raised cosine filters with = 0.5, = 1.
3. Upsamples the transmit sequence by zero insertion.
4. Convolves the upsampled transmit sequence with the filter.
5. Overlays the time domain samples to plot the eye diagram.
CODE:
clear
N = 10^3; % number of symbols
am = 2*(rand(1,N)>0.5)-1 + j*(2*(rand(1,N)>0.5)-1); % generating random binary
sequence
fs = 10; % sampling frequency in Hz
% defining the sincfilter
sincNum = sin(pi*[-fs:1/fs:fs]); % numerator of the sinc function
sincDen = (pi*[-fs:1/fs:fs]); % denominator of the sinc function
sincDenZero = find(abs(sincDen) < 10^-10);
sincOp = sincNum./sincDen;
sincOp(sincDenZero) = 1; % sin(pix/(pix) =1 for x =0
% raised cosine filter
alpha = 0.5;
cosNum = cos(alpha*pi*[-fs:1/fs:fs]);
Department of Electronics and Telecommunication Engineering, B.I.T 18
ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

cosDen = (1-(2*alpha*[-fs:1/fs:fs]).^2);
cosDenZero = find(abs(cosDen)<10^-10);
cosOp = cosNum./cosDen;
cosOp(cosDenZero) = pi/4;
gt_alpha5 = sincOp.*cosOp;

alpha = 1;
cosNum = cos(alpha*pi*[-fs:1/fs:fs]);
cosDen = (1-(2*alpha*[-fs:1/fs:fs]).^2);
cosDenZero = find(abs(cosDen)<10^-10);
cosOp = cosNum./cosDen;
cosOp(cosDenZero) = pi/4;
gt_alpha1 = sincOp.*cosOp;
% upsampling the transmit sequence
amUpSampled = [am;zeros(fs-1,length(am))];
amU = amUpSampled(:).';
% filtered sequence
st_alpha5 = conv(amU,gt_alpha5);
st_alpha1 = conv(amU,gt_alpha1);
% taking only the first 10000 samples
st_alpha5 = st_alpha5([1:10000]);
st_alpha1 = st_alpha1([1:10000]);
st_alpha5_reshape = reshape(st_alpha5,fs*2,N*fs/20).';
st_alpha1_reshape = reshape(st_alpha1,fs*2,N*fs/20).';
close all
figure;
plot([0:1/fs:1.99],real(st_alpha5_reshape).','b');
title('eye diagram with alpha=0.5');
xlabel('time')
ylabel('amplitude')
axis([0 2 -1.5 1.5])
grid on

figure;
plot([0:1/fs:1.99],real(st_alpha1_reshape).','b');
title('eye diagram with alpha=1')
xlabel('time')
ylabel('amplitude')
axis([0 2 -1.5 1.5 ])
grid on

Department of Electronics and Telecommunication Engineering, B.I.T 19


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

OBSERVATIONS:
1. For increasing the margin for error free transmission, the vertical opening of the
eye should be more. In the presence of inter-symbol interference, the vertical
opening of the eye reduces, thus increasing the probability of error.
2. The ideal sampling instant is the point where the vertical eye opening is
maximum.
3. Smaller horizontal eye opening means implies more sensitivity to timing errors.
Inference: From the figures, it can be observed that the horizontal eye opening
with =0.5 is smaller than with =1.
The tails of the raised cosine filter with =1 dies away faster than the case where =0.5.
Hence error in timing cause a bigger performance degradation for =0.5 than for =1
scenario. However, the flip side of using =1 is the increased bandwidth required for
transmission.

OUTPUT WAVEFORMS:

RESULT: The baseband signals are transmitted through Raised cosine Transmitter Filter
and Eye Diagram is plotted.

Department of Electronics and Telecommunication Engineering, B.I.T 20


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

EXPERIMENT: 04
BER OF ASK, PSK, FSK

AIM: To compute the Probability of bit error for binary ASK, FSK and PSK for an
AWGN Channel and Compare them with their Performance curves.
COMPONENTS: MATLab tool.
THEORY:

ASK (Amplitude Shift Keying)

The short form of Amplitude Shift Keying is referred as ASK. It is the digital
modulation technique. In this technique, amplitude of the RF carrier is varied in
accordance with baseband digital input signal. The figure 12.1 depicts operation of ASK
modulation. As shown in the figure, binary 1 will be represented by carrier signal with
some amplitude while binary 0 will be represented by carrier of zero amplitude.

Fig 12.1: ASK Modulation


ASK modulation can be represented by following equation:
s(t) = A2* cos (2*π*fc*t) for Binary Logic-1
s(t) = A1* cos(2*π*fc*t) for Binary Logic-0
Here A2>A1
Signaling used is ON-OFF signaling.
Bandwidth requirement for ASK is:
BW = 2/Tb = 2*Rb
Department of Electronics and Telecommunication Engineering, B.I.T 21
ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

Often in ASK modulation, binary-1 is represented by carrier with amplitude-A2 and


binary-0 is represented by carrier with amplitude-A1. Here A2 is greater in magnitude
compare to A1. The form of ASK where in no carrier is transmitted during the
transmission of logic zero is known as OOK modulation (On Off Keying modulation).
This is shown in the figure 12.2. Refer OOK vs ASK modulation >> which compares
OOK vs ASK and depicts difference between OOK and ASK modulation types with
signal diagrams.
• In ASK probability of error (Pe) is high and SNR is less.
• It has lowest noise immunity against noise.
• ASK is a bandwidth efficient system but it has lower power efficiency.

Constellation diagram for ASK

Fig 12.2: Constellation diagram

FSK (Frequency Shift Keying)

The short form of Frequency Shift Keying is referred as FSK. It is also digital
modulation technique. In this technique, frequency of the RF carrier is varied in
accordance with baseband digital input. The figure 12.3 depicts the FSK modulation. As
shown, binary 1 and 0 is represented by two different carrier frequencies. Figure depicts
that binary 1 is represented by high frequency 'f1' and binary 0 is represented by low
frequency 'f2'.

Department of Electronics and Telecommunication Engineering, B.I.T 22


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

Fig 12.3: FSK


Binary FSK can be represented by following equation:
s(t) = A* cos(2*π*f1*t) for Binary 1
s(t) = A* cos(2*π*f2*t) for Binary 0
In FSK modulation, NRZ signalling method is used. Bandwidth requirement in case of
FSK is:
BW = 2*Rb + (f1-f2)

• In case of FSK, Pe is less and SNR is high.


• This technique is widely employed in modem design and development.
• It has increased immunity to noise but requires larger bandwidth compare to other
modulation types.
In order to overcome drawbacks of BFSK (Two level Binary FSK), multiple FSK
modulation techniques with more than two frequencies have been developed. In MFSK
(Multiple FSK), more than one bits are represented by each signal elements. The
Constellation diagram is shown in figure 12.4

Department of Electronics and Telecommunication Engineering, B.I.T 23


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

Constellation diagram for FSK

Fig 12.4: Constellation diagram


PSK (Phase Shift Keying)
The short form of Phase Shift Keying is referred as PSK. It is digital modulation
technique where in phase of the RF carrier is changed based on digital input. Figure
depicts Binary Phase Shift Keying modulation type of PSK. As shown in the figure 12.5,
Binary 1 is represented by 180 degree phase of the carrier and binary 0 is represented by
0 degree phase of the RF carrier.

Fig.12.5: PSK

Department of Electronics and Telecommunication Engineering, B.I.T 24


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

Binary PSK can be represented by following equation:


If s(t) = A*cos(2*π*fc*t) for Binary 1 than
s(t) = A*cos(2*π*fc*t + π) for Binary 0
In PSK modulation, NRZ signalling is used. Bandwidth requirement for PSK is:
BW = 2 * Rb = 2 * Bit rate
• In case of PSK probability of error is less. SNR is high.
• It is a power efficient system but it has lower bandwidth efficiency.
• PSK modulation is widely used in wireless transmission.

Constellation diagram for PSK

Fig 12.6: Constellation diagram

AWGN Channel
A basic and generally accepted model for noise in communication channels, is the set of
assumptions that

 The noise is additive, i.e., the received signal equals the transmit signal plus some
noise, where the noise is statistically independent of the signal.
 The noise is white, i.e., the power spectral density is flat, and so the autocorrelation
of the noise in time domain is zero for any non-zero time offset.
Department of Electronics and Telecommunication Engineering, B.I.T 25
ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

 The noise samples have a Gaussian distribution.

Bit Error Rate (BER)

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 (BER) is the number of bit errors per unit time. The bit error
ratio (also BER) is the number of bit errors divided by the total number of transferred
bits during a studied time interval. Bit error ratio is a unit-less performance measure,
often expressed as a percentage. The bit error probability pe is the expectation value of
the bit error ratio. The bit error ratio 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.

Algorithm

1. Input msglen and generate a random integer.


2. Define the signals for ASK, PSK and FSK.
3. Perform modulation of the signals.
4. Pass the modulated signals through an AWGN channel.
5. Determine the BER for the resulting signals and plot the graph denoting the BERs.
CODE:
% --- ASK_FSK_PSK (20000)
% --- ASK_FSK_PSK (10000)
msglen=10000;
n=msglen;
b=randint(1,n);
f1=1;f2=2;
t=0:1/30:1-1/30;
%ASK
sa1=sin(2*pi*f1*t);
E1=sum(sa1.^2);

Department of Electronics and Telecommunication Engineering, B.I.T 26


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

sa1=sa1/sqrt(E1); %unit energy


sa0=0*sin(2*pi*f1*t);
%FSK
sf0=sin(2*pi*f1*t);
E=sum(sf0.^2);
sf0=sf0/sqrt(E);
sf1=sin(2*pi*f2*t);
E=sum(sf1.^2);
sf1=sf1/sqrt(E);
%PSK
sp0=-sin(2*pi*f1*t)/sqrt(E1);
sp1=sin(2*pi*f1*t)/sqrt(E1);

%MODULATION
ask=[];psk=[];fsk=[];
fori=1:n
if b(i)==1
ask=[ask sa1];
psk=[psk sp1];
fsk=[fsk sf1];
else
ask=[ask sa0];
psk=[psk sp0];
fsk=[fsk sf0];
end
end
figure(1);
subplot(411);
stairs(0:10,[b(1:10) b(10)]);
axis([0 10 -0.5 1.5]);
title('Message Bits');grid on;
subplot(412);
tb=0:1/30:10-1/30;
plot(tb, ask(1:10*30),'b','linewidth',1.5);
title('ASK Modulation');grid on;
subplot(412);
plot(tb, fsk(1:10*30),'r','linewidth',1.5);
title('FSK Modulation');grid on;
subplot(414);
plot(tb, psk(1:10*30),'k','linewidth',1.5);
title('PSK Modulation');grid on;
Department of Electronics and Telecommunication Engineering, B.I.T 27
ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

xlabel('Time');ylabel('Amplitude');
%AWGN
forsnr=0:20
askn=awgn(ask,snr);
pskn=awgn(psk,snr);
fskn=awgn(fsk,snr);

%DETECTION
A=[];F=[];P=[];
fori=1:n
%ASK Detection
if sum(sa1.*askn(1+30*(i-1):30*i))>0.5
A=[A 1];
else
A=[A 0];
end
%FSK Detection
if sum(sf1.*fskn(1+30*(i-1):30*i))>0.5
F=[F 1];
else
F=[F 0];
end
%PSK Detection
if sum(sp1.*pskn(1+30*(i-1):30*i))>0
P=[P 1];
else
P=[P 0];
end
end

%BER
errA=0;errF=0; errP=0;
fori=1:n
if A(i)==b(i)
errA=errA;
else
errA=errA+1;
end
if F(i)==b(i)
errF=errF;
else
Department of Electronics and Telecommunication Engineering, B.I.T 28
ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

errF=errF+1;
end
if P(i)==b(i)
errP=errP;
else
errP=errP+1;
end
end
BER_A(snr+1)=errA/n;
BER_F(snr+1)=errF/n;
BER_P(snr+1)=errP/n;
end

figure(2);
subplot(411);
stairs(0:10,[b(1:10) b(10)]);
axis([0 10 -0.5 1.5]);grid on;
title('Received signal after AWGN Channel');
subplot(412);
tb=0:1/30:10-1/30;
plot(tb, askn(1:10*30),'b','linewidth',1.5);
title('Received ASK signal');grid on;
subplot(413);
plot(tb, fskn(1:10*30),'r','linewidth',1.5);
title('Received FSK signal');grid on;
subplot(414);
plot(tb, pskn(1:10*30),'k','linewidth',1.5);
title('Received PSK signal');grid on;
figure(3);
semilogy(0:20,BER_A, 'b','linewidth',2);
title('BER Vs SNR');
grid on;
hold on
semilogy(0:20,BER_F,'r','linewidth',2);
semilogy(0:20,BER_P, 'k','linewidth',2);
xlabel('Eo/No(dB)');
ylabel('BER');
hold off;
legend('ASK','FSK','PSK');

Department of Electronics and Telecommunication Engineering, B.I.T 29


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

OUTPUT WAVEFORMS:

Department of Electronics and Telecommunication Engineering, B.I.T 30


ANALOG & DIGITAL COMMUNICATION LAB [18TEL67] 2020-21

RESULT:

ASK, PSK and FSK signals are generated, transmitted through the AWGN channel
and BER vs SNR graphs for these signals are plotted and compared.

Department of Electronics and Telecommunication Engineering, B.I.T 31

You might also like