0% found this document useful (0 votes)
7 views18 pages

Samrath WMCFile

The document is a practical file for a B. Tech. CSE course detailing various experiments related to wireless and mobile communication. It includes aims, theories, codes, and conclusions for experiments such as generating binary random sequences, plotting basic signals, generating Gaussian noise, processing binary data streams with 16-QAM, and analyzing signal spectra. Each experiment highlights key concepts in communication systems and signal processing.

Uploaded by

Simran tomar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views18 pages

Samrath WMCFile

The document is a practical file for a B. Tech. CSE course detailing various experiments related to wireless and mobile communication. It includes aims, theories, codes, and conclusions for experiments such as generating binary random sequences, plotting basic signals, generating Gaussian noise, processing binary data streams with 16-QAM, and analyzing signal spectra. Each experiment highlights key concepts in communication systems and signal processing.

Uploaded by

Simran tomar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Submitted to

Mr. CHANDRA MOHAN


DHARMAPURI
(Assistant Professor)

Submitted By:
SIMRAN TOMAR

B. Tech. CSE 7th Sem Roll N

WIRELESS AND MOBILE COMMUNICATION


PRACTICAL FILE
TABLE OF CONTENT
Sr. No. Name Page no.

1. To generate a binary random sequence of length 10,000, and 2


visualize its distribution using a histogram.

2. To plot basic signals in discrete and continuous forms, including 3


sine, cosine, impulse, and unit step.

3. To generate a real Gaussian noise sequence with zero mean and 7


unit variance, verify its Gaussian distribution, compare it with the
theoretical Gaussian curve, and compute the average symbol
power.

4. To process a binary data stream using a communication system 10


consisting of a base-band modulator, channel, and demodulator.
Compute the system’s BER (Assume 16-QAM).

5. To plot the magnitude and phase spectrum of a given N-length 13


signal.

6. To simulate a QPSK modulation scheme and compare it with a 16


BPSK scheme.

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:

1. Digital Modulation: Testing modulation schemes like BPSK and QPSK.


2. Error Correction: Evaluating performance of error-correcting codes.
3. Noise Handling: Simulating real-world data under noisy conditions.

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.

FUNCTIONS USED: rand()

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:

1) Sine signal : y=sin ( t )


2) Cosine signal : y =cos ( t )
3) Impulse :δ [ n ] =1 , at n=0 ,∧¿ δ [ n ] =0 , for n≠ 0
4) Unit step: u [ n ] =1 , for n ≥ 0 ,∧u [ n ] =0 , for n<0
 Sine Wave: Used as a carrier signal for modulating information in wireless communication
systems like AM and FM.
 Cosine Wave: Complements sine waves in quadrature modulation schemes (e.g., QAM and
QPSK) for transmitting data efficiently.
 Impulse Signal: Helps in analyzing system impulse responses, crucial for channel modeling
in wireless communication.
 Unit Step Signal: Used to evaluate system step responses, aiding in testing and optimizing
power control and handover mechanisms.
FUNCTIONS USED: plot(), stem()

CODE
% Generate a continuous sine wave
t = linspace(0, 2 * pi, 1000); % Time vector for continuous signals
y_sine = sin(t); % Continuous sine wave

% Plot the continuous sine wave


figure;
subplot(3, 2, 1); % Subplot position 1
plot(t, y_sine, 'b'); % Plot in blue for distinction

4
title('Continuous Sine Wave');
xlabel('Time');
ylabel('Amplitude');

% Generate a discrete sine wave


n = 0:0.1:2*pi; % Time vector for discrete signals
y_sine_discrete = sin(n); % Discrete sine wave

% Plot the discrete sine wave


subplot(3, 2, 2); % Subplot position 2
stem(n, y_sine_discrete, 'r'); % Stem plot in red
title('Discrete Sine Wave');
xlabel('Time');
ylabel('Amplitude');

% Generate and plot a continuous cosine wave


y_cosine = cos(t); % Continuous cosine wave
subplot(3, 2, 3); % Subplot position 3
plot(t, y_cosine, 'g'); % Plot in green
title('Continuous Cosine Wave');
xlabel('Time');
ylabel('Amplitude');

% Generate and plot a discrete cosine wave


y_cosine_discrete = cos(n); % Discrete cosine wave
subplot(3, 2, 4); % Subplot position 4
stem(n, y_cosine_discrete, 'm'); % Stem plot in magenta
title('Discrete Cosine Wave');
xlabel('Time');
ylabel('Amplitude');

% Generate and plot a discrete impulse signal


impulse = (n == 0); % Impulse signal (1 at n = 0)
subplot(3, 2, 5); % Subplot position 5
stem(n, impulse, 'k'); % Stem plot in black
title('Discrete Impulse Signal');
xlabel('Time');
ylabel('Amplitude');

% Generate and plot a discrete unit step signal


unit_step = (n >= 0); % Unit step signal (1 for n >= 0)
subplot(3, 2, 6); % Subplot position 6
stem(n, unit_step, 'c'); % Stem plot in cyan
title('Discrete Unit Step Signal');
xlabel('Time');

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.

The PDF of a Gaussian distribution is given by:


2
−( x−μ )
1 2

f ( x )= ⅇ 2σ

√2 π σ 2
where:

 μ: Mean of the distribution (central value).


σ : Variance of the distribution (spread).
2

Key Characteristics:

1. Zero Mean ( μ=0): The noise is symmetrically distributed around 0.


2. Unit Variance (σ 2=1): Specifies the spread of the noise.

Gaussian noise is fundamental in analyzing communication systems under noisy conditions,


aiding in tasks such as:

 Estimating system performance.


 Modeling Additive White Gaussian Noise (AWGN) channels.
 Simulating signal-to-noise ratio (SNR) effects.

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

