In: Electrical Engineering
My projects is to write or find Matlab code for 4FSK(frequency shift keying) with simulation pictures and create the signal after that add noise to it and finally demodulate it ..
Please help me to do this project.
FOR FSK MODULATION:
%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);
FOR FSK DEMODULATION:
%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