L6 Qask
L6 Qask
E THARAKA RAM(EC21B1005)
March 26, 2024
Aim
• To perform Amplitude Shift Keying using MATLAB.
5
Software Used
00
Latest Version of MATLAB.
be sent over physical channels like radio waves or communication cables This is an explanation
of how ASK functions: Carrier Signal: Visualize a radio-like, high-frequency wave. The actual
data you wish to send is transported by this signal, which is known as the carrier signal.
Binary data, or digital data, is information that is often sent as a series of 0s and 1s. Changes
EC
in Amplitude: The carrier signal’s amplitude, or strength, is adjusted in ASK based on the
digital data. A binary 1 may be represented by a large amplitude, and a binary 0 by a low
amplitude or no signal at all. BASK Modulation stands for Binary Amplitude-Shift Keying
in Modulation. It is a type of Amplitude Modulation which represents the binary data in the
form of variations in the amplitude of a signal. QASK(Quadrature Amplitude-Shift Keying)
is a method of combining two bit signals into a single channel. This approach helps double its
effective bandwidth.
Basis function,
c(t) = cos(2πfc t)
The BASK wave,
1
(
√ 0 for binary symbol 1
s(t) = 2
2Eb cos(2πfc t) for binary symbol 0
Where Eb is the bit energy and Tb is the bit duration.
The coordinates of message points,
Z Tb p
s(t)c(t)dt = Eb
0
Z Tb
s(t)c(t)dt = 0
0
5
00
B1
21
EC
2
05
Figure 2: Expected Output of Amplitude Shift Keying
0
Quadrature Amplitude-Shift Keying (QASK) Calculations
B1
QASK (Quadrature Amplitude-Shift Keying) transmits digital data by modulating the ampli-
tude of two carrier signals, c1 (t) and c2 (t), which are in 90 degrees out of phase. Each carrier
can be represented as:
ci (t) = Ac cos(2πfc t + ϕi ), i = 1, 2
21
where:
• ϕi is the phase of the i-th carrier signal (0 for c1 (t) and π/2 for c2 (t) to achieve quadra-
EC
ture)
The digital data stream is divided into two bit streams, b1 (t) and b2 (t). Each bit stream
modulates the amplitude of one carrier signal. The resulting QASK signal, s(t), can be
expressed as:
s(t) = Ac [b1 (t) cos(2πfc t) + b2 (t) cos(2πfc t + π/2)]
where:
Modulation Index: The modulation index in QASK is the normalized change in amplitude
relative to the unmodulated carrier amplitude.
3
MATLAB code ASK and waveforms
%E THARAKA RAM
%EC21B1005
% Bit Energy
Eb = 5;
% Signal Bit Frequency
fb = 10;
Tb = 1/fb;
% Sampling Frequency
fs = 100;
t = 0:0.01/fs:10/fb;
m_t = cos(2*pi*fs*t);
% Bit stream message
bs = [0,0,1,0,1,0,1,0,1,0,1,1,1,1,0,0,0,0,1,1];
% b = root(Eb)
05
b = sqrt(Eb).*round(imresize(bs,[1,length(m_t)]));
bask = sqrt(2*Eb/Tb)*m_t.*b;
E = zeros(1,length(m_t));
for i = 1:length(m_t)
if(abs(bask(i))>0)
E(i) = sqrt(Eb);
else
0
B1
E(i) = 0;
end
end
figure; sgtitle("Amplitude ON-OFF Shift Keying-EC21B1005")
subplot(4,1,2);
21
plot(t,m_t);
title("Carrier Signal");
xlabel("Time(s)");
ylabel("Amplitude");
subplot(4,1,1);
EC
stairs(t,b);
title("Bit Stream Message");
xlabel("Time(s)");
ylabel("Amplitude");
subplot(4,1,3);
stairs(t,bask);
title("ASK Signal");
xlabel("Time(s)");
ylabel("Amplitude");
subplot(4,1,4);
stairs(t,E);
title("Recovered Digital Message");
xlabel("Time(s)");
ylabel("Amplitude");
4
Figure 3: ASK
05
MATLAB code for QASK and waveforms
%E THARAKA RAM
%EC21B1005
fc = 1000;
tb = 1 ;
eb = 3 ;
n = 100;
0
B1
t = linspace(1,n,fc);
b = randi([0,3],1,n);
code=de2bi(b,’left-msb’);
k=1;
for i=1:n
21
for j=1:2
cod(k)=code(i,j);
k=k+1;
end
i=i+1;
EC
end
c = sqrt(2/tb)*sin(4*pi*fc*t);
k=1;
for i=1:n
for j =1:fc/n
b1(k) = b(i)*sqrt(eb);
k=k+1;
end
end
s = c.*b1;
figure; sgtitle("QASK-EC21B1005")
subplot(4,1,1);stairs(cod),title(’Message Signal’);
subplot(4,1,2) ; plot(t,c) ; title(’Carrier Signal’);
subplot(4,1,3) ; plot(t,s);title(’Modulated Signal’ ) ;
for i=1:length(c)
if(abs(s(i))<sqrt(eb))
s1(i)=0;
5
elseif(abs(s(i))<sqrt(4*eb))
s1(i)= 1;
elseif(abs(s(i))<sqrt(9*eb))
s1(i) =2;
else
s1(i) = 3;
end
end
subplot(4,1,4);stairs(t,s1);
hold on
stairs(t,b1/sqrt(eb),’LineWidth’,1);
title(’Demodulated signal’);
5
00
B1
Figure 4: QASK
21
Inference
EC
BASKexhibited a higher BER(Bit error rate) compared to QASK.Hence QASK is more robust
to noise in the transmission channel.BASK’s susceptibility to noise is demonstrable, highlight-
ing recovered signal degrada tion.QASK achieved a higher data rate compared to BASK for
the same bandwidth because QASKtransmits two bits per symbol using amplitude variations,
while BASK transmits only one bit per symbol.
Results
The Ampltide shift Keying and the Demodulation of these Modulated signals on binary and
quarternary levels were observed and the outputs are verified successfully