4.1 Title: Implementation of Amplitude Shift Keying (ASK) Modulator and Demodulator
4.2 Aim of the experiment:
To design and implement an Amplitude Shift Keying (ASK) modulator and demodulator to demonstrate the application of digital modulation techniques.
4.3 Theoretical background for the experiment:
Amplitude Shift Keying (ASK) is a digital modulation technique in which the amplitude of a carrier wave is varied according to the binary data (1s and 0s). The modulated signal has a high amplitude for binary 1 and a low or zero amplitude for binary 0.
The modulated ASK signal can be expressed as:
Key Components:
Modulator: Multiplies binary data with the carrier signal to generate the ASK signal.
Demodulator: Detects the amplitude of the received signal to recover the binary data.
4.4 Design:
Carrier Signal: A sinusoidal signal with a specified frequency.
Binary Data: A digital signal sequence (e.g., 101010).
Modulation: Amplitude modulation using binary data and the carrier signal.
Demodulation: Rectification and thresholding to recover binary data.
4.5 Step by step procedure to carry out the experiment:
Generate a carrier signal.
Create a binary data sequence.
Multiply the carrier signal with the binary data sequence to generate the ASK modulated signal.
For demodulation:
Use an envelope detector to extract the modulated signal amplitude.
Apply a threshold to distinguish binary 1 from binary 0.
Compare the recovered binary data with the original sequence.
4.6 Code:
fs = 1e4;
fc = 500;
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;
carrier = cos(2 * pi * fc * t);
ask_signal = zeros(1, n_samples);
for i = 1:n_bits
if data_bits(i) == 1
ask_signal((i-1)*samples_per_bit + 1:i*samples_per_bit) = carrier((i-1)*samples_per_bit + 1:i*samples_per_bit);
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, ask_signal, 'LineWidth', 1.5);
xlabel('Time (s)');
ylabel('Amplitude');
title('ASK Modulated Signal');
grid on;
demod_signal = ask_signal .* carrier;
demod_bits = zeros(1, n_bits);
for i = 1:n_bits
segment = demod_signal((i-1)*samples_per_bit + 1:i*samples_per_bit);
if mean(segment) > 0.1
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);
4.7 Observations and results:
The ASK modulated signal exhibits high amplitude for binary 1 and low amplitude for 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.
4.8 Plotting of the graph:
1.Amplitude Shift Keying (ASK) :
4.9 Conclusion of the experiment:
The ASK modulator and demodulator were successfully implemented. The modulated signal accurately represented the binary data using amplitude variations, and the demodulation process effectively recovered the original data sequence. This experiment demonstrates the application of digital modulation techniques through ASK.