Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need matlab file for FSK Modulation and Demodulation

Status
Not open for further replies.

abcyin

Full Member level 4
Joined
Apr 15, 2005
Messages
236
Helped
12
Reputation
24
Reaction score
3
Trophy points
1,298
Activity points
2,855
Hi, all

could anyone provide me the matlab file for FSK modulation and demodulation, or any links is also welcome, I would appreciate it.

Thanks in advance.
Best regards
 

Find the matlab code below:

%FSK Modulation
bit = round(rand(1,10)); % bit stream of random 1's and 0's
bitperiod = 0.01; %bit period
fs = 15000; %sampling frequency
fc = [3000 5000]; % carrier frequency
% create the FSK signal
L=length(0:(bitperiod/1500):bitperiod);
transmitted = zeros(1,L);
for k = 1:length(bit)
f = fc(bit(k) + 1);
transmitted((k-1)*L+1: k*L) =
cos(2*pi*f*(0:(bitperiod/1500):bitperiod));
%transmitted()=transmitted()+2*randn(size(0.01));
%stem(transmitted);%fsk verified
%y = filter(b,a,transmitted);
end
plot(transmitted);

%FSK Demodulation
demod_output=zeros(1,10);
A=zeros(L,1);
%B=zeros(L,1);
Decision=0;
%Logic_0=0;
A=transpose(cos(2*pi*5000*(0:(bitperiod/1500):bitperiod))-cos(2*pi*300
0*(0:(bitperiod/1500):bitperiod)));
%B=transpose(cos(2*pi*5000*(0:(bitperiod/1500):bitperiod)));
for x = 1:length(bit)
Decision= transmitted((x-1)*L+1: x*L)*A;
%Logic_0= transmitted((x-1)*L+1: x*L)*A;
if Decision>0
demod_output(x)=1;
else
demod_output(x)=0;
end
stem(demod_output);
end
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top