Home of RF and Wireless Vendors and Resources

One Stop For Your RF and Wireless Need

FSK matlab code | FSK modulation matlab source code

This page of MATLAB source code covers FSK matlab code. The output plots and mathematical equations of FSK modulation matlab code are mentioned. FSK modulation stands for Frequency Shift Keying Modulation.

Introduction:
The FSK modulation is a digital modulation technique in which frequency of the carrier signal varies in accordance to the digital binary data (1 or 0). Binary logic-1 represents higher carrier frequency (i.e. 'f1') and logic-0 represents lower carrier frequency (i.e. 'f2') .

FSK modulation
Fig.2 FSK Modulation

The figure-1 depicts FSK modulation type. As shown inputs are digital binary data and analog carrier while output is analog FSK modulated signal. FSK modulation offers increased immunity against noise at the cost of larger bandwidth. Also refer difference between ASK, FSK and PSK modulation types>>.

FSK matlab code

clear;
clc;
b = input('Enter the Bit stream \n '); %b = [0 1 0 1 1 1 0];
n = length(b);
t = 0:.01:n;
x = 1:1:(n+1)*100;
for i = 1:n
if (b(i) == 0)
b_p(i) = -1;
else
b_p(i) = 1;
end
for j = i:.1:i+1
bw(x(i*100:(i+1)*100)) = b_p(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)
grid on ; axis([0 n -2 +2])
subplot(4,1,2)
plot(t,sinHt)
grid on ; axis([0 n -2 +2])
subplot(4,1,3)
plot(t,sinLt)
grid on ; axis([0 n -2 +2])
subplot(4,1,4)
plot(t,st)
grid on ; axis([0 n -2 +2])
Fs=1;
figure %pburg(st,10)
periodogram(st)

Input and Output of FSK modulation matlab source code

Run the downloaded FSKModulation.m file after unzipping the folder. and provide input as follows.

FSK matlab code input

After the input is given press "ENTER" key, you will get output matlab image as below.

FSK matlab code output

DOWNLOAD FSK matlab code .m file

Download FSKModulation rar file containing matlab file>>.


Useful Links to MATLAB codes

Refer following as well as links mentioned on left side panel for useful MATLAB codes.
OFDM Preamble generation  Time off estimation corr  Freq off estimation corr  channel estimation  11a WLAN channel  PN sequence generation  OFDMA Tx Rx  AES DES  carrier aggregation  CCDF  FIR Filter  IIR Filter  Low Pass FIR  Viterbi decoder  CRC8 CRC32 

RF and Wireless tutorials

WLAN  802.11ac  802.11ad  wimax  Zigbee  z-wave  GSM  LTE  UMTS  Bluetooth  UWB  IoT  satellite  Antenna  RADAR 


Share this page

Translate this page