.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_3_1_4_atoms_hamming_stft.py: ============================================================ STFT of Gaussian Wave Packets with a Hamming Analysis Window ============================================================ This example demonstrates the construction of a signal containing two transient components, having the same Gaussian amplitude modulation and the same frequency, but different time centers. It also shows the effect of a Hamming window function when used with th STFT. Figure 3.7 from the tutorial. .. image:: /auto_examples/images/sphx_glr_plot_3_1_4_atoms_hamming_stft_001.png :class: sphx-glr-single-img .. code-block:: default import numpy as np import matplotlib.pyplot as plt from tftb.generators import atoms from scipy.signal import hamming from tftb.processing.linear import ShortTimeFourierTransform coords = np.array([[45, .25, 32, 1], [85, .25, 32, 1]]) sig = atoms(128, coords) x = np.real(sig) window = hamming(65) stft = ShortTimeFourierTransform(sig, n_fbins=128, fwindow=window) stft.run() stft.plot(show_tf=True, cmap=plt.cm.gray) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.476 seconds) .. _sphx_glr_download_auto_examples_plot_3_1_4_atoms_hamming_stft.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_3_1_4_atoms_hamming_stft.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_3_1_4_atoms_hamming_stft.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_