pcs lab
pcs lab
pcs lab
Society's
K. L. E. INSTITUTE OF TECHNOLOGY, HUBBALLI-27
(AICTE approved, Affiliated to VTU and ISO 9001:2015 Certified Institute)
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
(NBA Accredited Program)
K.L.E.S.
Opposite Airport, Gokul, Hubballi-580 027. Dist.: Dharwad, Karnataka, India.
Phone: 0836-2232 664, 681 Fax: 0836-2330688, E-mail: hod_ece@kleit.ac.in, website: www.kleit.ac.in
Laboratory Manual
for
IV SEMESTER
Vision
Prepare professionals embodied with competence and values to meet the challenges in the field of
Electronics and Communication Engineering.
Mission
m1. Providing hands-on experience with state-of-the-art hardware and software infrastructure,
enhancing competency of committed faculty to meet the requirements of industry and research
institutions.
m2. Inculcating theoretical and practical foundations and design and development skills necessary for
lifelong learning.
m3. Organizing value addition courses and continuous industry-institute interactions for bridging the gap
between academia and industry.
m4. Imbibing human values and ethics to make them socially responsible professionals.
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.
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.
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.
5. 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.
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.
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.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the
engineering practice.
9. Individual and teamwork: Function effectively as an individual, and as a member or leader in diverse
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.
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 a team, to
manage projects and in multidisciplinary environments.
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.
PSO.1: Analyze, design, build and test analog, digital communication and embedded systems for given
specifications.
Pre-requisites:
i. Fundamentals of Analog Modulation Techniques
ii.Fundamentals of Digital Modulation Techniques
Course Outcomes-CO
1. Understand and analyse concepts of Analog Modulation schemes viz; AM, FM
2. Design and analyse the electronic circuits for AM and FM modulation and demodulation.
3. Understand the concepts of random variable and random process to model communication systems.
4. Understand and analyse the concepts of digitization of signals.
5. Evolve the concept of SNR in the presence of channel induced noise
CO-PO Mapping
PSO1
1 2 3 4 5 6 7 8 9 10 11 12
for
Conduct investigations of
Course Outcomes-CO
systems
Modern tool usage
complex problems
Life-long learning
Problem analysis
Communication
specifications.
embedded
Ethics
Overal 2 2 2 - 1 - - 2 3 3 - 1 3
Course Content
5 Sampling and reconstruction of low pass signals. Display the signals and its
spectrum.
8 Generate a)NRZ, RZ and Raised cosine pulse, b) Generate and plot eye diagram
Si. Title
No.
1 Basic Signals and Signal Graphing: a) unit Step, b) Rectangular, c) standard
triangle d) sinusoidal and e)Exponential signal.
Program:
a) Unit step
b) Rectangular
c) Standard Triangle
d) Sinusoidal
e) Exponential signal
Program:
% Define time vector
t = -1:0.01:1;
% Generate rectangular pulse
rect_pulse = rectpuls(t, 0.5); % Rectangular pulse with width 0.5
units
% Compute Fourier Transform
fft_pulse = fftshift(fft(rect_pulse));
frequencies = linspace(-1, 1, length(fft_pulse));
% Plotting
figure;
% Time Domain Plot
subplot(2,1,1);
plot(t, rect_pulse, 'b', 'LineWidth', 2);
title('Rectangular Pulse in Time Domain');
xlabel('Time');
ylabel('Amplitude');
grid on;
% Frequency Domain Plot
subplot(2,1,2);
plot(frequencies, abs(fft_pulse), 'r', 'LineWidth', 2);
title('Rectangular Pulse in Frequency Domain');
xlabel('Frequency');
ylabel('Magnitude');
grid on;
Result:
Program:
Fs = 1000; % Sampling frequency (Hz)
T = 1/Fs; % Sampling period
L = 1000; % Length of signal
t = (0:L-1)*T; % Time vector
Fc = 100; % Carrier frequency (Hz)
Am = 0.5; % Modulation depth (amplitude of modulating signal)
Fm = 10; % Modulating frequency (Hz)
% Carrier signal
c = sin(pi*Fc*t);
% Demodulation
s_demod = s .* c; % Demodulation by multiplying with carrier
% Plotting
figure;
subplot(4, 1, 2);
plot(t, c, 'r', 'LineWidth', 2);
title('Carrier Signal');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;
subplot(4, 1, 3);
plot(t, s, 'g', 'LineWidth', 2);
title('Modulated Signals');
xlabel('Time (s)');
Dept. ECE, KLEIT Hubli 13
SEMESTER – IV (CBCS) and (OBE)
PCS LABORATORY (BEC402)
ylabel('Amplitude');
legend('Modulated Signal');
grid on;
subplot(4, 1, 4);
plot(t, s_demod, 'g', 'LineWidth', 2);
title('Demodulated Signals');
xlabel('Time (s)');
ylabel('Amplitude');
legend( 'Demodulated Signal');
Result:
Program:
fs=10000;
ac=1;
am=1;
fm=35;
fc=500;
b=5;
t=(0:0.1*fs)/fs;
wc=2*pi*fc;
wm=2*pi*fm;
mt=am*cos(wm*t);
subplot(4,1,1);
plot(t,mt);
title('modulating signal');
ct=ac*cos(wc*t);
subplot(4,1,2);
plot(t,ct);
title('carrier signal');
st=ac*cos((wc*t)+b*sin(wm*t));
subplot(4,1,3);
hold on;
plot(t,st);
plot(t,mt,'r');
hold off;
title('modulated signal');
d=demod(st,fc,fs,'fm');
subplot(4,1,4);
plot(t,d);
title('demodulated signal');
Fs = 100;
%sampling frq
t = (0:2*Fs+1)/Fs;
Fc = 10; % Carrier frequency
%x = sin(2*pi*2*t); % message signal
Ac=1;
% spectrum of fm
%xfm=fmmod(x,Fc,Fs,10);
zfm = fft(st);
zfm = abs(zfm(1:length(zfm)/2+1));
frqfm = (0:length(zfm)-1)*Fs/length(zfm)/2;
figure(2);
Result:
Program:
% 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 perio
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)');
Result:
Program:
Result:
Program:
%PCM Encoding clc;
clear all; close all;
f=10;
fs=20*f; t=0:1/fs:1; a=2;
x=a*sin(2*pi*f*t); subplot(321); plot(t,x);
title('figure.1 analog signal');
x1=x+2;
subplot(322); plot(t,x1);
title('figure.2 amplitude shifted analog signal');
subplot(323); stem(t,x1);
title('figure.3 sampled analog signal');
q=round(x1); subplot(324); stem(t,q);
title('figure.4 Quantized signal');
enco=de2bi(q,'left-msb'); subplot(325); plot(t,enco);
title('figure.5 PCM encoded signal');
%PCM Decoding
deco=bi2de(enco,'left-msb');
deco=deco-2;
subplot(326); plot(t,deco);
title('figure.6 PCM decoded signal');
Result:
Program:
a)NRZ, RZ and Raised cosine pulse
Unipolar NRZ
clc;
clear all;
close all;
warning off;
n=input('enter the input sequence');
%n=[1,0,1,0];
% Mapping of bits to voltage levels 5v and 0v
for i=1:length(n)
if n(i)==1
m(i)=5;
else
m(i)=0;
end
end
% pulse shaping
i=1
t=0:0.01:length(n);
for j=1:length(t)
if t(j)<=i;
y(j)=m(i);
else
i=i+1;
end
end
% plotting pulse
plot(t,y,'r-');
axis([0 length(n) -5 5]);
grid on;
Polar NRZ
clc;
clear all;
close all;
warning off;
n=input('enter the input sequence');
%n=[1,0,1,0];
% Mapping of bits to voltage levels 5v and 0v
for i=1:length(n)
if n(i)==1
m(i)=5;
else
m(i)=-5;
end
end
% pulse shaping
i=1
t=0:0.01:length(n);
for j=1:length(t)
if t(j)<=i;
y(j)=m(i);
else
i=i+1;
end
end
% plotting pulse
plot(t,y,'r-');
axis([0 length(n) -5 5]);
grid on;
Unipolar RZ
Polar RZ
% Half Sinusoid
clc;
clear all; close all;
t = 0:0.01:2;
f=1;% Input Signal Frequency x=sin(2*pi*f*t);%
Generate Sine Wave subplot(211);
plot(t,x);
x(x<0) = 0; % Rectified Sine Wave
subplot(212);
plot(t,x);
Program:
% 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;
Result:
Program:
% 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
Result: