{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Wigner-Ville Distribution of a Chirp\n\nConstruct a chirp signal and visualize its [Wigner-Ville distribution](https://en.wikipedia.org/wiki/Wigner_distribution_function).\n\nFigure 1.3 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 WignerVilleDistribution\n\nn_points = 128\nfmin, fmax = 0.0, 0.5\nsignal, _ = fmlin(n_points, fmin, fmax)\n\n# Wigner-Ville distribution of the chirp.\n\nwvd = WignerVilleDistribution(signal)\nwvd.run()\nwvd.plot(kind='contour', extent=[0, n_points, fmin, fmax])"
      ]
    }
  ],
  "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
}