0% found this document useful (0 votes)
439 views34 pages

Lab Manual - IPCC - BEC402 - PRINCIPLES OF COMMUNICATION SYSTEMS

The document is a lab manual for the course 'Principles of Communication Systems - BEC402' at Jawaharlal Nehru New College of Engineering, detailing the vision, mission, program objectives, and outcomes for the Electronics and Telecommunication Engineering department. It outlines the course structure, including practical experiments, assessment methods, and learning resources. The manual emphasizes the importance of both theoretical knowledge and practical skills in communication systems, aiming to prepare students for professional growth and societal contributions.
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)
439 views34 pages

Lab Manual - IPCC - BEC402 - PRINCIPLES OF COMMUNICATION SYSTEMS

The document is a lab manual for the course 'Principles of Communication Systems - BEC402' at Jawaharlal Nehru New College of Engineering, detailing the vision, mission, program objectives, and outcomes for the Electronics and Telecommunication Engineering department. It outlines the course structure, including practical experiments, assessment methods, and learning resources. The manual emphasizes the importance of both theoretical knowledge and practical skills in communication systems, aiming to prepare students for professional growth and societal contributions.
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/ 34

IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS- BEC402

PRINCIPLES OF COMMUNICATION SYSTEMS- BEC402

LAB MANUAL
FOR
IV SEMESTER B.E

VISHVESHWARAIAH TECHNOLOGICAL UNIVERSITY, BELAGAVI

DEPARTMENT OF ELECTRONICS AND TELECOMMUNICATION


ENGINEERING

JAWAHARLAL NEHRU NEW COLLEGE OF


ENGINEERING,
SHIVAMOGGA-577204

Staff In-charge:

1. Rashmi M Hullamani, Assistant Prof.


2. Nuthan Kumara M U, Assistant Instructor

Department of Electronics and Telecommunication Engineering,


JAWAHARLAL NEHRU NEW COLLEGE OF ENGINEERING,
SHIVAMOGGA-577204
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS- BEC402

Vision:
To emerge as a center of academic excellence in the field of Telecommunication Engineering
to impart quality education by keeping pace with rapidly changing technologies and industry
requirements to create technical manpower of global standard for the betterment of industry and
society.

Mission:
1. Impart knowledge and skills required for the latest and advanced engineering & technological
processes in the field of Telecommunication.
2. Instil creative thinking through innovative and team-based methods to develop employability,
entrepreneurial traits and research capability among the students.
3. Provide value-based technical education empowering the students with ethical and humane values
addressing the needs of industries and the society.

Program Educational Objectives (PEOs):


The Graduates will be able to:
PEO1: Establish themselves as practicing professionals with required skills and will have
professional growth in telecommunication and allied domain.
PEO2: Exhibit their innovative, technical and research potential to take up current industry and
societal challenges.
PEO3: Pursue higher studies and engage themselves in life-long learning imbibing ethical principles
to contribute to society with a global outlook.

Program Specific Outcomes (PSOs):


Engineering Graduates will be able to:
PSO1: Understand and develop analog and digital telecommunication systems and determine their
performance.
PSO2: Design, build and test analog, digital and embedded systems according to specifications.

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 Telecommunication Engineering,
JAWAHARLAL NEHRU NEW COLLEGE OF ENGINEERING,
SHIVAMOGGA-577204
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS- BEC402

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 Telecommunication Engineering,


JAWAHARLAL NEHRU NEW COLLEGE OF ENGINEERING,
SHIVAMOGGA-577204
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS- BEC402

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

PRINCIPLES OF COMMUNICATION SYSTEMS Semester 4


Course Code BEC402 CIE Marks 50
Teaching Hours/Week (L:T:P: S) 3:0:2:0 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 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

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 its
4.
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 Telecommunication Engineering,


JAWAHARLAL NEHRU NEW COLLEGE OF ENGINEERING,
SHIVAMOGGA-577204
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS- BEC402

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.
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 Telecommunication Engineering,


JAWAHARLAL NEHRU NEW COLLEGE OF ENGINEERING,
SHIVAMOGGA-577204
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS- BEC402

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 https://nptel.ac.in/courses/108104091
2. Communication Engineering https://nptel.ac.in/courses/117102059
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 Telecommunication Engineering,


JAWAHARLAL NEHRU NEW COLLEGE OF ENGINEERING,
SHIVAMOGGA-577204
IPCC- PRINCIPLES OF COMMUNICATION SYSTEMS- BEC402

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 rectangular
2. 7-8
pulse.
Amplitude Modulation and demodulation: Generation and display the
3. 9-10
relevant signals and its spectrums.
Frequency Modulation and demodulation: Generation and display the relevant 11-12
4.
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 Telecommunication Engineering,


JAWAHARLAL NEHRU NEW COLLEGE OF ENGINEERING,
SHIVAMOGGA-577204
Jawaharlal Nehru New College of Engineering, Shimoga -577204

PRINCIPLES OF COMMUNICATION SYSTEMS- BEC402

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');

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 1
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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;

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 2
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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');

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 3
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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');

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 4
Jawaharlal Nehru New College of Engineering, Shimoga -577204

OUTPUT:

% e) Exponential Function%
clc;
clear all;
close all;
n=50;
s=0:1: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');

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 5
Jawaharlal Nehru New College of Engineering, Shimoga -577204

OUTPUT:

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 6
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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;

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 7
Jawaharlal Nehru New College of Engineering, Shimoga -577204

OUTPUT:

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 8
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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]);

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 9
Jawaharlal Nehru New College of Engineering, Shimoga -577204

OUTPUT:

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 10
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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
Enter Modulation Index = 10

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 11
Jawaharlal Nehru New College of Engineering, Shimoga -577204

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 12
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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)
T_new = 1/Fs_new; % New sampling period

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 13
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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:

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 14
Jawaharlal Nehru New College of Engineering, Shimoga -577204

6. Time Division Multiplexing and demultiplexing

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


demultiplexing

% Number of signals to multiplex


numSignals = 3;

% Number of time slots


numSlots = 10;

% Generate random data for each signal


data = cell(1, numSignals);
for i = 1:numSignals
data{i} = randi([0, 100], 1, numSlots); % Generate random data for each signal
end

% Multiplexing (combining signals into one)


TDM_signal = zeros(1, numSlots*numSignals);
for i = 1:numSignals
TDM_signal((i-1)*numSlots+1:i*numSlots) = data{i};
end

% Display multiplexed signal


disp('Multiplexed Signal (TDM):');
disp(TDM_signal);

% Demultiplexing (separating signals)


demux_data = cell(1, numSignals);
for i = 1:numSignals
demux_data{i} = TDM_signal(i:numSignals:end); % Extract every nth element
end

% Display demultiplexed signals


for i = 1:numSignals
fprintf('Demultiplexed Signal %d:\n', i);
disp(demux_data{i});
end

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 15
Jawaharlal Nehru New College of Engineering, Shimoga -577204

OUTPUT:

Multiplexed Signal (TDM):

Columns 1 through 20
10 97 0 78 82 87 8 40 26 80 43 91 18 26 14 13 87 58 55 14

Columns 21 through 30
86 62 35 51 40 7 24 12 18 24

Demultiplexed Signal 1:
10 78 8 80 18 13 55 62 40 12

Demultiplexed Signal 2:
97 82 40 43 26 87 14 35 7 18

Demultiplexed Signal 3:
0 87 26 91 14 58 86 51 24 24

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 16
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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);

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 17
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 18
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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;

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 19
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 20
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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:

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 21
Jawaharlal Nehru New College of Engineering, Shimoga -577204

% 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)]);

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 22
Jawaharlal Nehru New College of Engineering, Shimoga -577204

OUTPUT:

Raised Cosine Pulse Parameters:


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

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 23
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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:

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 24
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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:

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 25
Jawaharlal Nehru New College of Engineering, Shimoga -577204

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;

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 26
Jawaharlal Nehru New College of Engineering, Shimoga -577204

OUTPUT:

Rashmi M Hullamani, Assistant Professor BEC402-IPCC- PCS Lab Manual


Department of E&TE 27

You might also like