You are on page 1of 11

Department of Electrical Engineering

ANALOGUE AND DIGITAL COMMUNICATION

COMPLEX ENGINEERING PROBLEM


Name: ZUBAIR KHALID 160286
MUHAMMAD ALI 160892

MURAD ALI 160885

MUHAMMAD SUBHAN 160891

Class: BEE-8B (POWER)

Submitted To: SIR M.TILAL

Date: JUNE 16th, 2020


Problem Statement
A short-range wireless calculator service should be developed. The product is a group of
MATLAB functions that implement this wireless service. The final product shall be supplied
as a group of m-files that can be run as Transmitter/Receiver on a standard computer. The
hardware platform consists of two standard computers and two headsets. The headsets are
placed next to each other and connected to one PC each. The wireless service should use
the acoustic channel between the headsets as the only communication link between the
computers.
Contents
INTRODUCTION.....................................................................................................................................3
PCM...................................................................................................................................................3
Pulse shaping Methods......................................................................................................................3
METHADOLOGY.....................................................................................................................................4
BLOCK DIAGRAM...............................................................................................................................4
PC1 TRANCEIVER (TRANSMISSION)...................................................................................................4
DATA INPUT...................................................................................................................................4
BINARY TO ASCII CONVERTION......................................................................................................4
VOLTAGE ASSIGNMENT.................................................................................................................5
ASK MODULATION.........................................................................................................................5
TRANSMISSION OF MODULATED WAVE........................................................................................6
PC2 TRANSCEIVER (RECEPTION)........................................................................................................6
DATA RECEPTION...........................................................................................................................6
DEMODULATION...........................................................................................................................7
BINARY TO ASCII CONVERSION......................................................................................................8
INTRODUCTION
Nowadays wireless communication is trending all across the globe, due to its wireless
medium it attracts the user .But the main problem is its reception of the original signal
because noise also known as AWGN gives signal a raw shape which is then processed and
rectified to its original form after its transmission across long distances. In this Complex
engineering problem we have task to give a basic idea to design a wireless calculator. So
this CEP is based upon topic of PCM waveforms, pulse shaping and digital communication
system.

TASK
 Two integer numbers separated by one of the 4 basic arithmetic operations
(addition,
Subtraction, multiplication and division) will be typed on one keyboard
 The message should be wirelessly transmitted to the second computer, which should
transmit automatically the result back to the first computer. If errors are detected at
any point of the transmission, some re-transmission system must be implemented.
 The result should be displayed on the screen of the first computer in less than10
seconds after pressing “Enter”.
 The distance between headsets shall be 5 cm.
 All stages of volume control, e.g. volume control on headset and all internal PC
software control shall be on max level.
 The minimum and the maximum values for the numbers involved in the operation
are 0 and
1000.
 If the second computer is not able to answer the question (due to
noise/interference),a retransmission should be requested. The same operation will
be re-typed and re-transmitted.

PCM
There are three types of modulation ASK, PSK and FSK.We have chosen ASK modulation
because of its simple circuitry and the medium which is given to us is only 5cm .In ASK the
frequency and phase
are constant and the amplitude is varied by on off keying.

Pulse shaping Methods


ASK modulation has disadvantages like Excessive noise so the pulse is distorted so
techniques we used to shape our pulse train are filtering by Low pass Filter and Envelop
detector. So these process restore our original signal from neglecting the factor of noise.
METHADOLOGY

BLOCK DIAGRAM
PC 1 TRANSCEIVER

TRANSMISSION
VOLTAGE ASK
DATA INPUT FORMATTING OF MODULATED
ASSIGNMENT MODULATION
WAVE

WIRELESS MEDIUM
RESULT

PC2 TRANSCEIVER

ASCII TO LOW SAMPLING DATA


BINARY FORMATTING PASS OF
RECEPTION
CONVERTER FILTER DATA

PC1 TRANCEIVER (TRANSMISSION)


The steps which are included in the transmission of data input by user are

1. DATA INPUT
2. FORMATTING(BINARY TO ASCII CONVERTER)
3. VOLTAGE ASSIGNMENT
4. ASK MODULATION
5. TRANSMISSION OF MODULATED WAVE

DATA INPUT
The task is to design a calculator so we have to take integers and arithmetic functions as as
input from pc1 and we have task to send this data through wireless medium to another pc
which is mentioned as pc2 .So the first task is to convert data in representable way to
transmit across one pc to another.
BINARY TO ASCII CONVERTION
Our first step to design a wireless calculator is to convert our input into binary data. As we
know in calculator every key represents an ASCII here all the characters are representing a
number. Now we have to convert our data to digital signals so we have to do Encoding for
that purpose. Encoding is the process including arranging a sequence of characters such as
letters,punctuation,numbers and certain other symbols into a specialized format for the
purpose of efficient transmission and storage. For example in Matlab there is function for
this conversion

VOLTAGE ASSIGNMENT
Now we have to assign binary values to data inputs we have techniques like NRZ Coding
.NRZ coding allow us to have 1 for High voltage level and 0 for Low voltage level. The end or
start of a bit will not be indicated and it will maintain the same voltage state, if the value of
the previous bit and the value of the present bit are same.But in our case we simply assign
voltage levels

BINARY NUMBERS
1 5V
0 0V

ASK MODULATION
The next step is ASK (Amplitude Shift Keying) in which the amplitude of the carrier is
changed in response to information and all else is kept fixed. An ASK modulated signal was
only allowed when base band signal is kept 1 otherwise it will transmit another stream or
carrier signal at 0. All the other parameters of the carriers are kept constant which include
frequency and phase.The reason why we are chosing ask is because of simple circuitry of
modulation and demodulation and short distance communication.
In above equation value of Vask in case ii is 0 because of amplitude is zero.

