0% found this document useful (0 votes)
89 views38 pages

PCS Lab Manual

The document is a lab manual for the course 'Principles of Communication Systems' at Basaveshwar Engineering College, detailing the course objectives, practical experiments, assessment methods, and educational outcomes. It outlines the vision and mission of the Electronics and Communication Engineering department, along with program educational objectives and specific outcomes for students. The manual also includes suggested learning resources and a list of experiments to be conducted using MATLAB.

Uploaded by

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

PCS Lab Manual

The document is a lab manual for the course 'Principles of Communication Systems' at Basaveshwar Engineering College, detailing the course objectives, practical experiments, assessment methods, and educational outcomes. It outlines the vision and mission of the Electronics and Communication Engineering department, along with program educational objectives and specific outcomes for students. The manual also includes suggested learning resources and a list of experiments to be conducted using MATLAB.

Uploaded by

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

IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS (22UEC411C)

BVV Sangha’s

Basaveshwar Engineering College, Bagalkote


Department of Electronics and Communication Engineering

LAB MANUAL FOR

PRINCIPLES OF COMMUNICATION SYSTEMS- 22UEC411C


IV SEMESTER B.E

Staff In-charge:

1. Dr. Mamata J. Sataraddi

2. Prof. Supriya B. Harlapur


3. S. S. Metimath (Instructor)

Department of Electronics and Communication Engineering,


Basaveshwar Engineering College, Bagalkot
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS (22UEC411C)

Vision:
 To achieve excellence in electronics and communication engineering through quality
education and research for developing competent professionals.
Mission:

 Foster a dynamic teaching and learning process.

 Encourage research through innovation and collaboration.

 Imbibe moral, ethical values and social responsibilities.

Program Educational Objectives (PEOs):

The Graduates will be able to:


PEO1:
PEO2:
PEO3:
Program Specific Outcomes (PSOs):
PSO1: Analyze and design systems for electronics, communication, and signal processing applications.
PSO2: Use domain specific tools for design, analysis, synthesis, and validation of VLSI and embedded
systems
PSO3: Demonstrate the conceptual knowledge with respect to architecture, design analysis and simulation
of computer networking and applications
Program Outcomes (POs)
PO-1: Engineering Knowledge: Apply the knowledge of mathematics, science, engineering
fundamentals, and an engineering specialization to the solution of complex engineering problems.
PO-2: 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.
PO-3: 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.
PO-4: 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.

Department of Electronics and Communication Engineering,


Basaveshwar Engineering College, Bagalkot
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS (22UEC411C)

PO-5: Modern Tool Usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modelling to complex engineering
activities with an understanding of the limitations.
PO-6: 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.
PO-7: 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.
PO-8: Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of the engineering practice.
PO-9: Individual and Team Work: Function effectively as an individual, and as a member or
leader in diverse teams, and in multidisciplinary settings.
PO-10: 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.
PO-11: 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 the team, to manage projects and in multidisciplinary environments,
PO-12: 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.

Department of Electronics and Communication Engineering,


Basaveshwar Engineering College, Bagalkot
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS (22UEC411C)

PRACTICAL COMPONENT OF IPCC (Experiments can be conducted using MATLAB/SCILAB/OCTAVE)

PRINCIPLES OF COMMUNICATION SYSTEMS Semester 4


Course Code 22UEC411C CIE Marks 50
Teaching Hours/Week (L:T:P: S) [Link] SEE Marks 50
Total Hours of Pedagogy 40 hours Theory + 8-10 Lab slots Total Marks 100
Credits 04 Exam Hours 03
Examination type (SEE) Theory/practical/Viva-Voce /Term-work/Others
Course objectives:
This course will enable students to
• Understand and analyze concepts of Analog Modulation schemes viz; AM, FM
• Design and analyze 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 analyze the concepts of digitization of signals.
• Evolve the concept of SNR in the presence of channel induced noise

Sl.
Experiments
No.

