Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views7 pages

CSP 8

Uploaded by

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

CSP 8

Uploaded by

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

Name:B.

Sriya
Roll no: EC22B1101
Date:12-03-25

Experiment 8: Binary Phase Shift Keying(BPSK)

Aim:
The objective of this experiment is to implement Binary Phase Shift Keying (BPSK) modulation
and demodulation on a given binary message sequence. The experiment includes:
1. Modulation Process:
o Mapping the binary message sequence to corresponding phase-shifted carrier signals.
o Generating and visualizing the carrier signal, mapped signal, and modulated signal.
2. Demodulation Process:
o Recovering the original message from the modulated BPSK signal.
o Comparing the demodulated signal with the original binary message.
3. Impact of Noise:
o Adding Additive White Gaussian Noise (AWGN) to the BPSK signal.
o Analyzing the effect of noise on the demodulated signal and comparing it with the
original message.
Through this experiment, we aim to understand the working of BPSK, its resilience to noise, and its
effectiveness in digital communication.

Theory:
Binary Phase Shift Keying (BPSK) is a digital modulation technique where the phase of a
carrier signal is shifted by 180° to represent binary data (0 and 1). It is widely used due to its
simplicity and robustness against noise.
BPSK Modulation
1. Binary Mapping:
o 1 → Carrier signal with 0° phase shift
o 0 → Carrier signal with 180° phase shift
2. Modulated Signal Representation: s(t)={Acos(2πfct), if bit = 1
-Acos(2πfct), if bit = 0}
BPSK Demodulation
• The received signal is multiplied with the synchronized carrier signal.
• A low-pass filter removes high-frequency components.
• A threshold detector decides:
o Positive signal → 1, Negative signal → 0
Effect of Noise (AWGN Impact)
• Additive White Gaussian Noise (AWGN) introduces errors in the received signal, making
detection difficult.
• The Bit Error Rate (BER) depends on the Signal-to-Noise Ratio (SNR).
This experiment helps understand BPSK modulation, demodulation, and its noise performance in
communication systems.

Codes:
1.
N = 10;

bit_seq = randi([0 1], 1, N);

Tb = 1;

fs = 100;

t = 0:1/fs:Tb-1/fs;

fc = 5;

carrier = cos(2 * pi * fc * t);

carrier_inv = -carrier;

bpsk_signal = [];

mapped_signal = [];

for i = 1:N

if bit_seq(i) == 1

bpsk_signal = [bpsk_signal, carrier];

mapped_signal = [mapped_signal, ones(1, length(t))];

else

bpsk_signal = [bpsk_signal, carrier_inv];

mapped_signal = [mapped_signal, -ones(1, length(t))];

end

end

figure;
subplot(4,1,1);

stairs([0:N-1], bit_seq, 'LineWidth', 2);

ylim([-0.2 1.2]); grid on;

title('Original Message Bit Sequence');

xlabel('Bit Index'); ylabel('Bit Value');

subplot(4,1,2);

plot(t, carrier, 'r', 'LineWidth', 1.5);

grid on;

title('Carrier Signal');

xlabel('Time (s)'); ylabel('Amplitude');

subplot(4,1,3);

plot(linspace(0, N*Tb, length(bpsk_signal)), bpsk_signal, 'b', 'LineWidth', 1.5);

grid on;

title('BPSK Modulated Signal');

xlabel('Time (s)'); ylabel('Amplitude');

received_signal = bpsk_signal .* repmat(carrier, 1, N);

demodulated_signal = sum(reshape(received_signal, fs, N)) / fs;

demodulated_bits = demodulated_signal > 0;

subplot(4,1,4);

stairs([0:N-1], demodulated_bits, 'g', 'LineWidth', 2);

ylim([-0.2 1.2]); grid on;

title('Demodulated Bit Sequence');

xlabel('Bit Index'); ylabel('Bit Value');

figure;

stairs([0:N-1], bit_seq, 'b', 'LineWidth', 2); hold on;

stairs([0:N-1], demodulated_bits, 'r--', 'LineWidth', 2);

legend('Original Message', 'Demodulated Message');

ylim([-0.2 1.2]); grid on;

title('Comparison of Original and Demodulated Signal');

xlabel('Bit Index'); ylabel('Bit Value');

SNR_dB = 5;

bpsk_noisy = awgn(bpsk_signal, SNR_dB, 'measured');

figure;
plot(linspace(0, N*Tb, length(bpsk_noisy)), bpsk_noisy, 'm', 'LineWidth', 1.2);

grid on;

title(['BPSK Signal with AWGN (SNR = ', num2str(SNR_dB), ' dB)']);

xlabel('Time (s)'); ylabel('Amplitude');

received_noisy = bpsk_noisy .* repmat(carrier, 1, N);

demodulated_noisy_signal = sum(reshape(received_noisy, fs, N)) / fs;

demodulated_noisy_bits = demodulated_noisy_signal > 0;

figure;

stairs([0:N-1], bit_seq, 'b', 'LineWidth', 2); hold on;

stairs([0:N-1], demodulated_noisy_bits, 'r--', 'LineWidth', 2);

legend('Original Message', 'Demodulated Message with Noise');

ylim([-0.2 1.2]); grid on;

title(['Comparison of Original and Demodulated Signal (SNR = ', num2str(SNR_dB), ' dB)']);

xlabel('Bit Index'); ylabel('Bit Value');

num_errors = sum(bit_seq ~= demodulated_noisy_bits);

BER = num_errors / N;

disp(['Bit Error Rate (BER) at SNR = ', num2str(SNR_dB), ' dB: ', num2str(BER)]);

Waveforms:
1.
Inference:

Through this experiment, I have gained a deeper understanding of Binary Phase Shift Keying (BPSK)
and its behavior under different conditions.

1. BPSK Modulation
o BPSK modulates binary data (0 and 1) by shifting the phase of a carrier signal by 180°.
o It is a simple and effective digital modulation technique with good noise immunity.
2. BPSK Demodulation
o The original message is recovered by multiplying the received signal with the
synchronized carrier and applying a threshold decision.
o In an ideal noise-free environment, BPSK demodulation accurately retrieves the
transmitted bits.
3. Effect of Noise on BPSK
o AWGN (Additive White Gaussian Noise) distorts the received signal, causing errors
in bit detection.
o The Bit Error Rate (BER) increases as noise power increases.
o The impact of noise is analyzed using the Signal-to-Noise Ratio (SNR).
4. Impact of SNR on Performance
o Higher SNR:
▪ The received signal is clearer with minimal distortion.
▪ BER is lower, leading to more accurate bit recovery.
▪ The demodulated signal closely matches the original message.
o Lower SNR:
▪ The signal becomes more distorted due to increased noise.
▪ BER increases, causing frequent bit errors in demodulation.
▪ Communication reliability decreases, making it harder to distinguish 0s and 1s.

This experiment helps understand how BPSK performs under different noise conditions and highlights
the importance of SNR in maintaining reliable digital communication.
Result: BPSK modulation and demodulation were successfully implemented.

1. In a noise-free environment, the demodulated signal matched the original message sequence
perfectly.
2. When AWGN noise was added, errors were observed in the demodulated signal, depending
on the SNR value.
3. For higher SNR values, the demodulated signal closely matched the original message with
minimal errors.
4. For lower SNR values, more bit errors were observed due to increased noise interference.
5. The Bit Error Rate (BER) was computed to quantify the effect of noise on signal accuracy.
6. The experiment demonstrated the trade-off between noise levels and communication
reliability in BPSK modulation.

You might also like