You are on page 1of 5

To perform ASK using Matlab.

Definition:
Amplitude-shift keying (ASK) is a form of amplitude modulation that represents digital data as
variations in the amplitude of a carrier wave.

Explanation:
Any digital modulation scheme uses a finite number of distinct signals to represent digital data.
ASK uses a finite number of amplitudes, each assigned a unique pattern of binary digits.
Usually, each amplitude encodes an equal number of bits. Each pattern of bits forms
thesymbol that is represented by the particular amplitude. The demodulator, which is designed
specifically for the symbol-set used by the modulator, determines the amplitude of the received
signal and maps it back to the symbol it represents, thus recovering the original
data.Frequency and phase of the carrier are kept constant.

Encoding:
clc;
clearall;
b = input('Enter the Bit stream = ');
n = length(b);
t = 0:0.01:n;
x = 1:1:(n+1)*100;
for i = 1:n
for j = i:0.1:i+1
bw(x(i*100:(i+1)*100)) = b(i);
end
end
bw = bw(100:end);
sint = sin(2*pi*t);
st = bw.*sint;
subplot(3,1,1);
plot(t,bw);
xlabel('n ---->');
ylabel('Amplitude ---->');
title('Input Bit Stream');
gridon ;
axis([0 n -2 +2]);
subplot(3,1,2);
plot(t,sint);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('Carrier Wave');
gridon ;
axis([0 n -2 +2]);
subplot(3,1,3);
plot(t,st);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('ASK Wave');
gridon ;
axis([0 n -2 +2]);

Results:

To perform FSK using Matlab.

Definition:
Frequency-shift keying (FSK) is a frequency modulation scheme in which digital information is
transmitted through discrete frequency changes of a carrier wave.[1] The simplest FSK
is binary FSK (BFSK). BFSK uses a pair of discrete frequencies to transmit binary (0s and 1s)
information.[2] With this scheme, the "1" is called the mark frequency and the "0" is called the
space frequency. The time domain of an FSK modulated carrier is illustrated in the figures to the
right.

Explanation: Minimum frequency-shift keying or minimum-shift keying (MSK) is a


particular spectrally efficient form of coherent FSK. In MSK, the difference between the higher
and lower frequency is identical to half the bit rate. Consequently, the waveforms that represent
a 0 and a 1 bit differ by exactly half a carrier period. The maximum frequency deviation is
δ = 0.25 fm, wherefm is the maximum modulating frequency. As a result, the modulation
index m is 0.25. This is the smallest FSKmodulation index that can be chosen such that the
waveforms for 0 and 1 are orthogonal. A variant of MSK called GMSK is used in
the GSM mobile phone standard. Audio frequency-shift keying (AFSK) is
a modulation technique by which digital data is represented by changes in thefrequency (pitch)
of an audio tone, yielding an encoded signal suitable for transmission via radio or telephone.
Normally, the transmitted audio alternates between two tones: one, the "mark", represents
a binary one; the other, the "space", represents a binary zero.

AFSK differs from regular frequency-shift keying in performing the modulation


at baseband frequencies. In radio applications, the AFSK-modulated signal normally is being
used to modulate an RF carrier (using a conventional technique, such as AM or FM) for
transmission.

AFSK is not always used for high-speed data communications, since it is far less efficient in
both power and bandwidth than most other modulation modes. In addition to its simplicity,
however, AFSK has the advantage that encoded signals will pass through AC-coupled links,
including most equipment originally designed to carry music or speech.

AFSK is used in the U.S. based Emergency Alert System to notify stations of the type of
emergency, locations affected, and the time of issue without actually hearing the text of the
alert.

Encoding:
clc;
clearall;
b = input('Enter the bit stream = ');
n = length(b);
t = 0:0.01:n;
x = 1:1:(n+1)*100;
for i = 1:n
if (b(i) == 0)
u(i) = -1;
else
u(i) = 1;
end
for j = i:0.1:i+1
bw(x(i*100:(i+1)*100)) = u(i);
end
end
bw = bw(100:end);
wo = 2*(2*pi*t);
W = 1*(2*pi*t);
sinHt = sin(wo+W);
sinLt = sin(wo-W);
st = sin(wo+(bw).*W);
subplot(4,1,1);
plot(t,bw);
xlabel('n ---->');
ylabel('Amplitude ---->');
title('Input Bit Stream');
gridon ;
axis([0 n -2 +2]);
subplot(4,1,2);
plot(t,sinHt);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('Carrier Wave 1');
gridon ;
axis([0 n -2 +2]);
subplot(4,1,3);
plot(t,sinLt);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('Carrier Wave 2');
gridon ;
axis([0 n -2 +2]);
subplot(4,1,4);
plot(t,st);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('BFSK Wave');
gridon ;
axis([0 n -2 +2]);

Results:

You might also like