I'm interested to hear what people think should happen. The phase washes out in the PSD, and the CSD only cares about the relative phases of the signals, so the issue I described above doesn't matter. The only thing I can imagine the complex spectrogram output being useful for (which, incidentally is how I stumbled across this) is for computing many permutations of PSDs and CSDs, so you don't have to repeat FFTs. ilevleri: https: ///doc/scipy/reference/generated/ ve : https: /// doc / scipy / referans. In maplotlib.mlab, these modes are only accessible by functions that only compute one FFT segment (i.e. I wonder if plt. The problem is the way that we plot the graph. So, it seems there is no problem with the after all.
from scipy.signal import spectrogram import pylab as plt import numpy as np PerEch 20 N 512 time np.arange (N) / float (PerEch) newsa np.sin (2np.pi2time) newsa + np.sin (2np.pi8time) newsa + np.random.randn (N) plt. So, for any realistic signal, the results will be all over the place. The graph generated is almost the same as the graph generated by the second method. You need to make sure to make sure you define your time axis and PerEch correctly. Users need to specify parameters such as 'window size', 'the number of time points to overlap' and 'sampling rates'. There are lots of Spect4ogram modules available in python e.g. Spectrogram is an awesome tool to analyze the properties of signals that evolve over time.
Monochromatic signals will result in a varying phase over segments if the interval between segments is not a factor of the signal's period, which will almost generically be the case. Implement the Spectrogram from scratch in python. Thinking about this a little more, it's a little weird to ask for complex or phase output in a spectrogram way, i.e.