6.1 Title: Implementation of Phase Shift Keying (PSK) Modulator and Demodulator
6.2 Aim of the experiment: To design and implement a Phase Shift Keying (PSK) modulator and demodulator to demonstrate the application of digital modulation techniques.
6.3 Theoretical background for the experiment: Phase Shift Keying (PSK) is a digital modulation technique where the phase of the carrier signal is varied according to the binary data (1s and 0s). The most basic form of PSK is Binary Phase Shift Keying (BPSK), where the phase is shifted by 180 degrees for binary 1 and binary 0.
The PSK modulated signal can be expressed as:
6.4 Design:
Carrier Signal: A sinusoidal signal with a specified frequency.
Binary Data: A digital signal sequence (e.g., 101010).
Modulation: Phase modulation using binary data.
Demodulation: Correlate the received signal with the reference carrier signal to recover the binary data.
6.5 Step by step procedure to carry out the experiment:
Generate a carrier signal .
Create a binary data sequence.
Modulate the carrier signal by inverting its phase based on the binary data.
For demodulation:
Multiply the received signal with the reference carrier.
Integrate the product over a bit period to determine the binary data.
Compare the recovered binary data with the original sequence.
6.6 Code:
fs = 1e4;
bit_rate = 100;
n_bits = 10;
data_bits = randi([0, 1], 1, n_bits);
T = 1 / bit_rate;
t = 0:1/fs:n_bits*T - 1/fs;
n_samples = length(t);
samples_per_bit = n_samples / n_bits;
fc = 500;
psk_signal = zeros(1, n_samples);
for i = 1:n_bits
if data_bits(i) == 0
psk_signal((i-1)*samples_per_bit + 1:i*samples_per_bit) = cos(2 * pi * fc * t((i-1)*samples_per_bit + 1:i*samples_per_bit));
else
psk_signal((i-1)*samples_per_bit + 1:i*samples_per_bit) = cos(2 * pi * fc * t((i-1)*samples_per_bit + 1:i*samples_per_bit) + pi);
end
end
figure;
subplot(3, 1, 1);
stairs(0:n_bits-1, data_bits, 'LineWidth', 2);
xlabel('Time (bits)');
ylabel('Amplitude');
title('Input Binary Data');
grid on;
subplot(3, 1, 2);
plot(t, psk_signal, 'LineWidth', 1.5);
xlabel('Time (s)');
ylabel('Amplitude');
title('PSK Modulated Signal');
grid on;
demod_bits = zeros(1, n_bits);
for i = 1:n_bits
segment = psk_signal((i-1)*samples_per_bit + 1:i*samples_per_bit);
if mean(segment) > 0
demod_bits(i) = 1;
else
demod_bits(i) = 0;
end
end
subplot(3, 1, 3);
stairs(0:n_bits-1, demod_bits, 'LineWidth', 2);
xlabel('Time (bits)');
ylabel('Amplitude');
title('Demodulated Binary Data');
grid on;
disp('Original Bits:');
disp(data_bits);
disp('Demodulated Bits:');
disp(demod_bits);
6.7 Observations and results:
The PSK modulated signal exhibits phase inversion for binary 1 relative to binary 0.
The demodulated signal successfully recovers the original binary data sequence.
The recovered data matches the transmitted binary data, demonstrating accurate modulation and demodulation.
6.8 Plotting of the graph:
Observations and results:
1. Phase Shift Keying (PSK):
6.9 Conclusion of the experiment:
The PSK modulator and demodulator were successfully implemented. The modulated signal accurately represented the binary data using phase shifts, and the demodulation process effectively recovered the original data sequence. This experiment demonstrates the application of digital modulation techniques through Phase Shift Keying.