# Homework Help: FSK Modulator/MATLAB

1. May 1, 2012

### StumpyHuck29

I truly have no idea what I am doing and I am awful at MATLAB. My senior elective Digital Communications course has been plaguing me with it.

1. The problem statement, all variables and given/known data

Use MATLAB to implement a binary continuous-phase FSK modulator. Make the symbols 100 samples long and the carrier have 10 samples/cycle. One approach is to first generate a data signal, data(k), in which each bit value(+1 or -1) is repeated 100 times. Next, generate the phase of the FSK signal as:

phi(k)=phi(k-1)+2*pi/10+data(k)*h*pi/100

where the second term on the right is the phase increment for each sample due to the carrier and the third term is the phase increment due to the data. The FSK signal is s(k)=cos[phi(k)]

a)Generate Sunde's FSK(h=1) for 10000 random data bits. Plot and estimate the power spectrum of the signal, i.e. plot 20*log10(abs(fft_output))

2. Relevant equations

All shown above

3. The attempt at a solution

My attempt:

h=1;
data= [1 -1 1 -1 1 -1 1 1 -1 1
1 -1 1 -1 -1 1 -1 1 1 1
-1 -1 -1 1 1 1 -1 1 -1 1
-1 1 -1 1 1 1 -1 -1 1 -1
1 1 -1 1 -1 -1 1 -1 1 1
-1 1 -1 1 1 1 -1 -1 -1 -1
1 -1 1 -1 1 -1 -1 1 -1 1
1 -1 -1 -1 1 -1 1 1 1 1
1 1 1 1 -1 1 -1 1 1 -1
-1 1 1 -1 1 -1 1 -1 -1 -1];
phase=data-1+2*pi/10+data*h*pi/100;
s=cos(phase);
fs=fft(phase);
plot(fs);