I have a signal in MATLAB on which I'd like to perform an FFT. My signal is stored in s, and I use the code below (inspired by the MATLAB help):
L = length(s); nfft = 2^nextpow2(L); S = fft(s,nfft)/L; fftf = 1/Ts/2*linspace(0,1,nfft/2+1); ffts = (2*abs(S(1:nfft/2+1)));
My signal s is a GMSK-modulated one, that is, it varies between $f_c-2.4e3$ and $f_c+2.4e3$ in my case when transmitting 0 or 1, respectively. $f_c$ is set to 100kHz. For a long input, say, 250 bits worth of 1's and 250 bits worth of 0's, I get what I expect, see the first image below.
If I instead choose a low number of bits, say 10 1 bits followed by 10 0 bits, I get as expected, but it is shifted down to ~90kHz instead of centered at 100kHz. This is something I can't quite understand - it seems changing the sample rate and length of the FFT changes absolutely nothing.
Can anyone explain to me why? Thanks in advance!
EDIT: I'm not allowed to post pictures, so here's some links instead.