{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# STFT of Gaussian Wave Packets with a Hamming Analysis Window\n\nThis example demonstrates the construction of a signal containing two transient\ncomponents, having the same Gaussian amplitude modulation and the same\nfrequency, but different time centers. It also shows the effect of a Hamming\nwindow function when used with th STFT.\n\nFigure 3.7 from the tutorial.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import numpy as np\nimport matplotlib.pyplot as plt\nfrom tftb.generators import atoms\nfrom scipy.signal import hamming\nfrom tftb.processing.linear import ShortTimeFourierTransform\n\ncoords = np.array([[45, .25, 32, 1], [85, .25, 32, 1]])\nsig = atoms(128, coords)\nx = np.real(sig)\nwindow = hamming(65)\nstft = ShortTimeFourierTransform(sig, n_fbins=128, fwindow=window)\nstft.run()\nstft.plot(show_tf=True, cmap=plt.cm.gray)"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.7.9"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}