Samrath WMCFile
Samrath WMCFile
Submitted By:
SIMRAN TOMAR
1
EXPERIMENT NO. 1
AIM
To generate a binary random sequence of length 10,000, and visualize its distribution
using a histogram.
THEORY
In communication systems, binary random sequences are fundamental for simulating data
streams and evaluating system performance. These sequences consist of values 0 and 1,
randomly distributed based on specific probabilities. They are widely used in various
applications, such as:
Such sequences enable the testing and validation of algorithms and hardware designs before
deployment in real-world systems.
The histogram provides a graphical representation of the frequency distribution of the generated
binary values. It allows us to evaluate the randomness and uniformity of the sequence. For a truly
random binary sequence with equal probabilities for 0 and 1, the histogram should display two
bars of nearly equal height, representing a uniform distribution.
This visualization is crucial for understanding the statistical properties of the sequence and
ensuring its suitability for simulations and testing in digital communication systems.
CODE
clc;
y = rand(10000, 1); % Generate random binary sequence of length 10000
hist(y); % Plot histogram
title('Histogram of Random Values');
xlabel('Value');
ylabel('Frequency');
RESULT
2
CONCLUSION
The binary random sequence was successfully generated, and its uniform distribution has been
analyzed
3
EXPERIMENT NO. 2
AIM
To plot basic signals in discrete and continuous forms, including sine, cosine, impulse,
and unit step.
THEORY
Basic signal forms are fundamental to digital signal processing (DSP) and wireless
communication systems, as they serve as building blocks for more complex signals and
systems. These signals play crucial roles in modeling, analyzing, and simulating real-world
phenomena.
This experiment focuses on plotting four key signals—sine, cosine, impulse, and unit step—in
both continuous and discrete domains to explore their properties and behavior. The respective
equations for sine, cosine, impulse and unit step signals are thusly:
CODE
% Generate a continuous sine wave
t = linspace(0, 2 * pi, 1000); % Time vector for continuous signals
y_sine = sin(t); % Continuous sine wave
4
title('Continuous Sine Wave');
xlabel('Time');
ylabel('Amplitude');
5
ylabel('Amplitude');
RESULT
CONCLUSION
The experiment successfully demonstrated the generation and plotting of basic signals—sine,
cosine, impulse, and unit step—in both continuous and discrete forms.
6
EXPERIMENT NO. 3
AIM
To generate a real Gaussian noise sequence with zero mean and unit variance, verify its
Gaussian distribution, compare it with the theoretical Gaussian curve, and compute the
average symbol power.
THEORY
Gaussian noise, also known as normal noise, is a random noise characterized by a Gaussian
(normal) probability density function (PDF). It is widely used in communication systems to
model natural noise sources such as thermal noise and shot noise.
f ( x )= ⅇ 2σ
√2 π σ 2
where:
Key Characteristics:
7
FUNCTIONS USED: randn(), hist(), wgn()
CODE
% Generate Gaussian noise (Sequence 1)
N_seq1 = randn(100, 1); % 100 samples of Gaussian noise with mean 0 and
variance 1
8
RESULTS
CONCLUSION
The experiment successfully generated a Gaussian noise sequence with zero mean and unit variance,
verified by its histogram matching the theoretical Gaussian PDF.
The computed average symbol power = 0.9962 aligns with the variance, confirming its suitability for
modeling noise in communication systems.
9
EXPERIMENT NO. 4
AIM
To process a binary data stream using a communication system consisting of a base-band
modulator, channel, and demodulator. Compute the system’s BER (Assume 16-QAM).
THEORY
Quadrature Amplitude Modulation (QAM) is a digital modulation scheme that encodes data
onto both amplitude and phase of a carrier signal. In a 16-QAM system:
1. Modulator:
o Maps digital data onto a modulated signal (constellation points) for transmission.
o In 16-QAM, symbols are modulated as complex numbers in the I-Q plane.
2. Channel:
o The signal passes through an AWGN channel, which introduces random noise,
distorting the signal.
3. Demodulator:
o Detects the received signal and decodes it back into digital symbols.
o The demodulation process maps noisy received points back to the nearest
constellation point.
Bit Error Rate (BER): The BER is a measure of system performance, calculated as:
It quantifies the effect of noise and other distortions on the communication system.
10
FUNCTIONS USED: qammod(), qamdemod(), biterr()
CODE
% Clear workspace and command window
clc;
clear;
11
RESULTS
CONCLUSION
The simulation validated the principles of 16-QAM modulation and highlighted the importance
of SNR and BER in maintaining reliable communication.
12
EXPERIMENT NO. 5
AIM
To plot the magnitude and phase spectrum of a given N-length signal.
THEORY
In wireless communication, signals are often analyzed in the frequency domain to understand
how they interact, propagate, and respond to systems. The Fourier Transform (FT) is a
mathematical tool used to convert a signal from the time domain into its frequency domain
representation.
Key Components:
1. Magnitude Spectrum:
o Represents the strength of the signal across different frequencies.
o Indicates which frequencies contribute the most to the signal's composition.
2. Phase Spectrum:
o Represents the phase shifts associated with each frequency component.
o Crucial for system stability, ensuring the correct timing of signal components
during reconstruction.
For discrete signals, the Fourier Transform is approximated by the Discrete Fourier Transform
(DFT), computed efficiently using the Fast Fourier Transform (FFT).
n=0
13
Frequency Components:
√ 2
Magnitude Spectrum: |x |k||= ℜ ( x [ k ]) + ℑ ( x [ k ])
2
CODE:
clc;
clear;
close all;
% Parameters
n = 0:99; % Time indices
% Define the signal: Sum of two sine waves with different frequencies
signal = sin(0.1 * pi * n) + 0.5 * sin(0.3 * pi * n);
14
RESULT
CONCLUSION
The experiment successfully demonstrated the frequency domain representation of a discrete
signal composed of two sine waves using the Fast Fourier Transform (FFT).
15
EXPERIMENT NO. 6
AIM
To simulate a QPSK modulation scheme and compare it with a BPSK scheme.
THEORY
In communication systems, modulation schemes are used to encode information onto carrier
signals for efficient transmission over channels. Two common modulation schemes are:
Performance Metric:
The Bit Error Rate (BER) is used to evaluate the performance of modulation schemes over a
range of Signal-to-Noise Ratios (SNR). BER is the fraction of bits received incorrectly.
CODE
for sn1 = 0:2:15
x = randint(1, 100000); % Random input data
y = pskmod(x, 2); % BPSK modulation
y_noise_added = awgn(y, sn1); % Add noise
z = pskdemod(y_noise_added , 2);
[number, ratio] = biterr(x, z);
plot(sn1, ratio);
hold on;
end
16
for sn1 = 0:2:15
x = randint(1, 100000);
y = pskmod(x, 4); % QPSK modulation
y_noise_added = awgn(y, sn1);
z = pskdemod(y_noise_added , 4);
[number, ratio] = biterr(x, z);
plot(sn1, ratio);
hold on;
end
RESULTS
CONCLUSION
BPSK and QPSK were successfully simulated, and their BERs were analyzed over a range of SNRs.
While BPSK offers better noise tolerance, QPSK achieves higher data rates. This trade-off makes QPSK
more suitable for bandwidth-limited systems, whereas BPSK is preferred in noise-prone environments.
17