% Define parameters for theoretical Gaussian function


x = -10:0.1:10; % Range of x-values with smaller steps for smoothness
n = 0; % Mean of the Gaussian
v = 1; % Variance of the Gaussian
p = (1 / sqrt(2 * pi * v)) * exp(-((x - n).^2) / (2 * v)); % Gaussian PDF
formula

% Create figure for side-by-side plots


figure;

% Plot histogram of Gaussian noise (Sequence 1)


subplot(1, 2, 1); % Create the first plot on the left
histogram(N_seq1, 10, 'FaceColor', [0.5 1 0.5], 'EdgeColor', 'black'); %
Histogram with green bars
title('Histogram of Real Gaussian Noise (Sequence 1)');
xlabel('Value');
ylabel('Frequency');
grid on;

% Plot theoretical Gaussian function


subplot(1, 2, 2); % Create the second plot on the right
plot(x, p, 'LineWidth', 2, 'Color', [1 0.5 0]); % Plot with orange line
title('Theoretical Gaussian Function');
xlabel('Value');
ylabel('Probability Density');
grid on;

% Add legend to the Gaussian function plot


legend('Theoretical Gaussian Function');

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:

 A symbol represents 4 bits of data (24=162^4 = 1624=16 constellation points).


 Data symbols are mapped to unique constellation points in the in-phase (I) and
quadrature (Q) components.

A communication system typically consists of three key components:

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:

BER=Total number of bits transmitted/Number of bit errors

It quantifies the effect of noise and other distortions on the communication system.

This experiment demonstrates:

 The modulation and demodulation processes in 16-QAM.


 The effect of noise on the transmitted signal.
 The calculation of BER to evaluate communication reliability.

10
FUNCTIONS USED: qammod(), qamdemod(), biterr()

CODE
% Clear workspace and command window
clc;
clear;

% Step 1: Generate Random Input Data


input = randi([0 15], 1, 10); % Random integers between 0 and 15 for 16-
QAM

% Step 2: Perform 16-QAM Modulation


m = qammod(input, 16); % 16-QAM modulation

% Step 3: Add AWGN Noise to the Modulated Signal


SNR = 10; % Signal-to-Noise Ratio in dB
ch = awgn(m, SNR, 'measured'); % Add noise

% Step 4: Perform 16-QAM Demodulation


output = qamdemod(ch, 16); % Demodulate noisy signal

% Step 5: Calculate the Bit Error Rate (BER)


[error, numBits] = biterr(input, output); % Calculate bit error rate

% Step 6: Display Results


disp(['Bit Errors: ', num2str(error)]);
disp(['Total Bits: ', num2str(numBits)]);

% Step 7: Plot Constellation Diagram


figure;
scatterplot(ch); % Received signal constellation
hold on;
scatterplot(m, 1, 0, 'r*'); % Overlay ideal signal constellation
title('16-QAM Constellation Diagram with Noise');
legend('Received Signal', 'Ideal Signal');
hold off;

% Step 8: Display BER in Scientific Notation


fprintf('\nThe binary coding bit error rate is %5.2e, based on %d
errors.\n', ...
error / numBits, error);

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.

The frequency domain representation helps in:

 Designing filters to enhance or suppress specific frequencies.


 Analyzing system response in the frequency domain.
 Understanding bandwidth requirements and signal distortion.

Discrete Fourier Transform (DFT):

For discrete signals, the Fourier Transform is approximated by the Discrete Fourier Transform
(DFT), computed efficiently using the Fast Fourier Transform (FFT).

If x[n] is an N-length signal, the DFT is given by:


N −1 2π
−j kn
x [ k ]= ∑ x [ n ] ⅇ N

n=0

where x [ k ]represents the frequency components.

13
Frequency Components:

 √ 2
Magnitude Spectrum: |x |k||= ℜ ( x [ k ]) + ℑ ( x [ k ])
2

 Phase Spectrum: ∠ x [ k ] =arctan


( ℑ ( x [ k ])
ℜ ( x [ k ]) )
FUNCTION USED: fft(), abs(), angle()

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);

% Compute the Fourier Transform of the signal


fft_signal = fft(signal); % FFT of the signal
magnitude_spectrum = abs(fft_signal); % Magnitude spectrum
phase_spectrum = angle(fft_signal); % Phase spectrum

% Plot the Magnitude Spectrum


figure;
subplot(2,1,1); % First subplot
stem(n, magnitude_spectrum, 'filled', 'LineWidth', 1.5); % Magnitude
spectrum
title('Magnitude Spectrum');
xlabel('Frequency Index (Hz)');
ylabel('Magnitude');
grid on;

% Plot the Phase Spectrum


subplot(2,1,2); % Second subplot
stem(n, phase_spectrum, 'filled', 'LineWidth', 1.5); % Phase spectrum
title('Phase Spectrum');
xlabel('Frequency Index (Hz)');
ylabel('Phase (radians)');
grid on;

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:

1. Binary Phase Shift Keying (BPSK):


o Each symbol represents a single bit (0 or 1).
o Modulates the phase of the carrier signal to 0° or 180°.
o Offers robustness against noise due to large Euclidean distances between
symbols.
o Data Rate: Lower, as only one bit is transmitted per symbol.
o Complexity: Simple modulation and demodulation process.
2. Quadrature Phase Shift Keying (QPSK):
o Each symbol represents two bits (00, 01, 10, 11).
o Modulates the carrier phase to one of four values: 45°, 135°, 225°, or 315°.
o Achieves double the data rate of BPSK.
o Trade-Off: Requires more complex demodulation but is more bandwidth-
efficient.

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.

FUNCTION USED: pskmod(), pskdemod(), biterr()

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

You might also like