Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Discussion Groups

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

Fsk code - naim...@yahoo.com.sg - Jul 24 9:11:04 2007



Hi,I would like to ask about my Fsk code.Why when i change my ts value to 0.05 or
0.005,i'm not able to get the correct Fsk signal?Anybody can help me?Below is what my code
looks like..

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')

Thanks.
Best regards,Naimah.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )