{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Wigner-Ville Distribution of Chirps with Different Slopes\n\nThis example demonstrates the Wigner-Ville distribution of a signal\ncomposed of two chirps with Gaussian amplitude modulation but havind linear\nfrequency modulations with different slopes. Note that the AF interference\nterms are located away from the origin. We can see the two distint signal\nterms, but there is some interference around the middle.\n\nFigure 4.12 from the tutorial.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from tftb.generators import fmlin, amgauss\nfrom tftb.processing import WignerVilleDistribution\nimport numpy as np\n\nn_points = 64\nsig1 = fmlin(n_points, 0.2, 0.5)[0] * amgauss(n_points)\nsig2 = fmlin(n_points, 0.3, 0)[0] * amgauss(n_points)\nsig = np.hstack((sig1, sig2))\n\ntfr = WignerVilleDistribution(sig)\ntfr.run()\ntfr.plot(kind='contour', show_tf=True)"
      ]
    }
  ],
  "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
}