FSK ERROR CONTROL CODE!!!

by barkkathulla 2012-09-21 09:47:28

echo on
t0=0.6; %signal duration
ts=0.0005; %sampling interval
fc=200; %carrier frequency
kf=50; %modulation index
fs=1/ts; %sampling frequency
t=(0:ts:t0); %time vector
df=0.25; %required fequency deviation
m=[ones(1,t0/(3*ts)),-1*ones(1,t0/(3*ts)),zeros(1,t0/(3*ts)+1)]; %message
signal
int_m(1)=0;
for i=1:length(t)-1%integral of m
int_m(i+1)=int_m(i)+m(i)*ts;
end
[M,m,df1]=fftseq(m,ts,df); %Fourier transform
M=M/fs; %scaling
f=(0:df1:df1*(length(m)-1))-fs/2; %frequency vector
u=cos(2*pi*fc*t+2*pi*kf*int_m); %modulated fsk signal
[U,u,df1]=fftseq(u,ts,df); %Fourier transform
U=U/fs; %scaling
pause %Press any key to see a plot of the message & fsk signal in time
domain
subplot(2,1,1)
plot(t,m(1:length(t)),'g')
axis([0 0.6 -2 2])
xlabel('Time(sec)') %xlabel heading of message signal
ylabel('Amplitude') %ylabel heading of message signal
title('Message signal')
subplot(2,1,2)
plot(t,u(1:length(t)))
axis([0 0.6 -2 2])
xlabel('Time(sec)') %xlabel heading of Fsk signal
ylabel('Signal Amplitude') %ylabel heading of Fsk signal
title('Fsk signal')
1484
like
0
dislike
0
mail
flag

You must LOGIN to add comments