{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Ideal time resolution\n\nThis example demonstrates that only the shortest possible window can provide\nideal resolution in time.\n\nFigure 3.5 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\nfrom matplotlib.pyplot import cm\n\nx = np.real(amgauss(128) * fmlin(128)[0])\nwindow = np.array([1])\nstft = ShortTimeFourierTransform(x, n_fbins=128, fwindow=window)\ntfr, _, _ = stft.run()\n\nstft.plot(show_tf=True, cmap=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
}