Lab Manual Ipcc Bec402 Principles of Communication Systems 22 05
Lab Manual Ipcc Bec402 Principles of Communication Systems 22 05
LAB MANUAL
FOR
IV SEMESTER B.E
Staff In-charge:
Radha G H,
Assistant Prof.
Dept. of Electronics &Communication Engineering,
SKIT, Bengaluru-90
Department of ECE
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 rectan
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
5. 13-14
spectrum.
10. Display the signal and its spectrum of an audio signal. 26-27
Department of ECE
SKIT, Bengaluru-90
1. Basic Signals and Signal Graphing: a) Unit Step, b) Rectangular, c) standard triangle d)
sinusoidal and e) Exponential signal.
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');
OUTPUT:
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');
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');
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');
OUTPUT:
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
% Time vector
t = 0:T:duration-T;
OUTPUT:
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
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]);
OUTPUT:
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:
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
% Time vector
t = 0:T:duration-T;
subplot(2, 2, 1);
plot(t, x, 'b', 'LineWidth', 2);
title('Original Signal');
xlabel('Time (s)');
ylabel('Amplitude');
% Sampling
Fs_new = 200; % New sampling frequency (Hz)
T_new = 1/Fs_new; % New sampling period
t_new = 0:T_new:duration-T_new;
x_sampled = A_signal * sin(2*pi*f_signal*t_new);
OUTPUT:
OUTPUT:
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
AIM: To write a MATLAB program to generate PCM Illustration: Sampling, Quantization and
Encoding
% Sampling
nSamples = 10; % Number of samples
sampled_signal = Analog_signal(1:nSamples); % Downsample
% Quantization
nBits = 4; % Number of bits for quantization
quantized_signal = round(sampled_signal * (2^(nBits-1) - 1));
OUTPUT:
8. Generate a) NRZ, RZ and Raised cosine pulse, b) Generate and plot eye diagram
OUTPUT:
end
% 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);
OUTPUT:
% 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);
OUTPUT:
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
% 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:
AIM: To write a MATLAB program to generate the signal and its spectrum of an audio signal
% 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;
OUTPUT: