I want to do a comparison of power spectral density of BFSK, 4FSK and 8FSK by using matlab baseband
module "fskmod"
.Following is the code:
M = 2;
freqsep = 32;
nsamp = 4;
Fs = 64;
x = randint(1000,1,M); % Random signal
y = fskmod(x,M,freqsep,nsamp,Fs); % Modulate.
ly = length(y);
% Create an FFT plot.
freq = [-Fs/2 : Fs/ly : Fs/2 - Fs/ly];
Syy = 10*log10(fftshift(abs(fft(y))));
plot(freq,Syy)
With this configuration, I get a very good spectrum but when I change nsamp to 8 or any other value,multiple lobes start to appear between two frequencies. The confusion is in the understanding of the relation of nsamp and frequency separation. Could any one solve this confusion???
randint
(replaced byrandi
), but check if the maximum value ofx
isM-1
(and notM
!). $\endgroup$ – Matt L. Jan 10 '15 at 11:52