{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Time-frequency Resolution: Long Analysis Window\n\nThis example shows the effect of an analysis window which is long in time on\nthe time-frequency resolution. Specifically, longer windows have good frequency\nresolutions but poor time resolutions.\n\nFigure 3.6 from the tutorial.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import numpy as np\nfrom tftb.processing.linear import ShortTimeFourierTransform\nfrom tftb.generators import fmlin, amgauss\nimport matplotlib.pyplot as plt\n\nx = np.real(amgauss(128) * fmlin(128)[0])\nwindow = np.ones((128,))\nstft = ShortTimeFourierTransform(x, 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
}