I am trying to plot the spectrogram of a complex signal I generated. I have written code to generate this signal and plot the spectrogram. It works. However I see that there are two dark lines present within the spectrogram. I'm curious to know the reason for the existence of these. I have also noticed that by varying the NFFT, the dark lines tend wobble around.
I paste my code below:
import matplotlib.pyplot as plt import numpy as np import scipy.signal as signal def plot_spectrogram(data,NFFT,Fs,ex ): plt.specgram(data, NFFT=NFFT, Fs=Fs) plt.title("Spectrogram of data") plt.ylim(-Fs/2, Fs/2) plt.show() plt.close() if ex: exit() ### Parameters F_offset = 250000 Fs = 1140000 ### Generate a digital complex exponential with phase -F_offset/Fs fc1 = np.exp(-1.0j*2.0*np.pi* F_offset/Fs*np.arange(len(x1)) ) plot_spectrogram(fc1, 512, Fs,ex=True)