Basic Signals and Signal Graphing: a) unit Step, b) Rectangular, c) standard triangle d)
1.
sinusoidal and e) Exponential signal.

2. Illustration of signal representation in time and frequency domains for a rectangular pulse.

Amplitude Modulation and demodulation: Generation and display the relevant signals and its
3.
spectrums.

Frequency Modulation and demodulation: Generation and display the relevant signals and
4.
its spectrums.

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

6. Time Division Multiplexing and demultiplexing.

7. PCM Illustration: Sampling, Quantization and Encoding

8. Generate a)NRZ, RZ and Raised cosine pulse, b) Generate and plot eye diagram

9. Generate the Probability density function of Gaussian distribution function.


10. Display the signal and its spectrum of an audio signal.

Department of Electronics and Communication Engineering,


Basaveshwar Engineering College, Bagalkot
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS (22UEC411C)

Course outcomes (Course Skill Set):


At the end of the course the student will be able to:
1. Understand the principles of analog communication systems and noise modelling.
2. Identify the schemes for analog modulation and demodulation and compare
their performance.
3. Design of PCM systems through the processes sampling, quantization and encoding.
4. Describe the ideal condition, practical considerations of the signal representation for
baseband transmission of digital signals.
5. Identify and associate the random variables and random process in Communication
system design.
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.

Department of Electronics and Communication Engineering,


Basaveshwar Engineering College, Bagalkot
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS (22UEC411C)

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 vivavoce 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’ writeups 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.

Department of Electronics and Communication Engineering,


Basaveshwar Engineering College, Bagalkot
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS (22UEC411C)

SEE for IPCC


Theory SEE will be conducted by University as per the scheduled timetable, with common question
papers for the course (duration 03 hours)
● The question paper will have ten questions. Each question is set for 20 marks.
● There will be 2 questions from each module. Each of the two questions under a module (with a
maximum of 3 sub-questions), should have a mix of topics under that module.
● The students have to answer 5 full questions, selecting one full question from each module.
● Marks scored by the student shall be proportionally scaled down to 50 Marks

The theory portion of the IPCC shall be for both CIE and SEE, whereas the practical portion will
have a CIE component only. Questions mentioned in the SEE paper may include questions from
the practical component.
● The minimum marks to be secured in CIE to appear for SEE shall be 10 (40% of maximum
marks- 25) in the theory component and 10 (40% of maximum marks -25) in the practical
component. The laboratory component of the IPCC shall be for CIE only. However, in SEE, the
questions from the laboratory component shall be included. The maximum of 04/05 sub-
questions are to be set from the practical component of IPCC, the total marks of all questions
should not be more than 20 marks.
● SEE will be conducted for 100 marks and students shall secure 35% of the maximum marks to
qualify for the SEE. Marks secured will be scaled down to 50.
● 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.
Suggested Learning Resources:
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.
Reference Books
1. B P Lathi, Zhi Ding, “Modern Digital and Analog Communication Systems”, Oxford University
Press., 4th edition, 2010, ISBN: 97801980738002.
2. Herbert Taub, Donald L Schilling, Goutam Saha, “Principles of Communication systems”, 4th
Edition, Mc Graw Hill Education (India) Private Limited, 2016. ISBN: 978-1-25-902985-1
Web links and Video Lectures (e-Resources):
1. Principles of Communication Systems [Link]
2. Communication Engineering [Link]
Activity Based Learning (Suggested Activities in Class)/ Practical Based learning
1. Assignments and test – Knowledge level, Understand Level and Apply level
2. Experiential Learning by using free and open source software’s SCILAB or OCTAVE
3. Open ended questions by faculty, Open ended questions from students

Department of Electronics and Communication Engineering,


Basaveshwar Engineering College, Bagalkot
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS (22UEC411C)

CONTENT LIST
SL. PAGE
EXPERIMENT NAME
NO. NO.
Basic Signals and Signal Graphing: a) Unit Step, b) Rectangular, c) standard
1. 1-6
triangle d) sinusoidal and e) Exponential signal.
Illustration of signal representation in time and frequency domains for a rectan
2. 7-8
pulse.
Amplitude Modulation and demodulation: Generation and display
3. 9-10
the relevant signals and its spectrums.
Frequency Modulation and demodulation: Generation and display the 11-12
4.
relevant signals and its spectrums.
Sampling and reconstruction of low pass signals. Display the signals and its 13-14
5.
spectrum.
6. Time Division Multiplexing and demultiplexing. 15-16

7. PCM Illustration: Sampling, Quantization and Encoding 17-18


Generate a)NRZ, RZ and Raised cosine pulse, b) Generate and plot eye 19-24
8.
diagram
9. Generate the Probability density function of Gaussian distribution function. 25

10. Display the signal and its spectrum of an audio signal. 26-27

Department of Electronics and Communication Engineering,


Basaveshwar Engineering College, Bagalkot
BEC, Bagalkote

PRINCIPLES OF COMMUNICATION SYSTEMS- 22UEC411C

PRACTICAL COMPONENT OF IPCC (Experiments conducted using MATLAB)

1. Basic Signals and Signal Graphing: a) Unit Step, b) Rectangular, c) standard triangle d)
sinusoidal and e) Exponential signal.

AIM: To write a MATLAB program to generate basics signals as Unit Step, Rectangular,
Triangular, Sinusoidal, Exponential signal

% a) unit step function%


clc;
clear all;
close all;
% Define the time range
t = -5:0.01:5;

% Define the unit step function


unit_step = @(t) (t >= 0);

% Evaluate the unit step function


y = unit_step(t);

% Plot the unit step function


plot(t, y, 'LineWidth', 2);
xlabel('Time');
ylabel('Amplitude');
title('Unit Step Function');
grid on;

clc;
clear all;
close
all;
N=100;
t=1:100;
x=ones(1,N);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('unit step function');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('unit step discrete function');

22UEC411C-IPCC- PCS Lab


Department of ECE 1 Manual
BEC, Bagalkote

OUTPUT:

% b) unit rectangle function%


clc;
clear all;
close
all;
% Define the time range
t = -5:0.01:5;

% Define the unit rectangle function


unit_rectangle = @(t) (abs(t) <= 0.5);

% Evaluate the unit rectangle function


y = unit_rectangle(t);

% Plot the unit rectangle function


plot(t, y, 'LineWidth', 2);
xlabel('Time');
ylabel('Amplitude');
title('Unit Rectangle Function');
grid on;

22UEC411C-IPCC- PCS Lab


Department of ECE 2 Manual
BEC, Bagalkote

OUTPUT:

% c) triangular function%
clc;
clear all;
close
all;
t=0:0.01:2;
x=sawtooth(2*pi*5*t,0.5);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('trianguler signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('triangular sequence');

22UEC411C-IPCC- PCS Lab


Department of ECE 3 Manual
BEC, Bagalkote

OUTPUT:

% d) sinusoidal function%
clc;
clear all;
close
all;
t=0:0.01:2;
x=sin(2*pi*t);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('sinusoidal sequence');

22UEC411C-IPCC- PCS Lab


Department of ECE 4 Manual
BEC, Bagalkote

OUTPUT:

% e) Exponential Function%
clc;
clear all;
close
all;
n=50;
s=[Link]n;
figure(1)
C1=0.95*(exp(j*(pi/10)).*s);
C2=0.95*(exp(j*(pi/
10)).*s);
C=real(C1)+real(C2);
stem(s, C)
xlabel('Sample Number n');
ylabel('Amplitude');
title('Exponential Signal');

22UEC411C-IPCC- PCS Lab


Department of ECE 5 Manual
BEC, Bagalkote

OUTPUT:

22UEC411C-IPCC- PCS Lab


Department of ECE 6 Manual
BEC, Bagalkote

2. Illustration of signal representation in time and frequency domains for a rectangular pulse

AIM: To write a MATLAB program to generate signal representation in time and frequency
domains for a rectangular pulse

% Illustration of Signal Representation in Time and Frequency Domains for a


Rectangular Pulse
clc;
clear all;
close
all;
% Parameters
Fs = 1000; % Sampling frequency (Hz)
T = 1/Fs; % Sampling period
duration = 1; % Duration of signal (seconds)
pulse_width = 0.1; % Width of rectangular pulse (seconds)
A = 1; % Amplitude

% Time vector
t = 0:T:duration-T;

% Generate rectangular pulse


x_rect = zeros(size(t));
x_rect(t < pulse_width) = A;

% Compute Fourier Transform


X_rect = fft(x_rect);
frequencies = linspace(0, Fs, length(X_rect));

% Plot the rectangular pulse in time domain


subplot(2, 1, 1);
plot(t, x_rect, 'b', 'LineWidth', 2);
title('Rectangular Pulse in Time Domain');
xlabel('Time (s)');
ylabel('Amplitude');

% Plot the magnitude of the Fourier Transform in frequency domain


subplot(2, 1, 2);
stem(frequencies, abs(X_rect), 'r', 'LineWidth', 2);
title('Magnitude of Fourier Transform in Frequency Domain');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
xlim([0, Fs/2]);
% Adjust plot
grid on;
22UEC411C-IPCC- PCS Lab
7 Manual
BEC, Bagalkote

OUTPUT:

22UEC411C-IPCC- PCS Lab


8 Manual
BEC, Bagalkote

3. Amplitude Modulation and demodulation: Generation and display the relevant signals and
its spectrums

AIM: To write a MATLAB program to generate Amplitude Modulation and demodulation and
display the relevant signals and its spectrums

% $$ %% AM Modulation and Demodulation using Functions in MATLAB

clc;
clear all;
close
all;
%% Modulation index
h= 60;
%% Time Period of Simulation :
t = linspace(0, 0.2, 100000);
%% Message Signal :
Am = 14;
fm = 200;
ym = Am*cos(2*pi*fm*t);
figure;
subplot(4, 1, 1);
plot(t(1:10000), ym(1:10000));
title('Message Signal');
xlabel('time(t)');
ylabel('Amplitude');
%% Carrier Signal :
Ac = Am/h;
fc = 2000;
yc = Ac*cos(2*pi*fc*t);
subplot(4, 1, 2);
plot(t(1:10000), yc(1:10000));
title('Carrier Signal');
xlabel('time(t)');
ylabel('Amplitude');
%% Modulated Signal :
y = ammod(ym, fc, 100000, 0, Ac);
subplot(4, 1, 3);
plot(t(1:10000), y(1:10000));
title('Modulated Signal');
xlabel('time(t)');
ylabel('Amplitude');
%% Demodulated Signal :
z = amdemod(y, fc, 100000, 0, Ac);
subplot(4, 1, 4);
plot(t(1:10000), z(1:10000));
title('Demodulated Signal');
xlabel('time(t)');
ylabel('Amplitude');
ylim([-10, 10]);

22UEC411C-IPCC- PCS Lab


9 Manual
BEC, Bagalkote

OUTPUT:

22UEC411C-IPCC- PCS Lab


10 Manual
BEC, Bagalkote

4. Frequency Modulation and demodulation: Generation and display the relevant signals and
its spectrums

AIM: To write a MATLAB program to generate Frequency Modulation and demodulation and display
the relevant signals and its spectrums

