{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Distant Chirps with a Long Gaussian Analysis Window\n\nThis example visualizes a spectrogram of two chirp signals which are well\nseparated in frequency ranges. A longer Gaussian analysis window suffices here\nto see the separation of frequencies, since the variation in frequencies is\nrelatively slow.\n\nFigure 3.18 from the tutorial.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from tftb.generators import fmlin\nfrom tftb.processing.cohen import Spectrogram\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nsig = fmlin(128, 0, 0.3)[0] + fmlin(128, 0.2, 0.5)[0]\nwindow = np.exp(np.log(0.005) * np.linspace(-1, 1, 63) ** 2)\nspec = Spectrogram(sig, fwindow=window, n_fbins=128)\nspec.run()\nspec.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
}