Ipcc Lab Manual 2023
Ipcc Lab Manual 2023
Prepared by
1
Dr. Asha M, 2Dr.Raghavendra Y M & 3Nalina H D
1
Assistant Professor,2Associate Professor, 3Assistant Professor
Dept of ECE
GSSSIETW, Mysuru
VISION
"To foster professional level competence in all areas of Electronics and Communication
Engineering and to benchmark the Department as a centre for nurturing Women Engineers
in the Country"
MISSION
M1: To impart value based Technical education and training.
M4: To sensitize the Students regarding Social, Moral and Professional ethics.
PEO 2: To make the students capable of managing their profession based on existing as well
as new emerging technologies in the area of Electronics and Communication
Engineering.
1. Basic Signals and Signal Graphing: a) unit Step, b) Rectangular, c) standard triangle
d) sinusoidal and e) Exponential signal.
// Define the time vector
t = -5:0.01:5;
Sinusoidal wave
clc ;
close ;
clear ;
f =100;
Fs =44000; // s am pli n g f r e q u e n c y
t =0:1/ Fs :.02; // 2 c y c l e s o nl y
1|Page
PCS Lab manual
Exponential Wave
// Define the time vector and Assuming only positive time for exponential decay
t = 0:0.01:5;
// Define exponential signal function
function expo=exponential_signal(t, decay_constant, amplitude)
expo = amplitude * exp(-decay_constant * t);
endfunction
• decay_constant = 0.5; and amplitude = 1; specify the decay constant and amplitude of the
exponential signal. You can adjust these parameters based on your requirements.
• plot(t, expo_signal, 'm', 'LineWidth', 2) plots the exponential decay signal (expo_signal)
against time (t) using a magenta ('m') solid line with a line width of 2. Axes labels (xlabel,
ylabel) and a title (title) are added to the plot, and the grid is turned on (grid on) for better
visualization
• Open SciLab.
• Copy and paste the above script into the SciLab console.
• Execute the script.
• The plot window will display the exponential decay signal with the specified decay constant
and amplitude over the time range from 0 to 5 seconds.
modify the decay_constant and amplitude parameters to generate different exponential decay
signals. Adjust the time range (t) and step size (0.01) to change the resolution and duration of the
plot according to your requirements. This example demonstrates how to define and plot an
exponential decay signal using SciLab.
3|Page
PCS Lab manual
Square wave
clc;
clear;
close;
f =100;
Fs =44000; // s am pli n g f r e q u e n c y
t =0:1/ Fs :.02; // 2 c y c l e s o nl y
4|Page
PCS Lab manual
5|Page
PCS Lab manual
// C a r r i e r S i g n a l g e n e r a t i o n
carrier=ac* cos (2* %pi* fc* t);
subplot (3,2,2);
plot(t, carrier);
xlabel('time');
ylabel('amplitude');
title('carrier signal');
ka =1/ac;
u=ka* am;
disp(u,'the modulation index is');
// Amplitude Modulation Ge n e ra t io n
am_mod =(1+ ka .* msg).* carrier;
subplot (3,2,3);
plot(t,am_mod);
xlabel('time');
ylabel('amplitude');
title('amplitude modulated signal');
// Frqeuncy Spectrum
d=(- p /2:1: p /2 -1) *1/3; // In d e xin g
subplot (3,2,4);
plot(d, abs(fftshift( fft( am_mod ))));// FOURIER TRANSFORM OF MODULATED SIGNAL
xlabel('time');
ylabel('amplitude');
title('AM signal spectrum');
// Demodulation o f AM S i g n a l
demod = am_mod .* carrier;
6|Page
PCS Lab manual
Output
enter the message signal amplitude=2
enter the carrier signal amplitude(ac>am)=5
The modulation index is 0.4
7|Page
PCS Lab manual
// C a r r i e r Signalgeneration
carrier=ac* cos (2* %pi* fc* t);
subplot (4,1,2);
plot(t, carrier);
xlabel('time');
ylabel('amplitude');
title('carrier signal');
kf =4;
mod_index =( kf* am)/ fm;
disp(mod_index,'the modulation index is');
// Amplitude Modulation Ge n e ra t io n
fm_mod =ac* cos ((2* %pi* fc* t) +( mod_index .* sin (2* %pi* fm* t)));
subplot (4,1,3);
plot(t,fm_mod);
xlabel('time');
ylabel('amplitude');
title('frequency modulated signal');
// Frqeuncy Spectrum
d=(- p /2:1: p /2 -1) *1/3; // In d e xin g
subplot (4,1,4);
plot(d, abs(fftshift( fft( fm_mod ))));// FOURIER TRANSFORM OF MODULATED SIGNAL
xlabel('frequency');
ylabel('amplitude');
title('fm signal spectrum');
OUTPUT:
enter the message signal frequency=5
enter the carrier signal frequency(fc>>>fm)=20
8|Page
PCS Lab manual
enter the message signal amplitude=4
enter the carrier signal amplitude=5
The modulation index is= 3.2
9|Page
PCS Lab manual
5.Sampling and reconstruction of low pass signals. Display the signals and its spectrum.
clc;
clear all;
close all;
tfinal=0.05;
t=0:0.00005:tfinal;
fd=input('Enter analog frequency=');
xt=cos(2*%pi*fd*t);
10 | P a g e
PCS Lab manual
11 | P a g e
PCS Lab manual
Let's create a SciLab program to demonstrate Time Division Multiplexing and Demultiplexing using a
simple example with two signals.In this program:
• We define a time vector t ranging from 0 to 10 seconds with a step size of 0.01 seconds.
• Two example signals (signal1 and signal2) are created as a sine wave and a cosine wave,
respectively.
• The Time Division Multiplexing (TDM) operation combines signal1 and signal2 into a single
TDM signal (tdm_signal).
// Define the time vector and signals
t = 0:0.01:10; // Time vector
//Define signals
signal1 = 2 * sin(2 * %pi * 1 * t); // Example signal 1 (sine wave)
signal2 = 3 * cos(2 * %pi * 2 * t); // Example signal 2 (cosine wave)
signal3 = 3 * cos(2 * %pi * 3 * t); // Example signal 2 (cosine wave)
subplot(4, 1, 2)
plot(t, signal2, 'r', 'LineWidth', 2)
title('Signal 2 (Cosine Wave)')
xlabel('Time')
ylabel('Amplitude')
//grid on
subplot(4, 1, 3)
plot(t, signal3, 'r', 'LineWidth', 2)
title('Signal 3 (Cosine Wave)')
xlabel('Time')
ylabel('Amplitude')
//grid on
subplot(4, 1, 4)
plot(t, tdm_signal, 'g', 'LineWidth', 2)
title('TDM Signal (Multiplexed)')
xlabel('Time')
12 | P a g e
PCS Lab manual
ylabel('Amplitude')
//grid on
// Demultiplexing function
function [demux_signal1, demux_signal2, demux_signal3]=time_demultiplex(tdm_signal,
signal_length)
demux_signal1 = tdm_signal .* sin(2 * %pi * 1 * tdm_signal) / signal_length;
demux_signal2 = tdm_signal .* cos(2 * %pi * 2 * tdm_signal) / signal_length;
demux_signal3 = tdm_signal .* cos(2 * %pi * 3 * tdm_signal) / signal_length;
endfunction
subplot(3, 1, 2)
plot(t, demux_signal2, 'r', 'LineWidth', 2)
title('Demultiplexed Signal 2 (Recovered Cosine Wave)')
xlabel('Time')
ylabel('Amplitude')
//grid on
subplot(3, 1, 3)
plot(t, demux_signal3, 'y', 'LineWidth', 2)
title('Demultiplexed Signal 3 (Recovered Cosine Wave)')
xlabel('Time')
ylabel('Amplitude')
//grid on
• Open SciLab
• Copy and paste the Time Division Multiplexing (TDM) program into the SciLab console and execute it.
• Copy and paste the Time Division Demultiplexing (TDD) program into the SciLab console and execute it
after running the TDM program.
13 | P a g e
PCS Lab manual
• The first set of plots will show the original signals (signal1 and signal2) and the combined TDM signal
(tdm_signal
The second set of plots will show the demultiplexed signals (demux_signal1 and demux_signal2),
which should ideally resemble the original sine wave and cosine wave.
modify the example signals (signal1 and signal2), time vector (t), and the TDM/Demultiplexing
functions to experiment with different scenarios and understand the concept of Time Division
Multiplexing and Demultiplexing using SciLab.
14 | P a g e
PCS Lab manual
• The generate_nrz function takes a binary sequence (binary_sequence), bit duration (bit_duration),
and amplitude (amplitude) as inputs.
• The function iterates through each bit in the binary_sequence and generates the corresponding NRZ
signal. A logical 1 is represented by a positive pulse (+1 for bit_duration samples), and a logical
0 is represented by a negative pulse (-1 for bit_duration samples.
• The resulting NRZ signal is scaled by the specified amplitude.
• We then define a time vector t that spans the entire duration of the binary sequence, calculated as 0
to (length(binary_sequence) * bit_duration) - 1 samples.
• Finally, we plot the NRZ signal waveform (nrz_signal) against time (t)
• Open SciLab
• Copy and paste the above script into the SciLab console
• Execute the script
• The plot window will display the NRZ line code waveform based on the provided binary sequence
(binary_sequence), bit duration (bit_duration), and amplitude (amplitude).
• modify the binary_sequence, bit_duration, and amplitude parameters in the script to generate
different NRZ waveforms and observe their characteristics. This example demonstrates how to
generate and plot an NRZ line code waveform using SciLab.
15 | P a g e
PCS Lab manual
// Define parameters
bit_duration = 100; // Duration of each bit (in samples)
amplitude = 1; // Amplitude of the RZ signal
// Define a binary sequence (example)
binary_sequence = [1 0 1 0 1 1 0 0 1];
16 | P a g e
PCS Lab manual
For each bit in the binary_sequence, the function generates a pulse waveform (pulse) based on the bit
value (1 or 0). A logical 1 is represented by a positive pulse (positive values followed by zeros), and a
logical 0 is represented by a negative pulse (negative values followed by zeros).
The resulting RZ signal is constructed by concatenating these pulse waveforms ( pulse) for each bit in
the sequence.
The entire RZ signal is then scaled by the specified amplitude
We define a time vector t that spans the entire duration of the binary sequence, calculated as 0 to
(length(binary_sequence) * bit_duration) - 1 samples.
17 | P a g e
PCS Lab manual
To generate and plot a Raised Cosine Pulse (RCP) waveform using SciLab, we'll define a function to generate
the RCP signal based on specified parameters such as the roll-off factor (alpha) and pulse duration ( T). We'll
then plot the waveform to visualize its shape. Below is a complete SciLab script that demonstrates this:
The generate_rcp function takes a time vector t, roll-off factor alpha, and pulse duration T as inputs.
Inside the function, the RCP signal is computed using the formula.
This represents the shape of the Raised Cosine Pulse (RCP) waveform.
The rcp_signal is truncated outside the pulse duration (-T to T) by setting values to zero where |t| >
T/(2*alph).
We define a time vector t that covers the range from -T to T with a suitable number of samples (e.g.,
1000 samples) to capture the pulse waveform.
The Raised Cosine Pulse (RCP) signal (rcp_signal) is generated based on the specified parameters
(alpha and T).
Finally, we plot the RCP waveform (rcp_signal) against time (t) to visualize the shape of the pulse.
• Open SciLab
• Copy and paste the above script into the SciLab console and Execute the script .
• The plot window will display the Raised Cosine Pulse (RCP) waveform based on the specified
roll-off factor (alpha) and pulse duration (T).
• Adjust the parameters (alpha and T) in the script to generate different shapes of the
Raised Cosine Pulse (RCP) waveform and observe their characteristics. This example
demonstrates how to generate and plot a Raised Cosine Pulse (RCP) waveform using SciLab.
18 | P a g e
INSTITUTION VISION & MISSION
Vision
"To become a recognized world class Women Educational Institution, by
imparting professional education to the students, creating technical
opportunities through academic excellence and technical achievements,with
ethical values"
Mission
• To support value based education with state of art infrastructure.
•To empower women with the additional skill for professional future career.
• To enrich students with research blends in order to fulfill the International
Challenges.
•To create multidisciplinary center of excellence.
• To achieve Accreditation standards towards International education
recognition.
•To establish more Post Graduate & Research course.
• To increase Doctorates numbers towards the Research quality of academics.