Ec3461 - Communication System Lab Manual
Ec3461 - Communication System Lab Manual
ANNE’S
COLLEGE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, New Delhi. Affiliated to Anna University, Chennai)
Accredited by NAAC
ANGUCHETTYPALAYAM, PANRUTI – 607 106.
OBSERVATION NOTE
NAME : _________________________________________________________
REGISTER NO : _________________________________________________________
SYLLABUS
COURSE OBJECTIVES:
❖ To study the AM & FM Modulation and Demodulation.
❖ To learn and realize the effects of sampling and TDM.
❖ To understand the PCM & Digital Modulation.
❖ To Simulate Digital Modulation Schemes.
❖ To Implement Equalization Algorithms and Error Control Coding Schemes.
LIST OF EXPERIMENTS
OUTCOMES:
CO1: Design AM, FM & Digital Modulators for specific applications.
CO2: Compute the sampling frequency for digital modulation.
CO3: Simulate & validate the various functional modules of Communication system.
CO4: Demonstrate their knowledge in base band signaling schemes through
implementation of digital modulation schemes.
CO5: Apply various channel coding schemes & demonstrate their capabilities towards the
improvement of the noise performance of Communication system.
LIST OF EXPERIMENTS
EXP NO:
AM- Modulator and Demodulator
DATE
AIM:
To study and analyze the Amplitude Modulation (AM) and Demodulation process using the
AM Transmitter & Receiver Trainer Kit, and to observe the modulated and demodulated signals.
APPARATUS REQUIRED:
THEORY:
AM Modulation:
• Modulation Principle: The message signal m(t) is superimposed on a carrier signal c(t) by
varying its amplitude.
where:
• Types of AM:
o Double-Sideband Full Carrier (DSB-FC) – The carrier and both sidebands are
transmitted.
Demodulation is the process of recovering the original message signal from the modulated AM
signal. The VI Microsystems Trainer Kit provides hardware components for AM detection using:
• Coherent Detection: Uses a synchronized carrier signal to extract the original message
signal.
TABULATION:
TRANSMITTER
RECEIVER:
PROCEDURE:
𝐸𝑚𝑎𝑥 − 𝐸𝑚𝑖𝑛
Modulation Index =
𝐸𝑚𝑎𝑥 + 𝐸𝑚𝑖𝑛
RESULT:
EXP NO:
FM- Modulator and Demodulator
DATE
AIM:
To study and analyze the Frequency Modulation (FM) and Demodulation process using the
FM Transmitter & Receiver Kit and to observe the modulated and demodulated signals.
APPARATUS REQUIRED:
THEORY:
Frequency Modulation (FM) is a modulation technique in which the frequency of the carrier signal
is varied in accordance with the instantaneous amplitude of the message signal while keeping its
amplitude constant. FM is widely used in radio broadcasting, communication systems, and radar
applications.
• Modulation Principle: The frequency of the carrier signal is varied based on the amplitude
of the message signal.
where:
o A is the carrier amplitude,
o fc is the carrier frequency,
o kf is the frequency sensitivity,
o m(t) is the message signal,
o s(t) is the modulated signal.
• Types of FM:
Demodulation is the process of retrieving the original message signal from the FM signal. The VI
Microsystems Trainer Kit includes components for FM demodulation using:
• Slope Detector: Converts frequency variations into amplitude variations, which are then
detected using an envelope detector.
• Phase-Locked Loop (PLL): A feedback system that locks onto the carrier frequency and
extracts the message signal.
TABULATION:
TRANSMITTER
RECEIVER:
PROCEDURE:
RESULT:
EXP NO:
SIGNAL SAMPLING AND RECONSTRUCTION
DATE
AIM:
To study and analyze the process of signal sampling and reconstruction, including natural
sampling, flat-top sampling, and sample-and-hold techniques, using Analog signal sampler kit.
APPARATUS REQUIRED:
THEORY:
Sampling is the process of converting a continuous-time signal into a discrete-time signal by taking
periodic samples of the signal at a fixed rate. The Nyquist theorem states that a signal can be
completely reconstructed if it is sampled at a rate at least twice the highest frequency present in the
signal.
A. Natural Sampling
• In natural sampling, the message signal is multiplied by a periodic pulse train, but the
amplitude of the samples follows the original signal's variations.
• This technique retains the shape of the original waveform within each pulse duration.
B. Flat-Top Sampling
• In flat-top sampling, the samples are held at a constant amplitude for the duration of the
sampling pulse.
• This introduces a distortion called aperture effect, which can be minimized using
appropriate reconstruction filters.
• Mathematical Representation: for in the pulse duration, where represents the discrete
sampling instances.
C. Sample-and-Hold Technique
• This method holds each sample for a fixed duration before updating to the next sample.
2. Signal Reconstruction
• Reconstruction is the process of recovering the original continuous signal from its discrete
samples.
• The ideal reconstruction filter is a sinc function, but practical filters such as Butterworth or
Chebyshev filters are used in real applications.
PROCEDURE:
TABULATION:
TRANSMITTER
RECEIVER:
RESULT:
EXP NO:
TIME DIVISION MULTIPLEXING (TDM)
DATE
AIM:
To study and understand the working of Time Division Multiplexing (TDM) using a TDM
kit
APPARATUS REQUIRED:
THEORY:
Time Division Multiplexing (TDM) is a digital multiplexing technique in which multiple signals
share the same transmission channel by dividing the time into discrete time slots. Each signal is
assigned a specific time slot, ensuring that multiple signals can be transmitted over the same
medium without interference.
Types of TDM
Synchronous TDM
• Each source is assigned a fixed time slot, even if it has no data to transmit.
• Time slots are pre-determined and occur at regular intervals.
• Used in digital telephony (e.g., T1 and E1 lines).
PROCEDURE:
2. Four different frequency message signals are given as input to the TDM amplitude.
3. The multiplexed waveform obtained is viewed in the CRO.
TABULATION:
Receiver section:
Sine wave (250 Hz)
Sine wave (500 Hz)
Sine wave (1K Hz)
Sine wave (2 KHz)
RESULT:
EXP NO:
Pulse Code Modulation and Demodulation
DATE
AIM:
To obtain the PCM – Modulated and Demodulated signal for given message signal..
APPARATUS REQUIRED:
THEORY:
In PCM, a message signal is represented by the sequence of coded pulses. So the signal is discrete
in both time and amplitude.
(i) Sampling
(ii) Quantizing
(iii) Encoding
The incoming message signal is sampled with a train of rectangular pulses. To ensure perfect
reconstruction at the receiver, a sampling rate fs > 2w is used. The rounding off sampled signal is
called quantization. So that quantized signal is discrete in both time and amplitude. Then, the
quantized signal is translated into a more appropriate form of code format by encoding. In the
channel regenerators are used to increase the immunity of signal against noise. The receiver has to
regenerate, reshape the received pulses, and then regroup them into a recovered signal
PROCEDURE:
TABULATION:
MODULATION
DEMODULATION:
RESULT:
EXP NO:
PULSE AMPLITUDE MODULATION
DATE
AIM:
To study and understand the working of Pulse Amplitude Modulation (PAM) using a PAM kit
APPARATUS REQUIRED:
THEORY:
Pulse Amplitude Modulation (PAM) is a modulation technique where the amplitude of a series of
pulses varies according to the instantaneous value of the modulating signal. There are two main
types of sampling methods used in PAM:
1. Natural Sampling
o In natural sampling, the pulses follow the shape of the original modulating signal
during the sampling period.
o The top of the pulses is not flat, meaning they retain the continuous variations of the
signal during sampling.
o This type of sampling reduces distortion but makes demodulation more complex.
2. Flat-Top Sampling
o In flat-top sampling, the amplitude of each pulse is held constant at the value of the
modulating signal at the instant of sampling.
o The sampled pulses have a flat top, eliminating variations within the sampling
interval.
o This technique simplifies demodulation but introduces aperture distortion due to the
holding process.
PROCEDURE:
5. Readings are taken for message, carrier and pulse amplitude modulated wave.
6. The modulated wave is given as input to demodulator
TABULATION:
MODULATION
DEMODULATION
RESULT:
BLOCK DIAGRAM
EXP NO:
PULSE POSITION MODULATION
DATE
AIM:
To study and understand the working of Pulse Position Modulation (PPM) using a PPM
kit
APPARATUS REQUIRED:
THEORY:
Pulse Position Modulation (PPM) is a type of pulse modulation where the position of a pulse is
varied according to the amplitude of the modulating signal, while the width and amplitude of the
pulse remain constant.
Working Principle
• The modulating signal is sampled, and its amplitude is mapped to a time delay in pulse
position.
• The carrier pulses are transmitted at varying positions based on the input signal's amplitude.
PROCEDURE:
5. Readings are taken for message, carrier and pulse position modulated wave.
6. The modulated wave is given as input to demodulator
TABULATION:
MODULATION
DEMODULATION
RESULT:
EXP NO:
PULSE WIDTH MODULATION
DATE
AIM:
To study and understand the working of Pulse Width Modulation (PWM) using a PWM kit
APPARATUS REQUIRED:
3 Probe Few
4 Patch cord Few
THEORY:
Pulse Width Modulation (PWM) is a modulation technique where the width (or duration) of pulses
in a periodic pulse train is varied in proportion to the instantaneous amplitude of the modulating
signal. The frequency and amplitude of the pulses remain constant, but the duty cycle changes
according to the input signal.
Working Principle
• The width of each pulse is adjusted based on the amplitude of the modulating signal at that
instant.
• The resulting PWM signal is transmitted and later demodulated to reconstruct the original
signal
MODEL GRAPH:
PROCEDURE:
TABULATION:
MODULATION
DEMODULATION
RESULT:
BLOCK DIAGRAM:
ASK MODULATION
OSCILLATOR
(Sine Wave)
ASK MODULATOR
DATA INPUT
(Square Wave)
ASK DEMODULATION
ASK Output
ASK Modulated Output
ASK DEMODULATOR
EXP NO:
AMPLITUDE SHIFT KEYING
DATE
AIM:
To construct and generate an Amplitude Shift Keying signal and detect the message signal.
APPARATUS REQUIRED:
3 Probe Few
4 Patch cord Few
THEORY:
Amplitude Shift Keying (ASK) is one of the fundamental digital modulation techniques used in
communication systems. It involves the modulation of a carrier signal's amplitude based on the
digital data being transmitted. The amplitude of the carrier varies while the frequency and phase
remain constant. This technique is widely used in various applications such as optical fiber
communication, radio frequency (RF) transmission, and low-data-rate wireless communication.
ASK is a form of amplitude modulation (AM) where the amplitude of a high-frequency carrier
wave is changed in response to digital data. The simplest form of ASK is Binary Amplitude Shift
Keying (BASK), where the carrier signal is either present or absent, corresponding to binary values
‘1’ and ‘0’ respectively. Mathematically, the ASK signal can be represented as:
MODEL GRAPH:
PROCEDURE:
TABULATION:
MODULATION
DEMODULATION
RESULT:
BLOCK DIAGRAM:
FSK MODULATION
OSCILLATOR
(Sine Wave)
FSK MODULATOR
DATA INPUT
(Square Wave)
FSK DEMODULATION
FSK Output
FSK Modulated Output FSK DEMODULATOR
(PLL)
EXP NO:
FREQUENCY SHIFT KEYING
DATE
AIM:
To construct and generate a Frequency Shift Keying signal and detect the message signal.
APPARATUS REQUIRED:
3 Probe Few
4 Patch cord Few
THEORY:
Frequency Shift Keying (FSK) is one of the most fundamental digital modulation techniques used
in communication systems. It involves shifting the frequency of a carrier wave to transmit digital
data. Unlike Amplitude Shift Keying (ASK), which varies the amplitude, or Phase Shift Keying
(PSK), which varies the phase, FSK modifies the frequency of the carrier to represent binary data.
FSK is widely used in applications such as radio transmission, telemetry, fax machines, RFID
systems, and Bluetooth technology. Its resistance to noise and ability to perform well in various
communication environments make it a popular choice in digital communication.
FSK encodes data by shifting the frequency of a carrier signal between two or more distinct values.
The mathematical representation of an FSK-modulated signal is:
FSK encodes data by shifting the frequency of a carrier signal between two or more distinct values.
The mathematical representation of an FSK-modulated signal is:
S(t)= AcCos(2πft)
where:
• Ac is the carrier amplitude (constant),
• f is the instantaneous frequency that changes according to the input data,
• t represents time.
MODEL GRAPH:
PROCEDURE:
TABULATION:
MODULATION
DEMODULATION
RESULT:
BLOCK DIAGRAM:
PSK MODULATION
Carrier Input
(Sine Wave)
Modulating INPUT
(Square Wave)
PSK DEMODULATION
PSK Output
PSK Modulated Output PSK DEMODULATOR
(PLL)
EXP NO:
PHASE SHIFT KEYING
DATE
AIM:
To construct and generate a Phase Shift Keying signal and detect the message signal.
APPARATUS REQUIRED:
3 Probe Few
4 Patch cord Few
THEORY:
Phase Shift Keying (PSK) is one of the most widely used digital modulation techniques in modern
communication systems. It involves varying the phase of a carrier signal to represent digital data.
Unlike Amplitude Shift Keying (ASK), which modifies the signal's amplitude, PSK maintains a
constant amplitude and changes only the phase. This makes PSK more resistant to noise and more
efficient for high-speed data transmission.
In PSK, the phase of the carrier wave is modified according to the digital data being transmitted.
The general mathematical representation of a PSK signal is:
S(t)= AcCos(2πft + Ø)
where:
• Ac is the carrier amplitude (constant),
• fc is the carrier frequency,
• Ø is the phase shift applied based on the input data,
• t represents time.
MODEL GRAPH:
PROCEDURE:
TABULATION:
MODULATION
DEMODULATION
RESULT:
EXP NO:
DELTA MODULATION AND DEMODULATION
DATE
AIM:
To obtain Delta Modulated and Demodulated signal for give message signal.
APPARATUS REQUIRED:
3 Probe Few
4 Patch cord Few
THEORY:
Delta modulation
Delta Modulation (DM) is a type of pulse-code modulation (PCM) that encodes an analog signal
into a digital format using a one-bit data stream. Instead of encoding the absolute amplitude of the
signal, DM encodes the difference between consecutive samples, making it a simpler and more
bandwidth-efficient method of digital transmission.
• At the receiver, a demodulator integrates the binary data to reconstruct the original
waveform.
• A low-pass filter smooths out the reconstructed signal to match the original input as closely
as possible.
MODEL GRAPH:
PROCEDURE:
TABULATION:
MODULATION
DEMODULATION
RESULT:
CIRCUIT DIAGRAM:
PRE- EMPHASIS:
DE- EMPHASIS:
EXP NO:
PRE –EMPHASIS AND DE-EMPHASIS
DATE
AIM:
To observe the effects of pre-emphasis & de-emphasis on given input signal
APPARATUS REQUIRED:
3 Probe Few
4 Patch cord Few
THEORY:
Pre-Emphasis and De-Emphasis are signal processing techniques used in communication systems
to improve signal-to-noise ratio (SNR) and reduce distortion, particularly in frequency modulation
(FM) and audio transmission.
Pre-Emphasis
De-Emphasis
MODEL GRAPH:
PROCEDURE:
TABULATION:
Pre-Emphasis
Frequency (Hz) I/p voltage (Vi) O/p voltage (Vo) Gain = 20log (Vo/Vi)
De-Emphasis
Frequency (Hz) I/p voltage (Vi) O/p voltage (Vo) Gain = 20log (Vo/Vi)
RESULT:
SIMULATION
EXPERIMENTS
EXP NO: Simulation of ASK, FSK, and BPSK Generation and Detection
DATE Schemes
AIM:
To simulate and analyze the generation and detection schemes of Amplitude Shift Keying
(ASK), Frequency Shift Keying (FSK), and Binary Phase Shift Keying (BPSK) using Scilab
APPARATUS REQUIRED:
THEORY:
Digital modulation techniques are used to transmit digital information over communication
channels efficiently. The three fundamental modulation techniques studied in this experiment are:
ASK is a digital modulation technique where the amplitude of a carrier wave is varied in
accordance with the binary data signal. The modulated signal takes two amplitude levels,
corresponding to binary ‘1’ and ‘0’.
• Modulation: The carrier wave is multiplied by the binary data.
• Demodulation: Envelope detection or coherent detection is used to recover the original
binary data.
• Advantages: Simple implementation, low power consumption.
• Disadvantages: High susceptibility to noise and signal fading.
2. Frequency Shift Keying (FSK)
FSK is a modulation scheme where the frequency of the carrier signal is changed between two
distinct values representing binary ‘1’ and ‘0’.
• Modulation: The frequency of the carrier wave is shifted based on input binary data.
• Demodulation: Frequency discrimination or phase-locked loop (PLL) techniques are used
to detect the original signal.
• Advantages: Better noise immunity compared to ASK.
• Disadvantages: Requires more bandwidth than ASK.
PROGRAM:
clc;
clear;
close();
// Parameters
t = 0:0.001:1; // Time vector for one bit duration
fc = 5; // Carrier frequency
fs = 1000; // Sampling frequency
bit_stream = [1 0 1 1 0 1 0 0 1]; // Binary Data
samples_per_bit = length(t); // Samples per bit
// Carrier Signal
carrier = sin(2 * %pi * fc * t);
// Initialize Signals
ask_signal = [];
input_signal = [];
carrier_wave = [];
demod_signal = [];
// ASK Modulation
for i = 1:length(bit_stream)
if bit_stream(i) == 1 then
ask_signal = [ask_signal, carrier]; // Bit '1' -> Carrier wave
input_signal = [input_signal, ones(1, samples_per_bit)]; // High level
else
ask_signal = [ask_signal, zeros(1, samples_per_bit)]; // Bit '0' -> No signal
input_signal = [input_signal, zeros(1, samples_per_bit)]; // Low level
end
carrier_wave = [carrier_wave, carrier]; // Continuous carrier signal
end
break;
end
// Threshold detection
if energy > 0.5 then
demod_signal = [demod_signal, ones(1, samples_per_bit)]; // High level
else
demod_signal = [demod_signal, zeros(1, samples_per_bit)]; // Low level
end
end
subplot(4,1,2);
plot(carrier_wave, 'b');
title('Carrier Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,3);
plot(ask_signal, 'r');
title('ASK Modulated Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,4);
plot(demod_signal, 'g');
title('ASK Demodulated Signal');
xlabel('Time'); ylabel('Amplitude');
gca().data_bounds = [0, -0.2; length(demod_signal), 1.2]; // Set Y-axis limits
clc;
clear;
close();
// Parameters
t = 0:0.001:1; // Time vector for one bit duration
f1 = 5; // Frequency for bit 1
f0 = 2; // Frequency for bit 0
fs = 1000; // Sampling frequency
bit_stream = [1 0 1 1 0 1 0 0 1]; // Binary Data
samples_per_bit = length(t); // Samples per bit
// Carrier Signals
carrier1 = sin(2 * %pi * f1 * t); // High frequency for bit 1
carrier0 = sin(2 * %pi * f0 * t); // Low frequency for bit 0
// Initialize Signals
fsk_signal = [];
input_signal = [];
carrier_wave = [];
demod_signal = [];
// FSK Modulation
for i = 1:length(bit_stream)
if bit_stream(i) == 1 then
fsk_signal = [fsk_signal, carrier1]; // Bit '1' -> High frequency
input_signal = [input_signal, ones(1, samples_per_bit)]; // High level
else
fsk_signal = [fsk_signal, carrier0]; // Bit '0' -> Low frequency
input_signal = [input_signal, zeros(1, samples_per_bit)]; // Low level
end
end
break;
end
// Decision Making
if energy1 > energy0 then
demod_signal = [demod_signal, ones(1, samples_per_bit)]; // Bit '1'
else
demod_signal = [demod_signal, zeros(1, samples_per_bit)]; // Bit '0'
end
end
subplot(4,1,2);
plot(fsk_signal, 'b');
title('FSK Modulated Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,3);
plot(fsk_signal, 'r');
title('FSK Received Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,4);
plot(demod_signal, 'g');
title('FSK Demodulated Signal');
xlabel('Time'); ylabel('Amplitude');
gca().data_bounds = [0, -0.2; length(demod_signal), 1.2];
clc;
clear;
close();
// Parameters
t = 0:0.001:1; // Time vector for one bit duration
fc = 5; // Carrier frequency
fs = 1000; // Sampling frequency
bit_stream = [1 0 1 1 0 1 0 0 1]; // Binary Data
samples_per_bit = length(t); // Samples per bit
// Carrier Signal
carrier = sin(2 * %pi * fc * t);
// Initialize Signals
bpsk_signal = [];
input_signal = [];
demod_signal = [];
// BPSK Modulation
for i = 1:length(bit_stream)
if bit_stream(i) == 1 then
bpsk_signal = [bpsk_signal, carrier]; // Bit '1' -> Normal carrier
input_signal = [input_signal, ones(1, samples_per_bit)]; // High level
else
bpsk_signal = [bpsk_signal, -carrier]; // Bit '0' -> Inverted carrier
input_signal = [input_signal, zeros(1, samples_per_bit)]; // Low level
end
end
// Decision Making
if correlation > 0 then
demod_signal = [demod_signal, ones(1, samples_per_bit)]; // Bit '1'
else
demod_signal = [demod_signal, zeros(1, samples_per_bit)]; // Bit '0'
end
end
subplot(4,1,2);
plot(carrier, 'b');
title('Carrier Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,3);
plot(bpsk_signal, 'r');
title('BPSK Modulated Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,4);
plot(demod_signal, 'g');
title('BPSK Demodulated Signal');
xlabel('Time'); ylabel('Amplitude');
gca().data_bounds = [0, -0.2; length(demod_signal), 1.2];
PROCEDURE
RESULT:
EXP NO: Simulation of DPSK, QPSK and QAM Generation and Detection
DATE Schemes.
AIM:
To simulate and analyze the generation and detection schemes of Differential Phase Shift Keying
(DPSK), Quadrature Phase Shift Keying (QPSK), and Quadrature Amplitude Modulation (QAM)
using Scilab
APPARATUS REQUIRED:
1 Personal Computer 1
2 Scilab 2025 Version 1
THEORY:
Digital modulation techniques are widely used in modern communication systems to transmit
information efficiently. The three modulation techniques studied in this experiment are:
1. Differential Phase Shift Keying (DPSK)
DPSK is a variant of PSK where the phase of the carrier signal is changed relative to the previous
signal rather than a fixed reference.
• Modulation: The phase of the carrier signal is changed based on the difference between
consecutive bits.
• Demodulation: Uses a differential decoder to compare the phase of consecutive received
symbols.
• Advantages: Eliminates the need for a coherent receiver.
• Disadvantages: More susceptible to noise compared to coherent PSK.
2. Quadrature Phase Shift Keying (QPSK)
QPSK is a phase modulation scheme that encodes two bits per symbol, making it more bandwidth-
efficient than BPSK.
• Modulation: Uses four different phase shifts (0°, 90°, 180°, and 270°) to represent bit pairs.
• Demodulation: A coherent receiver detects the phase shifts and maps them back to the
original bit sequence.
• Advantages: Higher data rate compared to BPSK.
• Disadvantages: More complex receiver design.
PROGRAM
// Parameters
t = 0:0.001:1; // Time vector for one bit duration
fc = 5; // Carrier frequency
fs = 1000; // Sampling frequency
bit_stream = [1 0 1 1 0 1 0 0 1]; // Binary Data
samples_per_bit = length(t); // Samples per bit
// Carrier Signal
carrier = sin(2 * %pi * fc * t);
// Initialize Signals
dpsk_signal = [];
input_signal = [];
demod_signal = [];
for i = 1:length(bit_stream)
if bit_stream(i) == 1 then
phase = previous_phase; // No phase shift if bit is '1'
else
phase = -previous_phase; // 180-degree phase shift if bit is '0'
end
for i = 1:length(bit_stream)
start_idx = (i-1) * samples_per_bit + 1;
end_idx = i * samples_per_bit;
// Differential Detection
if correlation > 0 then
demod_bit = previous_bit; // If phase is unchanged, bit remains same
else
demod_bit = 1 - previous_bit; // If phase shift, bit flips
end
subplot(4,1,2);
plot(carrier, 'b');
title('Carrier Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,3);
plot(dpsk_signal, 'r');
title('DPSK Modulated Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,4);
plot(demod_signal, 'g');
title('DPSK Demodulated Signal');
xlabel('Time'); ylabel('Amplitude');
gca().data_bounds = [0, -0.2; length(demod_signal), 1.2];
clc;
clear;
close();
// Parameters
t = 0:0.001:1; // Time vector for one bit duration
fc = 5; // Carrier frequency
fs = 1000; // Sampling frequency
bit_stream = [1 0 1 1 0 1 0 0 1 1 0 0]; // Binary Data (even length)
samples_per_bit = length(t); // Samples per bit
// Ensure binary data length is even (since QPSK uses bit pairs)
if modulo(length(bit_stream), 2) <> 0 then
bit_stream($+1) = 0; // Append a zero if needed
end
// Carrier Signals
I_carrier = cos(2 * %pi * fc * t); // In-phase carrier (cosine)
Q_carrier = sin(2 * %pi * fc * t); // Quadrature carrier (sine)
// Initialize Signals
qpsk_signal = [];
input_signal = [];
demod_signal = [];
// QPSK Modulation
for i = 1:2:length(bit_stream)
b1 = bit_stream(i);
b2 = bit_stream(i+1);
segment = qpsk_signal(i:i+samples_per_bit-1);
// Decision Making
if I_correlation > 0 & Q_correlation > 0 then
demod_bits = [0 0]; // 45 degrees
elseif I_correlation < 0 & Q_correlation > 0 then
demod_bits = [0 1]; // 135 degrees
elseif I_correlation < 0 & Q_correlation < 0 then
demod_bits = [1 1]; // 225 degrees
else
demod_bits = [1 0]; // 315 degrees
end
subplot(4,1,2);
plot(qpsk_signal, 'b');
title('QPSK Modulated Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,3);
plot(qpsk_signal, 'r');
title('QPSK Received Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,4);
plot(demod_signal, 'g');
title('QPSK Demodulated Signal');
xlabel('Time'); ylabel('Amplitude');
gca().data_bounds = [0, -0.2; length(demod_signal), 1.2];
clc;
clear;
close();
// Parameters
t = 0:0.001:1; // Time vector for one bit duration
fc = 5; // Carrier frequency
fs = 1000; // Sampling frequency
bit_stream = [1 0 1 0 1 0 1 1 0 0 0 1 1 1 1 0 0 0]; // Binary Data (multiple of 3)
samples_per_symbol = length(t); // Samples per symbol (3 bits per QAM symbol)
for i = 1:3:length(bit_stream)
b1 = bit_stream(i);
b2 = bit_stream(i+1);
b3 = bit_stream(i+2);
// 8-QAM Demodulation
for i = 1:samples_per_symbol:length(qam_signal)
if i + samples_per_symbol - 1 > length(qam_signal) then
break;
end
segment = qam_signal(i:i+samples_per_symbol-1);
subplot(4,1,2);
plot(qam_signal, 'b');
title('8-QAM Modulated Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,3);
plot(qam_signal, 'r');
title('8-QAM Received Signal');
xlabel('Time'); ylabel('Amplitude');
subplot(4,1,4);
plot(demod_signal, 'g');
title('8-QAM Demodulated Signal');
xlabel('Time'); ylabel('Amplitude');
gca().data_bounds = [0, -0.2; length(demod_signal), 1.2];
PROCEDURE:
1. Open Scilab: Launch Scilab on your system.
2. Create a New Script: Open SciNotes by selecting Applications > SciNotes.
3. Write the Code: Enter the Scilab script for generating and detecting DPSK, QPSK, and
QAM signals.
4. Save the File: Save the script with a .sci extension, e.g., modulation_dpsk_qpsk_qam.sci.
5. Load the Script in Scilab: In the Scilab console, navigate to the script’s directory and type:
exec('modulation_dpsk_qpsk_qam.sci', -1);
6. Run the Simulation: Execute the script, and Scilab will generate the modulation and
demodulation plots.
7. Analyze the Results: Observe the waveforms and compare the performance of DPSK,
QPSK, and QAM in terms of noise immunity and bandwidth efficiency.
RESULT:
EXP NO:
Simulation of Linear Block and Cyclic Error Control coding Schemes
DATE
AIM:
To simulate and analyze the encoding and decoding processes of Linear Block Codes and
Cyclic Codes for error detection and correction using Scilab.
APPARATUS REQUIRED:
THEORY:
Error control coding is essential in digital communication systems to detect and correct errors
introduced during transmission. The two primary coding schemes analyzed in this experiment are:
1. Linear Block Codes
Linear Block Codes are a class of error-correcting codes where each codeword is a linear
combination of message bits.
• Encoding: A message of length is multiplied by a generator matrix to generate a codeword
of length (where ).
• Decoding: The received codeword is checked using a parity-check matrix to detect and
correct errors.
• Advantages: Simple encoding and decoding, effective error detection and correction.
• Disadvantages: Limited error correction capability compared to more advanced coding
schemes.
2. Cyclic Codes
Cyclic Codes are a subset of Linear Block Codes where a cyclic shift of a codeword results in
another valid codeword.
• Encoding: The message polynomial is divided by a generator polynomial, and the
remainder is appended to form the codeword.
• Decoding: Syndrome decoding or cyclic redundancy check (CRC) is used to detect and
correct errors.
• Advantages: Efficient encoding and decoding using shift registers.
• Disadvantages: More complex than simple parity-based error detection.
PROGRAM:
clc;
clear;
close();
// Define Parameters
n = 7; // Codeword length
k = 4; // Message length
// Standard Codewords
message = [1 0 1 1;
0 1 0 1;
1 1 1 0;
0 0 1 1];
// Error Correction
for i = 1:size(codewords, 1)
syn = syndrome(:, i)'; // Get syndrome for row i
if norm(syn, 1) ~= 0 // If syndrome is nonzero, an error exists
for j = 1:n
if syn == H(:, j)' // Find the error bit position
codewords(i, j) = 1 - codewords(i, j); // Flip the bit
disp("Error corrected in row " + string(i) + ", bit " + string(j));
break;
end
end
end
end
disp("Corrected Codewords:");
disp(int32(codewords));
clc;
clear;
close();
for i = 1:k
if padded_msg(i) == 1 then
padded_msg(i:i+length(gen_poly)-1) = modulo(padded_msg(i:i+length(gen_poly)-1) -
gen_poly, 2);
end
end
encoded_codewords = [];
for i = 1:size(message,1)
encoded_codewords = [encoded_codewords; cyclic_encode(message(i,:), generator_poly, n)];
end
disp("Encoded Codewords:");
disp(int32(encoded_codewords));
PROCEDURE:
1. Open Scilab: Launch Scilab on your system.
2. Create a New Script: Open SciNotes by selecting Applications > SciNotes.
3. Write the Code: Enter the Scilab script for implementing Linear Block and Cyclic Codes
for encoding and decoding.
4. Save the File: Save the script with a .sci extension, e.g., error_control_coding.sci.
5. Load the Script in Scilab: In the Scilab console, navigate to the script’s directory and type:
exec('error_control_coding.sci', -1);
6. Run the Simulation: Execute the script, and Scilab will generate the encoded and decoded
messages along with error detection results.
7. Analyze the Results: Compare the error detection and correction capabilities of Linear
Block and Cyclic Codes under different error conditions.
RESULT: