0% found this document useful (0 votes)
8 views

micro controller

The document is a laboratory manual for the Principles of Communication Systems Lab for the IV semester Electronics and Communication Engineering students at Yenepoya Institute. It outlines the vision and mission of the department, course objectives, and a list of experiments to be conducted, along with assessment details and reference books. The manual also includes course outcomes, program educational objectives, and mapping of course outcomes to program outcomes.

Uploaded by

Vishwa naykodi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

micro controller

The document is a laboratory manual for the Principles of Communication Systems Lab for the IV semester Electronics and Communication Engineering students at Yenepoya Institute. It outlines the vision and mission of the department, course objectives, and a list of experiments to be conducted, along with assessment details and reference books. The manual also includes course outcomes, program educational objectives, and mapping of course outcomes to program outcomes.

Uploaded by

Vishwa naykodi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

Yenepoya Institute of

N.H.13, Thodar, Moodbidri- 574225, Mangaluru, DK


Technology, Moodbidri
(Sponsored by Islamic Academy of Education)

Principles of Communication Systems Lab (IPCC)

IV semester (ECE)
Subject Code: BECL404

LABORATORY MANUAL

NAME OF THE STUDENT :

UNIVERSITY SEAT NUMBER :

SECTION & BATCH :

Prepared by: MR. SANDEEPA PRABHU

DEPARTMENT OF
ELECTRONICS & COMMUNICATION ENGINEERING
2023-2024
Department of Electronics & Communication
Engineering

SL.NO. TITLE PAGE No

Vision, Mission of The Department 4-5

VTU Syllabus 6-7

Course Outcomes 7

CO vs PO & CO vs PSO mapping 8

Instructions Before Starting The Experiment 9

List of Experiments

Implement the following using discrete components

Basic Signals and Signal Graphing: a) unit Step, b) Rectangular, 10 - 13


1 c) standard triangle
d) sinusoidal and e) Exponential signal.
Illustration of signal representation in time and frequency 14 – 18
2 domains for a rectangular
pulse
Amplitude Modulation and demodulation: Generation 19 – 24
3 and display the relevantsignals and its spectrums.
Frequency Modulation and demodulation: Generation and 25 – 28
4 display the relevant
signals and its spectrums.
Sampling and reconstruction of low pass signals. 29 – 30
5 Display the signals and itsspectrum
6 Time Division Multiplexing and demultiplexing 31 – 33

7 PCM Illustration: Sampling, Quantization and Encoding 34 – 36

Generate a)NRZ, RZ and Raised cosine pulse, b) Generate and 37 – 39


8 plot eye diagram
Generate the Probability density function of Gaussian 40 – 42
9 distribution function
Display the signal and its spectrum of an audio signal. 43 – 45
10
Vision of the Department:
To inspire innovations so as to carve a niche in the field of Electronics and Communication
Engineering by inculcate a spirit of creative thinking and train the students in present
technologies to meet industrial as well as social needs.

Mission of the Department:


1. To continuously keep abreast with current trends and technology that support the students to
excel in the area of Electronics and Communication Engineering.
2. Provide ethical and value based education by promoting activities addressing the social and
industrial needs.
3. Equip students with a steady foundation in Electronics and Communication technology
concepts to enable them for continuing education.

Program Educational Objectives (PEOs):


1. Graduates will be able to excel in professional career or higher education by acquiring
required up to date knowledge in area of Electronics and Communication Engineering.
2. Graduates will be able to analyze real life problems, design appropriate systems to provide
solutions that are technically sound, economically feasible and socially acceptable.
3. Graduates will be able to exhibit professionalism, ethical attitude, communication skills and
team work and adapt to current trends by engaging in lifelong learning.

Program Outcomes (PO’s):


The engineering graduates will be able to,
• Engineering knowledge: apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex engineering problems.
• Problem analysis: identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of mathematics,
natural sciences, and engineering sciences.
• Design/development of solutions: design solutions for complex engineering problems and design
system components or processes that meet the specified needs with appropriate consideration for
the public health and safety, and the cultural, societal, and environmental considerations.
• Conduct investigations of complex problems: use research-based knowledge and research
methods including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
• Modern tool usage: create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools including prediction and modeling to complex engineering activities with
an understanding of the limitations.
• The engineer and society: apply reasoning informed by the contextual knowledge to assess
societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the
professional engineering practice.
• Environment and sustainability: understand the impact of the professional engineering solutions
in societal and environmental contexts, and demonstrate the knowledge of, and need for
sustainable development.
• Ethics: apply ethical principles and commit to professional ethics and responsibilities and norms
of the engineering practice.
• Individual and team work: function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
• Communication: communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write
effective reports and design documentation, make effective presentations, and give and receive
clear instructions.
• Project management and finance: demonstrate knowledge and understanding of the engineering
and management principles and apply these to one’s own work, as a member and leader in a team,
to manage projects and in multidisciplinary environments.
• Life-long learning: recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.

Program Specific Outcomes (PSO’s):


1. Graduates will be able to Analyze and design analog & digital circuits using fundamentals
of electronics engineering and build systems which will be useful for the society.
2. Graduates will be able to implement functional blocks of hardware and software for signal
processing and communication applications along with automation systems to process
different signals.
PRINCIPLES OF COMMUNICATION SYSTEMS LAB
B.E., IV Semester, Electronics & Communication Engineering

2022 Scheme

Course Code BEC402 CIE Marks 25


Exam duration 2/3 hours

Course Objectives
This course will enable students to
• Understand and analyse concepts of Analog Modulation schemes viz; AM, FM
• Design and analyse the electronic circuits for AM and FM modulation and demodulation.
• Understand the concepts of random variable and random process to model communication
systems.
• Understand and analyse the concepts of digitization of signals.
• Evolve the concept of SNR in the presence of channel induced noise

S.No. Experiments
Basic Signals and Signal Graphing: a) unit Step, b) Rectangular, c) standard triangle
1
d) sinusoidal and e) Exponential signal.
Illustration of signal representation in time and frequency domains for a rectangular
2
pulse
Amplitude Modulation and demodulation: Generation and display the relevant
3 signals and its spectrums.

Frequency Modulation and demodulation: Generation and display the relevant


4
signals and its spectrums.
Sampling and reconstruction of low pass signals. Display the signals and its
5 spectrum

6 Time Division Multiplexing and demultiplexing


7 PCM Illustration: Sampling, Quantization and Encoding
Generate a)NRZ, RZ and Raised cosine pulse, b) Generate and plot eye diagram
8

Generate the Probability density function of Gaussian distribution function


9
Display the signal and its spectrum of an audio signal.
10
Course Outcomes
At the end of the course the student will be able to:
1. Identify and associate the random variables and random process in Communication system
design
2. Understand the principles of amplitude modulation in analog communication systems
3. Understand the principles of frequency modulation in analog communication systems
4. Understand digital representation of analog signals
5.Describe the ideal condition of the signal representation for baseband transmission of digital signals
and noise modeling
Assessment Details (both CIE and SEE)
The weightage of Continuous Internal Evaluation (CIE) is 50% and for Semester End Exam (SEE)
is 50%. The minimum passing mark for the CIE is 40% of the maximum marks (20 marks out of
50) and for the SEE minimum passing mark is 35% of the maximum marks (18 out of 50 marks).
The student is declared as a pass in the course if he/she secures a minimum of 40% (40 marks out
of 100) in the sum total of the CIE (Continuous Internal Evaluation) and SEE (Semester End
Examination) taken together.
The IPCC means the practical portion integrated with the theory of the course. CIE marks for the
theory component are 25 marks and that for the practical component is 25 marks.
CIE for the theory component of the IPCC
● 25 marks for the theory component are split into 15 marks for two Internal Assessment
Tests (Two Tests, each of 15 Marks with 01-hour duration, are to be conducted) and 10
marks for other assessment methods mentioned in 22OB4.2. The first test at the end of 40-
50% coverage of the syllabus and the second test after covering 85-90% of the syllabus.
● Scaled-down marks of the sum of two tests and other assessment methods will be CIE
marks for the theory component of IPCC (that is for 25 marks).
● The student has to secure 40% of 25 marks to qualify in the CIE of the theory component
of IPCC.
CIE for the practical component of the IPCC
● 15 marks for the conduction of the experiment and preparation of laboratory record, and
10 marks for the test to be conducted after the completion of all the laboratory sessions.
● On completion of every experiment/program in the laboratory, the students shall be
evaluated including viva-voce and marks shall be awarded on the same day.
● The CIE marks awarded in the case of the Practical component shall be based on the
continuous evaluation of the laboratory report. Each experiment report can be evaluated for
10 marks. Marks of all experiments’ write-ups are added and scaled down to 15 marks.
● The laboratory test (duration 02/03 hours) after completion of all the experiments shall be
conducted for 50 marks and scaled down to 10 marks.
● Scaled-down marks of write-up evaluations and tests added will be CIE marks for the
laboratory component of IPCC for 25 marks.
● The student has to secure 40% of 25 marks to qualify in the CIE of the practical
component of the IPCC.
Reference Books:

1. Louis E Frenzel, Principles of Electronic Communication Systems, 3rd Edition, Mc Graw Hill
Education
(India) Private Limited, 2016. ISBN: 978-0-07-066755-6.
2. Simon Haykin & Michael Moher, Communication Systems, 5th Edition, John Wiley, India Pvt.
Ltd, 2010, ISBN:978-81-265-2151-7.

Course Outcomes

At the end of this course student will be able to

CO1 Identify and associate the random variables and random process in Communication
systemdesign
CO2 Understand the principles of amplitude modulation in analog communication systems

CO3 Understand the principles of frequency modulation in analog communication systems


CO4 Understand digital representation of analog signals
C05 Describe the ideal condition of the signal representation for baseband transmission of digital
signalsand noise modeling

C06 Generate the basic signal, construct the different modulation techniques reconstruction,
multiplexing, pulse code modulation, pulse shaping, statistical analysis, and audio signal
analysis.

CORRELATION LEVELS

Correlation Levels: Slight (low) =1, Moderate (Medium) =2, Substantial (High) =3.
CO-PO MATRIX:

PO CO 1 CO 2 CO 3 CO 4 CO5 CO6 Course

PO 1 3 3 3 3 3 - 3

PO 2 3 3 3 3 3 - 3

PO 3 - - - - - - -

