electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

Demodulate FSK signal Matlab


Post new topic  Reply to topic    EDAboard.com Forum Index -> Digital communication -> Demodulate FSK signal Matlab
Author Message
lynx_z3



Joined: 19 Feb 2007
Posts: 1


Post03 Nov 2009 21:34   

Demodulate FSK signal Matlab


hi i need help in writing the demodulation code for the FSK system below any help would be appreciated. cause i have no idea how to move forward with this

Code:

function bfsk_project(g,f0,f1)
if nargin > 3
    error('Too many input arguments')
elseif nargin==1
    f0=1;
    f1=2;
elseif nargin==2
    f1=2;
end

val0=ceil(f0)-f0;
val1=ceil(f1)-f1;
if val0 ~=0 || val1 ~=0;
    error('Frequency must be an integer');
end

if f0<1 || f1<1;
    error('Frequency must be bigger than 1');
end

t=0:2*pi/99:2*pi;
cp=[];
cp1=[];
sp=[];
sp1=[];
mod=[];
mod1=[];
bit=[];
bit1=[];
noise_amp = 0.1;% set noise level 0.1~=6dB=SNR=Eb/No

%Channel Coding using repetition Code (3,1)
h = repmat(g,3,1); % to repeat the matrix
res = reshape(h, 1,3*(length(g)));% to resize the matrix

%Binary Pulse Shaping
for n=1:length(g);
    if g(n)==0;
        die1=ones(1,100);
        c1=sin(f0*t);
        se1=zeros(1,100);
    else g(n)=1;
        die1=ones(1,100);
        c1=sin(f1*t);
        se1=ones(1,100);
    end
    cp1=[cp1 die1];
    mod1=[mod1 c1];
    bit1=[bit1 se1];
end
   
%Binary Pulse Shaping for Encoded Signal
for n=1:length(res);
    if res(n)==0;
        die=ones(1,100);
        c=sin(f0*t);
        se=zeros(1,100);
    else res(n)=1;
        die=ones(1,100);
        c=sin(f1*t);
        se=ones(1,100);
    end
    cp=[cp die];
    mod=[mod c];
    bit=[bit se];
end



%FSK Modulation
fsk=cp.*mod;

% Add White Noise to Modulated FSK Signal
noise_awgn = noise_amp*randn(1,length(fsk));% noise generator
fsk_noise = fsk + noise_awgn;%modulated carrier plus noise

% Graphics
subplot(6,1,1);plot(bit1,'LineWidth',1.5);grid on;
title('Binary Signal');
axis([0 100*length(g) -2.5 2.5]);

subplot(6,1,2);plot(bit,'LineWidth',1.5);grid on;
title('Binary Signal w/ Error Correction (3,1) Repetition Code');
axis([0 100*length(res) -2.5 2.5]);

subplot(6,1,3);plot(fsk,'LineWidth',1.5);grid on;
title('FSK modulation');
axis([0 100*length(res) -2.5 2.5]);

subplot(6,1,4);plot(noise_awgn,'LineWidth',1.5);grid on;
title('Additive White Gaussian Noise');
axis([0 100*length(res) -2.5 2.5]);

subplot(6,2,7);plot(fsk_noise,'LineWidth',1.5);grid on;
title('FSK modulation w/ white noise');
axis([0 100*length(res) -2.5 2.5]);
Back to top
Google
AdSense
Google Adsense




Post03 Nov 2009 21:34   

Ads




Back to top
Aya2002



Joined: 12 Dec 2006
Posts: 1409
Helped: 254
Location: Iraq


Post03 Nov 2009 21:49   

Demodulate FSK signal Matlab


see this post http://www.edaboard.com/viewtopic.php?t=357466&highlight=fsk

i think it will help you
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Digital communication -> Demodulate FSK signal Matlab
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
How to Demodulate FSK???? (4)
how to demodulate FSK in low data rate radio? (3)
how to demodulate a signal without carrier (2)
How to demodulate UHF RFID Tag and Reader signal... (1)
FSK: Matlab Simulation (3)
SSB , FSK demodulators matlab code (1)
[help]Digital Pll for decoding FSK signal (4)
Need help on my work...FSK modulator by using MATLAB (2)
Need matlab file for FSK Modulation and Demodulation (1)
gmsk modulate/demodulate (7)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS