I'm trying to create a spectrogram of a complex signal 'y', but I'm running into a problem where the spectrogram that I create appears to have its spectral features "displaced" in frequency space, and I think that it has something to do with not having pre-processed the signal correctly.
I know the signal's:
sampling rate (Fs = 400 KHz)
bits/sample (Nbits = 16)
frequency that the signal is centered on (Fc = 5.60 MHz)
total time that the signal elapses (dT ~ 145 sec).
I tried to use matlab's built-in spectrogram function with the following arguments:
[S, F, T] = spectrogram(y, num_pts_win, num_pts_overlap, num_pts_fft, Fs);
num_pts_win = num_pts_fft = 2^14
num_pts_overlap = 1/2 num_pts_win = 2^13
After subtracting Fs/2 from F to get a frequency axis from -Fs/2 -> Fs/2 rather than from 0->Fs, I plotted the spectrogram of the log(S) and obtained:
while I was expecting to get something like this:
I believe that this displacement of the spectral features has resulted from not accounting for the central/carrier frequency (Fc) anywhere, but as I'm sort of new at this, I don't really understand exactly how I should account for it.
To clarify, I suspect that the spectral features I'm seeing in the first graph are actually aliases of the true spectral features, and I think this aliasing is happening because I haven't accounted for the central/carrier frequency.
Edit 2: After FFTSHIFT'ing over the frequency dimension I think I've cleaned things up nicely!