PO 4 - - - - - - -
PO 5 - - - - - 3 3

PO 6 - - - - - - -

PO 7 - - - - - - -

PO 8 - - - - - - -

PO 9 - - - - - - -

PO 10 - - - - - - -

PO 11 - - - - - - -

PO 12 - - - - - -

Justificatio P01: P01: P01: P01: P01: PO5:cre P01:


n apply apply apply apply apply ate, apply
the the the the the select, the
knowle knowle knowl knowled knowled and knowled
dge of dge of edge ge of ge of apply ge of
mathe mathe of mathem mathem appropri mathem
matics, matics, mathe atics, atics, ate atics,
science science, matics science, science, techniqu science,
, enginee , engineer engineer es, engineer
engine ring scienc ing ing resource ing
ering fundam e, fundame fundame s, and fundame
funda entals, engine ntals, ntals, modern ntals,
mental and an ering and an and an engineer and an
s, and enginee funda engineer engineer ing and engineer
an ring mental ing ing IT tools ing
engine speciali s, and specializ specializ includin specializ
ering zation an ation to ation to g ation to
special to the engine the the predicti the
ization solutio ering solution solution on and solution
to the n of special of of modelin of
solutio comple ization complex complex g to complex
n of x to the engineer engineer complex engineer
comple enginee solutio ing ing engineer ing
x ring n of problem problem ing problem
engine proble compl s. s. activitie s.
ering ms. ex s with
proble engine an
ms. ering PO2: PO2: understa PO2:
PO2: proble identify, identify, nding of identify,
identify formulat formulat the formulat
PO2: , ms. e, e, limitatio e,
identif formula review review ns. review
y, te, research research research
formul review PO2: literatur literatur literatur
ate, researc identif e, and e, and e, and
review h y, analyze analyze analyze
researc literatur formul complex complex complex
h e, and ate, engineer engineer engineer
literatu analyze review ing ing ing
re, and comple researc problem problem problem
analyz x h s s s
e enginee literatu reaching reaching reaching
comple ring re, and substant substant substant
x proble analyz iated iated iated
engine ms e conclusi conclusi conclusi
ering reachin compl ons ons ons
proble g ex using using using
ms substan engine first first first
reachin tiated ering principl principl principl
g conclus proble es of es of es of
substan ions ms mathem mathem mathem
tiated using reachi atics, atics, atics,
conclu first ng natural natural natural
sions principl substa sciences sciences sciences
using es of ntiated , and , and , and
first mathe conclu engineer engineer engineer
princip matics, sions ing ing ing
les of natural using sciences sciences sciences
mathe science first . . .
matics, s, and princip
natural enginee PO5:cre
les of ate,
science ring mathe
s, and science select,
matics and
engine s. ,
ering apply
natural appropri
science scienc
s. ate
es, and techniqu
engine es,
ering resource
scienc s, and
es. modern
engineer
ing and
IT tools
includin
g
predicti
on and
modelin
g to
complex
engineer
ing
activitie
s with
an
understa
nding of
the
limitatio
ns.

CO-PSO MATRIX:

PSO CO 1 CO 2 CO 3 CO 4 CO 5 Course

PSO 1 - - - - - -

PSO 2 - - - - - -

Justification Nil Nil Nil Nil Nil Nil

Instructions before Starting the Experiment

1. Should come on time with thorough preparation for the experiment to be conducted.
2. Should bring the practical record fully completed in all respects pertaining to the experiment
conducted in the previous lab/s.
3. After completion of the program, certification of the concerned Faculty -in-charge in the
observation book is necessary.
4. Turn off the systems/Fans/Lights after use.
5. Keep the Computer lab premises clean and tidy.
6. Do not misbehave in the computer laboratory.
7. Do not touch, connect or disconnect any plug/cable/flash drive without your
Faculty/laboratory technician’s permission.
8. Do not read or modify other users' files.
9. Replace the materials/equipment in proper place after work.
10. Ask your Faculty-in-charge or lab technician for assistance if you have any problem.
Experiment No. 1
BASIC SIGNALS AND SIGNAL GRAPHING

Aim : To plot basic signals using matlab functions a) unit Step, b) Rectangular, c) standard triangle d) sinusoidal
and e) Exponential signal f)Square signal g)Ramp signal h)Triangular signal

APPARATUS:
1. Personal Computer
2. MATLAB software R2013a.

PROCEDURE:
1. Open MATLAB version R2013a
2. Open new file and enter the program and save it.
3. Add the path to the location of the file in the system.
4. Compile the program and check for any error and debug it.
5. Note down the output.

Matlab Program

SINE WAVE COSINE WAVE SQUARE WAVE UNIT STEP SIGNAL


disp('sine signal'); N=10; disp('cosine disp('square signal'); N=10; N=10;
n=0:0.1:N; signal'); N=10; n=0:0.1:N; n=-N:1:N;
x=sin(n); n=0:0.1:N; x=square(n); plot(n,x); x=[zeros(1,N) 1
plot(n,x); x=cos(n); xlabel('time'); ones(1,N)];
xlabel('time'); plot(n,x); ylabel('amplitude'); plot(n,x);
ylabel('amplitude'); xlabel('time'); title('square wave'); grid; xlabel('time');
title('sine wave'); grid; ylabel('amplitude'); ylabel('amplitude');
title('cosine wave'); title('step signal'); grid;
grid;

RAMP RESPONSE TRIANGULAR WAVE UNIT IMPULSE SAWTOOTH WAVE


N=10 N=10; SIGNAL disp('sawtooth
; a=2; t=0:N; N=10; signal'); N=50;
n=-N:1:N; y=(-1).^t; n=-N:1:N; n=0:0.1:N;
x=a*n; plot(n,x); plot(t,y); x=[zeros(1,N) 1 x=sawtooth(n); plot(n,x);
xlabel('time'); ylabel('Amplitude'); zeros(1,N)]; xlabel('time');
ylabel('amplitude'); xlabel ('Time '); title plot(n,x); ylabel('amplitude');
title('ramp signal'); grid; ('Triangular wave'); xlabel('time');
title('sawtooth wave');
grid; ylabel('amplitude'); grid;
title('impulse signal');
grid;
EXPONENTIAL SIGNAL EXPONENTIAL EXPONENTIAL SINC WAVE
disp(‘exponential signal’); GROWING SIGNAL DECAYING disp('sine signal'); N=10;
t=-1:0.1:1; N=10; a=0.5; n=0:0.1:N; N=10; a=0.5; n=0:0.1:N; n=-N:0.1:N;
x=exp(2*t); plot(t,x); x=a.^-n; x=a.^n; plot(n,x); x=sinc(n); plot(n,x);
xlabel(‘time’); plot(n,x); xlabel('time'); xlabel('time');
ylabel(‘amplitude’); xlabel('time'); ylabel('amplitude'); title('exp ylabel('amplitude');
title(‘exp signal); grid; ylabel('amplitude'); title('exp decaying signal'); title('sine wave'); grid;
growing signal'); grid;
grid;

WAVEFORMS:
IPCC PCS Lab

Experiment No.2

SIGNAL REPRESENTATION IN TIME AND FREQUENCY DOMAINS FOR A


RECTANGULAR PULSE.

Aim: To illustrate rectangular pulse representation in Time and Frequency domain


APPARATUS:
1. Personal Computer
2. MATLAB software R2013a.

PROCEDURE:
3. Open MATLAB version R2013a
4. Open new file and enter the program and save it.
5. Add the path to the location of the file in the system.
6. Compile the program and check for any error and debug it.
7. Note down the output.

Matlab Program

clear
;clc;
% Define parameters
A = 2; % Amplitude of the rectangular pulse
tau = 4; % Duration of the rectangular pulse in
seconds t_step = 0.001; % Time step in seconds
t_range = -10:t_step:10; % Time range from -10 to 10 seconds
% 1. Generating rectangular pulse in the time
domain rect_pulse = A * (abs(t_range) < (tau/2));
% 2. Transforming the signal from the time domain into the frequency
domain N = length(t_range); % Number of points in the signal
f_signal = fft(rect_pulse, N); % Compute the FFT of the signal
f_signal1 = fftshift(f_signal); % Shift the zero frequency component to the
center f_range = (-N/2:N/2-1)*(1/(t_step*N)); % Frequency range
% 3. Plot the signal in the time
domain figure;
subplot(2,1,1);
plot(t_range,
rect_pulse);
title('Rectangular Pulse in Time
Domain');xlabel('Time (s)');
ylabel('Amplitude'
);grid on;
% Plot the magnitude of the signal in the frequency
domain subplot(2,1,2);

14
IPCC PCS Lab
plot(f_range, abs(f_signal1)/N); % Normalized
magnitude title('Rectangular Pulse in Frequency
Domain'); xlabel('Frequency (Hz)');
ylabel('Magnitude'
);grid on;

15
IPCC PCS Lab

Output waveform

16
IPCC PCS Lab

Experiment No.3

AM MODULATION AND DEMODULATION


AIM: To simulate AM modulation and demodulation and display the signal and its spectrum.

APPARATUS:
1. Personal Computer
2. MATLAB software R2013a.

PROCEDURE:
1. Open MATLAB version R2013a
2. Open new file and enter the program and save it.
3. Add the path to the location of the file in the system.
4. Compile the program and check for any error and debug it.
5. Note down the output.

MATLAB program
clc; clear all;close
all; fm=40;
fc=500;
vm=1;vc=1;
mu=0.8; % modulation index
% x-
axis:Time(second)
t=0:0.00001:0.1;
f=0:1:9999;
% y-axis:Voltage(volt)
V1=vc+mu*sin(2*pi*fm*t); %upper
envelop V2=-(vc+mu*sin(2*pi*fm*t)); %
lower envelop Vm=vm*sin(2*pi*fm*t);
Vc=vc*sin(2*pi*fc*t);
Vam=vc*(1+mu*sin(2*pi*fm*t)).*(sin(2*pi*fc*t)); %%AM
signal Vr=Vam.*Vc; % Synchronous detector
Vf=abs(fft(Vam,10000))/500; % Spectrum
[b a] =
butter(3,0.002); out=
filter(b,a,Vr);
%Plot modulating,carrier
signalfigure(1);
Subplot(411
) plot(t,Vm);
title('AM modulating signal');
xlabel('time'), ylabel('amplitude');grid
on; subplot(412)
plot(t, Vc);
17
IPCC PCS Lab
title('AM carrier signal');
xlabel('time'), ylabel('amplitude');grid on;
subplot(413)
plot(t,Vam);hold on;
plot(t,V1,'r'),plot(t,V2,'r
');
title('AM waveform time-domain');
xlabel('time'), ylabel('amplitude');grid
on; subplot(414)
plot(t,1.81*out)

18
IPCC PCS Lab

title('AM Demodulated
signal'); xlabel('time'),
ylabel('amplitude');grid;
% Plot AM in time domain and Frequency domain
figure(2)
plot(f*10,Vf);
axis([(fc-6*fm) (fc+6*fm) 0 10]);
title('AM waveform frequency-
domain');
xlabel('frequency'), ylabel('amplitude');grid on;
Output Waveform:

Spectrum

19
IPCC PCS Lab

Experiment No.4

FM MODULATION AND DEMODULATION


AIM: To simulate FM modulation and demodulation and display the signal and its spectrum.

APPARATUS:
1. Personal Computer
2. MATLAB software R2013a.

PROCEDURE:
3. Open MATLAB version R2013a
4. Open new file and enter the program and save it.
5. Add the path to the location of the file in the system.
6. Compile the program and check for any error and debug it.
7. Note down the output.

MATLAB program
clc; clear
all;close
all;
fs=10000;
Ac=1;
Am=1;
fm=35
;
fc=500
;B=10;
t=(0:0.1*fs)/fs;
wc=2*pi*fc;
wm=2*pi*fm;
m_t=Am*cos(wm*t
); figure(1);
subplot(411);
plot(t,m_t);
xlabel('Time');ylabel('Amplitude');
title('Modulating or Message
signal');c_t=Ac*cos(wc*t);
subplot(412
);plot(t,c_t);
xlabel('Time');ylabel('Amplitude
'); title('Carrier signal');
s_t=Ac*cos((wc*t)+B*sin(wm*
t)); subplot(413);
plot(t,s_t);
xlabel('Time');ylabel('Amplitud
e'); title('Modulated signal');
20
IPCC PCS Lab
d=demod(s_t,fc,fs,'fm');
subplot(414);
plot(t,d);
xlabel('Time');ylabel('Amplitud
e');
title('demodulated
signal');figure(2);
vf=(fft(s_t,10^4))/500;
f=0:10:99990; plot(f,vf);

21
IaPxiCs(C[ 0 10^4 0 0.4]); PCS Lab

xlabel('frequency');
ylabel('amplitude'); title('FM
frequency-domain'); grid on;
Output Waveform:

Spectrum

22
IPCC PCS Lab

Experiment No.5
SAMPLING AND RECONSTRUCTION OF LOW PASSSIGNALS

AIM: Simulate the process of sampling and reconstruction of low pass signals, and displaythe
waveforms

APPARATUS:
1. Personal Computer.
2. MATLAB Simulink

PROCEDURE:
1. Open MATLAB version R2013a
2. Open SIMULINK Library
3. Open new file and draw the Sampling and reconstruction diagram and save it.
4. Go to Simulation Menu and set model configuration parameters.
5. Go to Simulation menu and click on RUN
6. Note down the output waveform for following conditions.
i. For oversampling fs>2fm
ii. For sampling at Nyquist rate fs=2fm
iii. For undersampling fs<2fm
7. Sampling frequency can varied by varying the width of the pulse in pulse generator
blockshown in Simulink block diagram.

Sampling and Reconstruction Block

Construct the shown model in figure below:

Transmitter & Receiver:

23
IPCC PCS Lab
Figure 5.1: Sampling and reconstruction of signal

24
IPCC PCS Lab

Table 5.1: Parameter Settings for the Various Blocks in the Model

Name of the Block Name of the Model


Parameter
1. Pulse Generator Pulse type Time based
Library: Time Use simulation time
Amplitude 1
Period .01
Pulse width (%of 50%
period)
Phase delay 0
Choose the bottom
check box.
2.Signal Generator Waveform Sine
Library: Time Use simulation time
Amplitude 1
Frequency 0.25
Choose the bottom
check box.
3. Analog Filter Design Design Method Butterworth Type
Library: DSP System Filter Type Lowpass
Filter Order 10
Implementation Pass band Edge 30
Frequency

EXPECTED WAVEFORM:

CONCLUSION:

25
IPCC PCS Lab

Experiment No.6

TIME DIVISION MULTIPLEXING AND DEMULTIPLEXING.

AIM: To simulate Time division multiplexing of two signals.

APPARATUS:
Personal Computer
MATLAB software
R2013a.

PROCEDURE:
1. Open MATLAB version R2013a
2. Open new file and enter the program and save it.
3. Add the path to the location of the file in the system.
4. Compile the program and check for any error and debug it.
5. Note down the output.

MATLAB program

clc;
close
all; clear
all;
% Signal generation
t=0:0.001:0.1; % siganal taken upto 4pi
sig1=2*sin(2*pi*100*t); % generate 1st sinusoidal
signall=length(sig1);
sig2=2*sin(2*pi*200*t); % Generate 2nd Sigal
% Display of Both
Signalsubplot(2,2,1);
plot(t, sig1);
title('Sinusoidal Signal
1'); ylabel('Amplitude---
>');
xlabel('Time---
>');
subplot(2,2,2);
plot(t, sig2);
title('Sinosoidal Signal
2'); ylabel('Amplitude---
>');
26
IPCC PCS Lab
xlabel('Time--->');
% Display of Both Sampled
Signalsubplot(2,2,3);
stem(sig1);
title('Sampled Sinusoidal Signal
1');ylabel('Amplitude--->');
xlabel('Time---
>');
subplot(2,2,4);
stem(sig2);
title('Sampled Sinusoidal Signal
2');ylabel('Amplitude--->');
xlabel('Time--->');

27
IPCC PCS Lab
l1=length(sig1
);
l2=length(sig2
);for i=1:l1
sig(1,i)=sig1(i); % Making Both row vector to a
matrix sig(2,i)=sig2(i);
end
% TDM of both quantize
signal
tdmsig=reshape(sig,1,2*l1);
% Display of TDM
Signalfigure
stem(tdmsig);
title('TDM Signal');
ylabel('Amplitude---
>');
xlabel('Time--->');
% Demultiplexing of TDM
Signal
demux=reshape(tdmsig,2,l1);
for i=1:l1
sig3(i)=demux(1,i); % Converting The matrix into row
vectors sig4(i)=demux(2,i);
end

% display of demultiplexed
signalfigure
subplot(2,1,
1) plot(sig3);
title('Recovered Sinusoidal Signal
1');ylabel('Amplitude--->');
xlabel('Time---
>');
subplot(2,1,2)
plot(sig4);
title('Recovered Sinusoidal Signal
2');ylabel('Amplitude--->');
xlabel('Time--->');

Output waveforms

28
IPCC PCS Lab

29
IPCC PCS Lab

30
IPCC PCS Lab

Experiment No.7

PCM MODULATION AND DEMODULATION


AIM:

Simulate the pulse code modulation and demodulation system, and display the waveforms

APPARATUS:
1. Personal Computer.
2. MATLAB Simulink

PROCEDURE:
1. Open MATLAB version R2013a
2. Open SIMULINK Library
3. Open new file and draw the Transmitter and Receiver diagram and save it.
4. Go to Simulation Menu and set model configuration parameters.
5. Go to Simulation menu and click on RUN
6. Note down the output waveform.

PCM Block (Sampling, Quantization, Encoding)

Transmitter & Receiver:

Construct the shown model in figure below:

31
IPCC PCS Lab

Figure 7.1: PCM Transmitter and Receiver

32
IPCC PCS Lab

Table 7.1: Parameter Settings for the Various Blocks in the Models of PCM

Name of the Block Name of the PCM


Parameter
1. Pulse Generator Pulse type Time based
Library: Simulink→Sources Time Use simulation time
Amplitude 1
Period .05
Pulse width (%of 50%
period)
Phase delay 0
Choose the bottom
check box.
2.Signal Generator Waveform Sine
Library: Simulink→Sources Time Use simulation time
Amplitude 1
Frequency 2
Choose the bottom
check box.
3.Quantizing Encoder Quantization partition [-.5 0 .5]
Library: Communication System (=value of quantization
Toolbox→Source coding→Quantizing levels)
Encoder Quantization codebook [-0.75 -0.25 0.25 0.75]
3. Integer to Bit Converter Number of bits per 4
Library: Communication System integer
Toolbox→Utility Blocks
4. Bit to Integer Converter Number of bits per 4
Library: Communication System integer
Toolbox→Utility Blocks
5. Quantizing decoder Quantization codebook [-0.825 -0.5 0 .5 0.825]
`Library: Communication System
Toolbox→Source coding→Quantizing
Decoder
6. Analog Filter Design Design Method Butterworth Type
Library: DSP System Filter Type Lowpass
Toolbox→Filtering→Filter Filter Order 10
Implementation Pass band Edge 2
Frequency

33
IPCC PCS Lab

EXPECTED WAVEFORM:
PCM Transmitter & Receiver

CONCLUSION:

34
IPCC PCS Lab
Experiment No.8
LINE CODING AND EYE DIAGRAM
AIM:
To simulate NRZ, RZ, half-sinusoid and raised cosine pulses and generate eye diagram for
binary polar signaling.

APPARATUS:
1. Personal Computer
2. MATLAB software R2013a.

PROCEDURE:
1. Open MATLAB version R2013a
2. Open new file and enter the program and save it.
3. Add the path to the location of the file in the system.
4. Compile the program and check for any error and debug it.
5. Note down the output.

1. MATLAB program for Unipolar Non Return to Zero


function UNRZ1(h)
%Line code UNIPOLAR
NRZ. h=[1 1 0 1 1 0 1 0 1 0];
clf;
n=1
;
l=length(h
);h(l+1)=1;
while n<=length(h)-
1;t=n-1:0.001:n;
if h(n) == 0
if
h(n+1)==
0 y=(t>n);
else
y=(t==n)
;end
d=plot(t,y);grid on;
title('Line code UNIPOLAR
NRZ');set(d,'LineWidth',2.5);
hold on;
axis([0 length(h)-1 -1.5
1.5]); disp('zero');
else
if h(n+1)==0
y=(t<n)-
0*(t==n);
else
35
IPCC
y=(t<n)+1*(t==n PCS Lab
);end
d=plot(t,y);grid on;
title('Line code UNIPOLAR
NRZ');set(d,'LineWidth',2.5);
hold on;
axis([0 length(h)-1 -1.5 1.5]);

36
IPCC PCS Lab
disp('one')
;end
n=n+
1 end
end
2. MATLAB program for Unipolar Return to Zero
function URZ1(h)
h=[1 1 0 1 1 0 1 0 1
0];
clf;
n=1
;
l=length(h
);h(l+1)=1;
while n<=length(h)-
1;t=n-1:0.001:n;
if h(n) == 0
if
h(n+1)==
0 y=(t>n);
else
y=(t==n)
; end
d=plot(t,y);grid on
title('Line code UNIPOLAR
RZ');set(d,'LineWidth',2.5);
hold on;
axis([0 length(h)-1 -1.5
1.5]); disp('zero');
else
if h(n+1)==0
y=(t<n-
0.5);
else
y=(t<n-0.5)+1*(t==n);
end
d=plot(t,y);grid
on;
title('Line code UNIPOLAR
RZ');set(d,'LineWidth',2.5);
hold on;
axis([0 length(h)-1 -1.5
1.5]); disp('one');
end
n=n+1
; end
end

3. MATLAB program for Polar Non Return to Zero


37
IPCC PCS Lab
function PNRZ1(h)
%Line code POLAR
NRZ. h=[1 0 0 1 1 0 1 0
1 0];
clf;
n=1
;
l=length(h
);h(l+1)=1;
while n<=length(h)-1;

38
IPCC PCS Lab
t=n-1:0.001:n;
if h(n) == 0
if h(n+1)==0
y=-(t<n)-
(t==n); else
y=-
(t<n)+(t==n); end
d=plot(t,y);grid
on;
title('Line code POLAR
NRZ');
set(d,'LineWidth',2.5);
hold on;
axis([0 length(h)-1 -1.5
1.5]); disp('zero');
else
if h(n+1)==0
y=(t<n)-
1*(t==n);
else
y=(t<n)+1*(t==n
);end
d=plot(t,y)
;grid on;
title('Line code POLAR
NRZ');
set(d,'LineWidth',2.5);
hold on;
axis([0 length(h)-1 -1.5
1.5]); disp('one');
end
n=n+1
;end

4. MATLAB program for Polar Return to Zero


function POLARRZ1(h)
%Line code POLAR
RZ. h=[1 0 0 1 1 0 1 0
1 0];
clf;
n=1
;
l=length(h
);h(l+1)=1;
while n<=length(h)-
1;t=n-1:0.001:n;
if h(n) == 0
if h(n+1)==0
y=-(t<n-0.5)-(t==n);
39
IPCC PCS Lab
else
y=-(t<n-0.5)+(t==n);
end
d=plot(t,y);grid
on;
title('Line code POLAR
RZ');
set(d,'LineWidth',2.5);
hold on;
axis([0 length(h)-1 -1.5
1.5]); disp('zero');

40
IPCC PCS Lab
else
if h(n+1)==0
y=(t<n-0.5)-1*(t==n);
else
y=(t<n-0.5)+1*(t==n);
end
d=plot(t,y);grid
on;
title('Line code POLAR
RZ');set(d,'LineWidth',2.5);
hold on;
axis([0 length(h)-1 -1.5
1.5]); disp('one');
end
n=n+1
;end

5. MATLAB program for Bi-Polar Non Return to Zero


function AMINRZ1(h)
%Line code AMI
NRZ. h=[1 0 0 1 1 0 1
0 1 0];
clf;
n=1
;
l=length(h
);h(l+1)=1;
ami=-1;
while n<=length(h)-
1;t=n-1:0.001:n;
if h(n) == 0
if
h(n+1)==
0 y=(t>n);
else
if ami==1
y=-
(t==n);
else
y=(t==n)
; end
end
d=plot(t,y);grid
on;
title('Line code AMI
NRZ');
set(d,'LineWidth',2.5);
hold on;

41
IPCC PCS Lab
axis([0 length(h)-1 -1.5
1.5]); disp('zero');
else
ami=ami*-1;
if h(n+1)==0
if ami==1
y=(t<n);
else
y=-
(t<n); end
else

42
IPCC PCS Lab
if ami==1
y=(t<n)-
(t==n);
else
y=-
(t<n)+(t==n); end

end
d=plot(t,y);grid
on;
title('Line code AMI
NRZ');
set(d,'LineWidth',2.5);
hold on;
axis([0 length(h)-1 -1.5
1.5]); disp('one');
end
n=n+1
;
%pause
;end

6. MATLAB program for Bi-Polar Return to Zero


function AMIRZ1(h)
%Line code AMI RZ.
h=[1 0 0 1 1 0 1 0 1 0];
clf;
n=1
;
l=length(h
);h(l+1)=1;
ami=-1;
while n<=length(h)-
1;t=n-1:0.001:n;
if h(n) == 0
if
h(n+1)==
0 y=(t>n);
else
if ami==1
y=-
(t==n);
else
y=(t==n)
; end
end
d=plot(t,y);grid
on;

43
IPCC PCS Lab
title('Line code AMI
RZ');
set(d,'LineWidth',2.5);
hold on;
axis([0 length(h)-1 -1.5
1.5]); disp('zero');
else
ami=ami*-
1;if
h(n+1)==0 if
ami==1
y=(t<n-0.5);
else
y=-(t<n-0.5);

44
IPCC PCS Lab
en
d else
if ami==1
y=(t<n-0.5)-(t==n);
else
y=-(t<n-0.5)+(t==n);
end

end
d=plot(t,y);grid
on;
title('Line code AMI
RZ');
set(d,'LineWidth',2.5);
hold on;
axis([0 length(h)-1 -1.5
1.5]); disp('one');
end
n=n+1
;end

7. MATLAB program for Manchester Code


function manchester1(h)
%Line code
MANCHESTER h=[1 0 0 1
1 0 1 0 1 0];
clf;
n=1
;
h=~h;
l=length(h
);h(l+1)=1;
while n<=length(h)-
1;t=n-1:0.001:n;
if h(n) == 0
if h(n+1)==0
y=-(t<n)+2*(t<n-
0.5)+1*(t==n); else
y=-(t<n)+2*(t<n-0.5)-
1*(t==n); end
d=plot(t,y);grid on;
title('Line code
MANCHESTER');
set(d,'LineWidth',2.5);
hold on;
axis([0 length(h)-1 -1.5
1.5]); disp('one');
else
if h(n+1)==0
45
IPCC PCS Lab
y=(t<n)-2*(t<n-
0.5)+1*(t==n); else
y=(t<n)-2*(t<n-0.5)-
1*(t==n); end
d=plot(t,y);grid on;
title('Line code
MANCHESTER');
set(d,'LineWidth',2.5);
hold on;

46
IPCC PCS Lab
axis([0 length(h)-1 -1.5
1.5]); disp('zero');
end
n=n+1
;end

47
IPCC PCS Lab

MATLAB code Half Sinusoid

amp= sqrt(2/16);
Halfsine=amp*sin((2*pi*[0:15]/16)
/2);
fvtool(Halfsine,'Analysis','impulse')
;

Output Waveform

Imp ulse Re sp on se

0.35

0.3

0.25

0.2
Amplitude

0.15

0.1

0.05

0 5 10 15

Samples

Magnitude Response (dB)

20

48
IPCC PCS Lab
10

-10

-20

Magnitude (dB)
-30

-40

-50

-60

-70

-80
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

Normalized Frequency ( rad/sample)

49
IPCC PCS Lab

Eye Diagram for Binary Polar Signaling using Simulink

CONCLUSION:

50
IPCC PCS Lab

Experiment No.9

GENERATE THE PROBABILITY DENSITY FUNCTION OF GAUSSIAN DISTRIBUTION FUNCTION

Aim : To simulate probability density function of gausssian distribution function


APPARATUS:
• Personal Computer
• MATLAB software R2013a.

PROCEDURE:
• Open MATLAB version R2013a
• Open new file and enter the program and save it.
• Add the path to the location of the file in the system.
• Compile the program and check for any error and debug it.
• Note down the output.

Matlab Code
clc; clear all; close all;
colors=['r','g','b'] ;
m = 0;
sig = [0.25 0.6 1];
x = -5:0.05:5;
f=zeros(1,length(x)
); for w =
1:length(sig) for ii
= 1:length(x)
f(ii) = 1/(sig(w)*sqrt(2*pi)) .* exp(-((x(ii)-m)^2 /
(2*(sig(w))^2))); end
plot(x,f,colors(w
)) hold on
end
xlabel('x')
;
ylabel('PDF');
title('probability density function')
hleg1 =
legend('sigma=0.25','sigma=0.6','sigma=1');
set(hleg1,'Location','NorthEast')
axis([-5 5 0 2]);
grid on

Output Waveform

51
IPCC PCS Lab

52
IPCC PCS Lab

Experiment No.10

AUDIO SIGNAL AND ITS SPECTRUM DISPLAY


Aim : To simulate display of audio signal and its spectrum
APPARATUS:
• Personal Computer
• MATLAB software R2013a.

• PROCEDURE:
• Open MATLAB version R2013a
• Open new file and enter the program and save it.
• Add the path to the location of the file in the system.
• Compile the program and check for any error and debug it.
• Note down the output.

Matlab Code
clc;
clear
all;
close
all;

[y, fs]= audioread('d://path\sample.wav');


N = length(y);% % N is the number of
samples sound(y, fs); % Playback of the
sound data time=(1:length(y))/fs; % Time
vector on x-axis

f_signal = fft(y, N); % Compute the FFT of the signal


f_signal1 = fftshift(f_signal); % Shift the zero frequency component to the center

subplot(2,1,1);
plot(time,y); % Plot the waveform w.r.t. time
title('Time domain representation of audio
signal');xlabel('Time');
ylabel('Amplitude'); grid on;

subplot(2,1,2);
plot(abs(f_signal1)/N); % Normalized magnitude
title('Frequency Domain representation of audio
signal');xlabel('Frequency (Hz)');
ylabel('Magnitude'
);grid on;

53
BEC402 PCS LAB

CONTENT BEYOND SYLLABUS

1. Simulate DSB-SC generation and detection


2. Simulate PAM signal generation

Dept. of ECE, YIT MOODBIDRI 1 | Page

You might also like