clc;
clear all;
close
all;
t = 0:0.001:1; %upto 1000 samples
vm = input('Enter Amplitude (Message) =
'); vc = input('Enter Amplitude (Carrier) =
'); fM = input('Enter Message frequency =
'); fc = input('Enter Carrier frequency = ');
m = input('Enter Modulation Index = ');
msg = vm*sin(2*pi*fM*t);
subplot(3,1,1); %plotting message signal
plot(t,msg);
xlabel('Time');
ylabel('Amplitude');
title('Message ');

carrier = vc*sin(2*pi*fc*t);
subplot(3,1,2); %plotting carrier signal
plot(t,carrier);
xlabel('Time');
ylabel('Amplitude');
title('Carrier
Signal');

y = vc*sin(2*pi*fc*t+m.*cos(2*pi*fM*t));
subplot(3,1,3); %plotting FM (Frequency Modulated) signal
plot(t,y);
xlabel('Time');
ylabel('Amplitude');
title('FM Signal');

OUTPUT:

Sample MATLAB Input:


Enter Amplitude (Message) = 5
Enter Amplitude (Carrier) = 5
Enter Message frequency = 8
Enter Carrier frequency = 100
22UEC411C-IPCC- PCS Lab
11 Manual
BEC, Bagalkote

Enter Modulation Index = 10

22UEC411C-IPCC- PCS Lab


12 Manual
BEC, Bagalkote

22UEC411C-IPCC- PCS Lab


13 Manual
BEC, Bagalkote

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

AIM: To write a MATLAB program to generate Sampling and reconstruction of low pass
signals. Display the signals and its spectrum

% Sampling and Reconstruction of Low Pass Signals


clc;
clear all;
close
all;
% Parameters
Fs = 1000; % Sampling frequency (Hz)
T = 1/Fs; % Sampling period
duration = 1; % Duration of signal
(seconds) f_signal = 50; % Signal
frequency (Hz) A_signal = 1;
% Signal amplitude

% Time vector
t = 0:T:duration-T;

% Generate low-pass signal


x = A_signal * sin(2*pi*f_signal*t);

% Plot original signal and its spectrum


figure;

subplot(2, 2, 1);
plot(t, x, 'b', 'LineWidth', 2);
title('Original Signal');
xlabel('Time (s)');
ylabel('Amplitude');

% Compute and plot spectrum of original signal


X = fft(x);
frequencies = linspace(0, Fs, length(X));
subplot(2, 2, 2);
plot(frequencies, abs(X), 'b', 'LineWidth', 2);
title('Spectrum of Original Signal');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
xlim([0, Fs/2]);

% Sampling
Fs_new = 200; % New sampling frequency (Hz)
22UEC411C-IPCC- PCS Lab
14 Manual
BEC, Bagalkote

T_new = 1/Fs_new; % New sampling period

22UEC411C-IPCC- PCS Lab


15 Manual
BEC, Bagalkote

t_new = 0:T_new:duration-T_new;
x_sampled = A_signal * sin(2*pi*f_signal*t_new);

% Plot sampled signal and its spectrum


subplot(2, 2, 3);
stem(t_new, x_sampled, 'r', 'LineWidth', 2);
title('Sampled Signal');
xlabel('Time (s)');
ylabel('Amplitude');

% Compute and plot spectrum of sampled signal


X_sampled = fft(x_sampled);
frequencies_sampled = linspace(0, Fs_new, length(X_sampled));
subplot(2, 2, 4);
stem(frequencies_sampled, abs(X_sampled), 'r', 'LineWidth', 2);
title('Spectrum of Sampled Signal');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
xlim([0, Fs_new/2]);
% Adjust plot
grid on;

OUTPUT:

22UEC411C-IPCC- PCS Lab


16 Manual
BEC, Bagalkote

6. Time Division Multiplexing and demultiplexing

AIM: To write a MATLAB program to generate Time Division Multiplexing and


demultiplexing

x=0:0.5:4*pi
sig1=8*sin(x)
sig2=6*sin(x)
sig3=4*sin(x)
sig4=2*sin(x)
l=length(sig1)

subplot(4,4,1)
plot(sig1)
grid on
xlabel('Time')
ylabel('Amplitude')
title('Sinusoidal Signal')

subplot(4,4,2)
plot(sig2)
grid on
xlabel('Sequence')
ylabel('Amplitude')
title('Sinusoidal Signal2')
subplot(4,4,3)
plot(sig3)
grid on
xlabel('Sequence')
ylabel('Amplitude')
title('Sinusoidal Signal3')
subplot(4,4,4)
plot(sig4)
grid on
xlabel('Sequence')
ylabel('Amplitude')
title('Sinusoidal Signal4')

subplot(4,4,5)
stem(sig1)
grid on
xlabel('Time')
ylabel('Amplitude')
title('Sinusoidal Signal 1 sampled')

subplot(4,4,6)
stem(sig2)
grid on
xlabel('Time')
22UEC411C-IPCC- PCS Lab
17 Manual
BEC, Bagalkote

ylabel('Amplitude')
title('Sinusoidal Signal 2 sampled')

subplot(4,4,7)
stem(sig3)
grid on
xlabel('Time')
ylabel('Amplitude')
title('Sinusoidal Signal 3 sampled')

subplot(4,4,8)
stem(sig4)
grid on
xlabel('Time')
ylabel('Amplitude')
title('Sinusoidal Signal 4 sampled')

%Making both row vector to a matrix


l1=length(sig1)
l2=length(sig2)
l3=length(sig3)
l4=length(sig4)
for i=1:l1
sig(1,i)=sig1(i)
sig(2,i)=sig2(i)
sig(3,i)=sig3(i)
sig(4,i)=sig4(i)
end

tdmsig=reshape(sig,1,4*l1)

subplot(4,4,9)
stem(tdmsig)
xlabel('Time')
ylabel('Amplitude')
title('TDM signal')
%Demux
demux=reshape(tdmsig,4,l1)
for i=1:l1
sig5(i)=demux(1,i)
sig6(i)=demux(2,i)
sig7(i)=demux(3,i)
sig8(i)=demux(4,i)

end
subplot(4,4,10)
plot(sig5)
xlabel('Time')
ylabel('Amplitude')
22UEC411C-IPCC- PCS Lab
18 Manual
BEC, Bagalkote

title('Reconstructed sinusoidal signal 1')

subplot(4,4,11)
plot(sig6)
xlabel('Time')
ylabel('Amplitude')
title('Reconstructed sinusoidal signal 2')

subplot(4,4,12)
plot(sig7)
xlabel('Time')
ylabel('Amplitude')
title('Reconstructed sinusoidal signal 3')

subplot(4,4,13)
plot(sig8)
xlabel('Time')
ylabel('Amplitude')
title('Reconstructed sinusoidal signal 4')

22UEC411C-IPCC- PCS Lab


19 Manual
BEC, Bagalkote

7. PCM Illustration: Sampling, Quantization and Encoding

AIM: To write a MATLAB program to generate PCM Illustration: Sampling, Quantization and
Encoding

% PCM Illustration: Sampling, Quantization, and Encoding


% Parameters
Fs = 1000; % Sampling frequency (Hz)
T = 1/Fs; % Sampling period
t = 0:T:1-T; % Time vector for one second

% Analog signal (example: sine wave)


Analog_signal = sin(2*pi*5*t); % 5 Hz sine wave

% Plot analog signal


subplot(3,1,1);
plot(t, Analog_signal);
title('Analog Signal');
xlabel('Time (s)');
ylabel('Amplitude');

% Sampling
nSamples = 10; % Number of samples
sampled_signal = Analog_signal(1:nSamples); % Downsample

% Plot sampled signal


stem((0:(nSamples-1))*T, sampled_signal);
title('Sampled Signal');
xlabel('Time (s)');
ylabel('Amplitude');

% Quantization
nBits = 4; % Number of bits for quantization
quantized_signal = round(sampled_signal * (2^(nBits-1) -
1));

% Plot quantized signal


subplot(3,1,3);
stem((0:nSamples-1)*T, quantized_signal);
title('Quantized Signal');
xlabel('Time (s)');
ylabel('Quantization Levels');

% Encoding (converting to binary)


binary_signal = de2bi(quantized_signal, nBits, 'left-msb');

% Display encoded signal


disp('Encoded Signal (Binary):');
disp(binary_signal);

22UEC411C-IPCC- PCS Lab


20 Manual
BEC, Bagalkote

OUTPUT:

Encoded Signal (Binary):


0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 1
0 0 0 1
0 0 0 1
0 0 0 1
0 0 1 0
0 0 1 0
0 0 1 0

22UEC411C-IPCC- PCS Lab


21 Manual
BEC, Bagalkote

8. Generate a) NRZ, RZ and Raised cosine pulse, b) Generate and plot eye diagram

% MATLAB Program to Generate and Plot an NRZ Signal


% Define the binary data sequence
data = [1 0 1 1 0 0 1 0 1]; % Example binary sequence

% Parameters for the signal


bit_rate = 1; % bits per second
bit_duration = 1 / bit_rate; % duration of one bit in seconds
samples_per_bit = 100; % number of samples per bit

% Time vector for one bit


t_bit = linspace(0, bit_duration, samples_per_bit);

% Initialize the NRZ signal vector


nrz_signal = [];

% Generate the NRZ signal


for bit = data
if bit == 1
nrz_signal = [nrz_signal ones(1, samples_per_bit)];
else
nrz_signal = [nrz_signal zeros(1, samples_per_bit)];
end
end

% Time vector for the entire signal


t = linspace(0, bit_duration * length(data), length(nrz_signal));

% Plot the NRZ signal


figure;
plot(t, nrz_signal, 'LineWidth',
2); ylim([-0.5 1.5]);
xlabel('Time (s)');
ylabel('Amplitude');
title('NRZ Signal');
grid on;

22UEC411C-IPCC- PCS Lab


22 Manual
BEC, Bagalkote

OUTPUT:

% MATLAB Program to Generate and Plot an RZ Signal


% Define the binary data sequence
data = [1 0 1 1 0 0 1 0 1]; % Example binary sequence

