") >>> ax0.plot(t, x_lin) >>> plt.show() The following four plots each show the short-time Fourier transform of a chirp ranging from 45 Hz to 5 Hz with different values for the parameter `method` (and `vertex_zero`): >>> x_qu0 = chirp(t, f0=45, f1=5, t1=N*T, method='quadratic', vertex_zero=True) >>> x_qu1 = chirp(t, f0=45, f1=5, t1=N*T, method='quadratic', vertex_zero=False) >>> x_log = chirp(t, f0=45, f1=5, t1=N*T, method='logarithmic') >>> x_hyp = chirp(t, f0=45, f1=5, t1=N*T, method='hyperbolic') ... >>> win = gaussian(50, std=12, sym=True) >>> SFT = ShortTimeFFT(win, hop=2, fs=1/T, mfft=800, scale_to='magnitude') >>> ts = ("'quadratic', vertex_zero=True", "'quadratic', vertex_zero=False", ... "'logarithmic'", "'hyperbolic'") >>> fg1, ax1s = plt.subplots(2, 2, sharex='all', sharey='all', ... figsize=(6, 5), layout="constrained") >>> for x_, ax_, t_ in zip([x_qu0, x_qu1, x_log, x_hyp], ax1s.ravel(), ts): ... aSx = abs(SFT.stft(x_)) ... im_ = ax_.imshow(aSx, origin='lower', aspect='auto', extent=SFT.extent(N), ... cmap='plasma') ... ax_.set_title(t_) ... if t_ == "'hyperbolic'": ... fg1.colorbar(im_, ax=ax1s, label='Magnitude $|S_z(t,f)|$') >>> _ = fg1.supxlabel("Time $t$ in Seconds") # `_ =` is needed to pass doctests >>> _ = fg1.supylabel("Frequency $f$ in Hertz") >>> plt.show() Finally, the short-time Fourier transform of a complex-valued linear chirp ranging from -30 Hz to 30 Hz is depicted: >>> z_lin = chirp(t, f0=-30, f1=30, t1=N*T, method="linear", complex=True) >>> SFT.fft_mode = 'centered' # needed to work with complex signals >>> aSz = abs(SFT.stft(z_lin)) ... >>> fg2, ax2 = plt.subplots() >>> ax2.set_title(r"Linear Chirp from $-30\,$Hz to $30\,$Hz") >>> ax2.set(xlabel="Time $t$ in Seconds", ylabel="Frequency $f$ in Hertz") >>> im2 = ax2.imshow(aSz, origin='lower', aspect='auto', ... extent=SFT.extent(N), cmap='viridis') >>> fg2.colorbar(im2, label='Magnitude $|S_z(t,f)|$') >>> plt.show() Note that using negative frequencies makes only sense with complex-valued signals. Furthermore, the magnitude of the complex exponential function is one whereas the magnitude of the real-valued cosine function is only 1/2. y