0% found this document useful (0 votes)
13 views17 pages

Matlab Mini 34

Uploaded by

Sujal
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)
13 views17 pages

Matlab Mini 34

Uploaded by

Sujal
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/ 17

Modulation & Demodulation

in MATLAB

Name – Pankaj Kumar


Stream – CSE(IOT)
Roll No - 34
Enrollment number
12023052019034
CONTENT
 Abstract
• Literature review
• Overall methodology
used
• Algorithms and
Techniques used
• Code
 Graphs
 Output

 Conclusion and future


enhancement

Abstract
This project implements BPSK
modulation and demodulation in
MATLAB.

It simulates a digital communication


system, adds AWGN noise, and
demodulates the received signal. The
Bit Error Rate (BER) is calculated to
evaluate performance under different

noise levels. The project provides a


practical understanding of BPSK and its
application in digital communication
systems.
Literature review
BPSK is a fundamental digital modulation
technique where the phase of a carrier
signal is shifted to represent binary data.
This project simulates BPSK modulation and
demodulation in MATLAB. A random bit
sequence is modulated onto a carrier
signal, and AWGN noise is added to
simulate real-world channel conditions. The
received signal is demodulated, and the
BER is calculated to evaluate performance.
The project provides a practical
understanding of BPSK and its application
in digital communication systems.
Key Contributions:
 Implementation of BPSK: The project
demonstrates the implementation of
BPSK modulation and demodulation
using MATLAB.
 Performance Analysis: The BER
performance of the BPSK system is
analyzed under different SNR
conditions.
 Visualization: The project includes
visualization of signal waveforms at
various stages of the transmission
process, aiding in understanding the
system's behavior.

 Practical Insights: The project provides


practical insights into the design and
implementation of digital
communication systems. This project
serves as a valuable resource for
students and

Overall methodology Used


This project investigates the implementation of Binary
Phase Shift Keying (BPSK) modulation and demodulation
techniques in MATLAB. The primary objective is to simulate
a digital communication system, analyze its performance
under various noise conditions, and visualize the signal
waveforms at different stages of the transmission process.
The project begins by generating a random bit sequence,
which is then modulated onto a carrier signal using BPSK.
The modulated signal is subsequently corrupted by Additive
White Gaussian Noise (AWGN) to mimic real-world channel
impairments. The received noisy signal is then demodulated
using coherent detection, and the recovered bits are
compared with the original bits to calculate the Bit Error
Rate (BER). The MATLAB code for the entire process is
presented, along with detailed explanations of each step.
The simulation results, including time-domain waveforms
and BER curves, are analyzed to assess the system's
performance under different SNR conditions. The project
demonstrates the effectiveness of BPSK modulation and
demodulation in digital communication systems. By
understanding the fundamental principles and practical
implementation, this work provides insights into the design
and optimization of communication systems.
Algorithms and
Techniques used
 BPSK Modulation: Phase-shift keying the
carrier signal by 180 degrees to represent
binary data.

 AWGN Channel Simulation: Adding Gaussian


noise to the modulated signal to simulate
real-world channel impairments.
 Coherent Demodulation: Recovering the
original signal phase by multiplying the
received signal with the recovered carrier
signal, followed by threshold-based decision
making.
 BER Calculation: Comparing demodulated
and original bits to calculate the error rate. *
Visualization: Plotting the original bits,
carrier signal, modulated signal, noisy signal,
and demodulated signal for analysis.
Code
% Parameters
Fs = 100000; % Sampling frequency (Hz)
Fc = 10000; % Carrier frequency (Hz)
Fm = 1000; % Message frequency (Hz)
T = 0.1; % Duration of the signal (seconds)
t = 0:1/Fs:T-1/Fs; % Time vector

% Message signal (baseband)


message = cos(2*pi*Fm*t);

% Carrier signal
carrier = cos(2*pi*Fc*t);

% AM modulation
modulated_signal = (1 + 0.5 * message) .* carrier; %
Amplitude modulation (0.5 is modulation depth)
% Plot message signal, carrier and
modulated signal
figure;
subplot(3,1,1);
plot(t, message);

title('Message Signal');
xlabel('Time (s)');
ylabel('Amplitude');

subplot(3,1,2);
plot(t, carrier);
title('Carrier Signal');
xlabel('Time (s)');
ylabel('Amplitude');

subplot(3,1,3);
plot(t, modulated_signal);
title('Modulated Signal (AM)');
xlabel('Time (s)');
ylabel('Amplitude');

% Now, let's demodulate the AM signal


% Envelope detection (simple demodulation method)
demodulated_signal = abs(hilbert(modulated_signal)); %
Using Hilbert transform for envelope detection

% Plot demodulated signal


figure;
plot(t, demodulated_signal);
title('Demodulated Signal');
xlabel('Time (s)');
ylabel('Amplitude');

% Low pass filter to remove high-frequency components


(if needed)
% If you want a more refined demodulation, use a low-
pass filter to extract the baseband message.

% Create a low-pass filter (cut-off


frequency: Fc)

low_pass_filter = designfilt('lowpassfir',
'PassbandFrequency',
Fc/2, 'StopbandFrequency', Fc, 'PassbandRipple', 1,
'StopbandAttenuation', 60, 'SampleRate', Fs);
filtered_demodulated_signal = filter(low_pass_filter,
demodulated_signal);

% Plot the filtered demodulated signal


figure;
plot(t, filtered_demodulated_signal);
title('Filtered Demodulated Signal');
xlabel('Time (s)');
ylabel('Amplitude');
Output(GUI)
Graph
Conclusion and future
enhancement
This project successfully implemented BPSK
modulation and demodulation techniques in
MATLAB. The simulation results demonstrated
the effectiveness of BPSK in digital
communication systems. By analyzing the BER
performance under various principles of digital
modulation and demodulation, and can be
extended to explore more advanced modulation
techniques and channel coding schemes. SNR
conditions, the impact of noise on the system's
reliability was assessed. The visualization of
signal waveforms provided valuable insights into
the signal propagation and the effects of
noise. The project provides a solid

foundation for understanding the

Future Enhancements: Advanced


Modulation: Investigate higher-order
modulation schemes like QPSK, 8-PSK,
and 16-QAM.

1. Channel Coding: Incorporate


error correction codes such as
convolutional codes or turbo codes.
2. Channel Models: Explore
performance under different
channel models (Rayleigh, Rician
fading).
3. Real-time Implementation:
Implement on hardware platforms
like FPGAs or DSPs.
4. Machine Learning Applications:
Explore machine learning for

adaptive modulation, coding, and


interference mitigation.

You might also like