% Parameters for the signal


bit_rate = 1; % bits per second
bit_duration = 1 / bit_rate; % duration of one bit in seconds
samples_per_bit = 100; % number of samples per bit
half_bit_samples = samples_per_bit / 2; % samples for half bit duration

% Time vector for one bit


t_bit = linspace(0, bit_duration, samples_per_bit);

% Initialize the RZ signal vector


rz_signal = [];

% Generate the RZ signal


for bit = data
if bit == 1
rz_signal = [rz_signal ones(1, half_bit_samples) zeros(1, half_bit_samples)];
else
rz_signal = [rz_signal zeros(1, samples_per_bit)];
end

22UEC411C-IPCC- PCS Lab


23 Manual
BEC, Bagalkote

end

% Time vector for the entire signal


t = linspace(0, bit_duration * length(data), length(rz_signal));

% Plot the RZ signal


figure;
plot(t, rz_signal, 'LineWidth',
2); ylim([-0.5 1.5]);
xlabel('Time (s)');
ylabel('Amplitude');
title('RZ Signal');
grid on;
OUTPUT:

22UEC411C-IPCC- PCS Lab


24 Manual
BEC, Bagalkote

% MATLAB Program to Generate and Plot a Raised Cosine Pulse

% Parameters
rolloff = 0.5; % Roll-off factor (0 <= rolloff <= 1)
symbol_rate = 1; % Symbol rate (symbols per second)
span = 6; % Number of symbol periods the pulse spans
samples_per_symbol = 100; % Number of samples per symbol

% Derived parameters
Fs = samples_per_symbol * symbol_rate; % Sampling frequency
Ts = 1 / symbol_rate; % Symbol duration

% Time vector
t = linspace(-span/2, span/2, span * samples_per_symbol);

% Raised Cosine Pulse Generation


raised_cosine_pulse = zeros(size(t));
for i = 1:length(t)
if abs(t(i)) == Ts / (2 * rolloff)
raised_cosine_pulse(i) = (pi/4) * sinc(1/(2*rolloff));
elseif abs(t(i)) < Ts / (2 * rolloff)
raised_cosine_pulse(i) = sinc(t(i) / Ts) * cos(pi * rolloff * t(i) / Ts) / (1 - (2 * rolloff *
t(i) / Ts)^2);
else
raised_cosine_pulse(i) = 0;
end
end

% Plot the Raised Cosine Pulse


figure;
plot(t, raised_cosine_pulse, 'LineWidth', 2);
xlabel('Time (s)');
ylabel('Amplitude');
title(['Raised Cosine Pulse (Roll-off Factor = ', num2str(rolloff), ')']);
grid on;

% Display the pulse properties


disp('Raised Cosine Pulse Parameters:');
disp(['Roll-off Factor: ',
num2str(rolloff)]);
disp(['Symbol Rate: ', num2str(symbol_rate), ' symbols/second']);
disp(['Span: ', num2str(span), ' symbol periods']);
disp(['Samples per Symbol: ', num2str(samples_per_symbol)]);

22UEC411C-IPCC- PCS Lab


25 Manual
BEC, Bagalkote

OUTPUT:

Raised Cosine Pulse Parameters:


Roll-off Factor: 0.5
Symbol Rate: 1
symbols/second Span: 6
symbol periods Samples per
Symbol: 100

22UEC411C-IPCC- PCS Lab


26 Manual
BEC, Bagalkote

b) Generate and plot eye diagrams

% Generate a random binary signal


data_length = 1000;
data = randi([0, 1], 1, data_length);

% Reshape the data into a matrix with desired number of samples per symbol
samples_per_symbol = 10;
num_symbols = data_length / samples_per_symbol;
eye_data = reshape(data, samples_per_symbol, num_symbols);

% Plot the eye diagram


figure;
plot(eye_data);
title('Eye Diagram');
xlabel('Sample');
ylabel('Amplitude');
grid on;

OUTPUT:

22UEC411C-IPCC- PCS Lab


27 Manual
BEC, Bagalkote

9. Generate the Probability density function of Gaussian distribution function

AIM: To write a MATLAB program to generate the Probability density function of Gaussian
distribution function

% Parameters
mu = 0; % Mean of the Gaussian distribution
sigma = 1; % Standard deviation of the Gaussian distribution

% Define range for x-axis


x = -5:0.1:5;

% Compute PDF
pdf = (1 / (sigma * sqrt(2 * pi))) * exp(-(x - mu).^2 / (2 * sigma^2));

% Plot PDF
figure;
plot(x, pdf, 'b', 'LineWidth', 2);
title('Probability Density Function of Gaussian Distribution');
xlabel('x');
ylabel('PDF');
grid on;

OUTPUT:

22UEC411C-IPCC- PCS Lab


28 Manual
BEC, Bagalkote

10. Display the signal and its spectrum of an audio signal

AIM: To write a MATLAB program to generate the signal and its spectrum of an audio signal

% Load audio file


audioFile = 'your_audio_file.wav'; % Change this to your audio file path
[y, Fs] = audioread(audioFile);

% Plot the time-domain


signal t = (0:length(y)-1) /
Fs; figure;
subplot(2, 1, 1);
plot(t, y);
title('Time-Domain Signal');
xlabel('Time (s)');
ylabel('Amplitude');

% Compute the spectrum


N = length(y);
Y = fft(y);
f = (0:N-1) * Fs / N;

% Plot the spectrum


subplot(2, 1, 2);
plot(f, abs(Y));
title('Frequency Spectrum');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
xlim([0, Fs/2]); % Display only positive frequencies

% You can also use the following line to display the spectrum in dB scale
% plot(f, 20*log10(abs(Y)));
% ylabel('Magnitude (dB)');

% Adjust plot
grid on;

22UEC411C-IPCC- PCS Lab


29 Manual
BEC, Bagalkote

OUTPUT:

22UEC411C-IPCC- PCS Lab


30 Manual

You might also like