Practical example of Matlab is given in the following figure.

As we see in above figures we generate a carrier wave and base band square wave at
positive amplitude it allows carrier wave to transmit but at zero it gives 0 value because the
amplitude of the other carrier wave is 0V as we discussed already in topic of assigning
voltages level to binary numbers.

TRANSMISSION OF MODULATED WAVE


There are some characteristics of modulated wave that are necessary for transmission

 Data Rate
 Bit Interval
 Sampling Frequency
 Number of samples Per Bit
 Carrier Frequency

PC2 TRANSCEIVER (RECEPTION)


The steps which are included in the reception of data are

1. Data Reception
2. Sampling
3. LPF
4. Decision making device (threshold values)
5. FORMATTING(Binary to ASCII conversion)

DATA RECEPTION
After the ASK modulated wave is transmitted the receiver collects the binary pulse train
which is further demodulated filtered and pulse shaped .The ASK has an disadvantage of
getting excessive noise and so the shape of wave distorted so the original signal cannot be
obtained at that point.

DEMODULATION

SAMPLING OF DATA

MULTIPLICATION WITH CARRIER WAVE


In this demodulation system at the input we have an ASK waveform and at the output we
will get binary inputs. The product modulator requires two inputs and the first input is
incoming binary ASK waveform and the other input of this product modulator is locally
generated carrier wave since it is a coherent demodulation so the locally generated carrier
wave at the receiving end should be in synchronism with the carrier wave that is used at the
transmitting end.

ASK MODULATED
SIGNAL
THRESHOLD
INTEGRATOR LPF
VALUES

Cos2(πfcT)

LOW PASS FILTER


The main complication faced by ASK modulation is the excessive noise so in order to
eradicate this problem we have to design a low pass filter. The output of the modulator is
fed to integrator it acts as a low-pass filter. The integrator operates on the output of the
multiplier for successive bit intervals and here it performs a function of low pass filter.
For example if there is a carrier with frequency of 200 Hz so after transmission there is
excessive noise frequency below 200 and above, to eradicate lower excessive frequency we
uselow pass filter .

DECISION MAKING DEVICE


The next step after low pass filtering is to set a threshold value for a filtered modulated
wave because there is some changes in the values of amplitude due to noise but still we can
able to notice that abrupt changes For example we set 0V for 0 and 5 V for 1 but the
amplitude of wave increased to 2 V at 0 and 7 V at 1 so we set values like 3V as threshold
value so below 3V counts as 0 and above that preset value counts as 1

Like in this above figure the threshold is about 250 mV so the peak value above threshold
couts as 1 and below 250 mV counts as 0.

BASIC CONCEPT OF DEMODULATION


The following general waveforms represents the basic concepts of techniques we are using
and how these waveforms evolve with every step and how they converted back to orignal
binary pulse train after being filtered and rectified.

FORMATTING(BINARY TO ASCII CONVERSION)


Now the Task is to get the information from the user input after being processed from different
methods .The binary pulse train is now converted back to ASCII and displayed at PC2 . In matlab we
can do this conversion by using following function.
CODE FOR ASK MODULATION AND DEMODULATION
clc;
clear all;
close all;
x=[ 1 0 0 1 1 0 1];
bp=.000001;
disp(' Binary information at Trans mitter :');
disp(x);
bit=[];
for n=1:1:length(x)
if x(n)==1;
se=ones(1,100);
else x(n)==0;
se=zeros(1,100);
end
bit=[bit se];

end
t1=bp/100:bp/100:100*length(x)*(bp/100);
subplot(3,1,1);
plot(t1,bit,'lineWidth',2.5);grid on;
axis([ 0 bp*length(x) -.5 1.5]);
ylabel('amplitude(volt)');
xlabel(' time(sec)');
title('Orignal signal to transmit');
A1=10;
A2=5;
br=1/bp;
f=br*10;
t2=bp/99:bp/99:bp;
ss=length(t2);
m=[];
for (i=1:1:length(x))
if (x(i)==1)
y=A1*cos(2*pi*f*t2);
else
y=A2*cos(2*pi*f*t2);
end
m=[m y];
end
t3=bp/99:bp/99:bp*length(x);
subplot(3,1,2);
plot(t3,m);
xlabel('time(sec)');
ylabel('amplitude(volt)');
title('ASK Modulation');
mn=[];
for n=ss:ss:length(m)
t=bp/99:bp/99:bp;
y=cos(2*pi*f*t);
mm=y.*m((n-(ss-1)):n);
t4=bp/99:bp/99:bp;
z=trapz(t4,mm)
zz=round((2*z/bp))
if(zz>7.5)
a=1;
else
a=0;
end
mn=[mn a];
end
disp(' Waveform After Demodulation :');
disp(mn);
bit=[];
for n=1:length(mn);
if mn(n)==1;
se=ones(1,100);
else mn(n)==0;
se=zeros(1,100);
end
bit=[bit se];

end
t4=bp/100:bp/100:100*length(mn)*(bp/100);
subplot(3,1,3)
plot(t4,bit,'LineWidth',2.5);grid on;
axis([ 0 bp*length(mn) -.5 1.5]);
ylabel('amplitude(volt)');
xlabel(' time(sec)');
title('Result after Demodulation');

RESULTS

Conclusion
The above technique are the basic approach to sending input wirelessly from one pc to another to
perform task.These steps have to be followed while achieving this task practically like coding on
MATLAB so the approach and parameters will be same .

You might also like