{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Wigner-Hough Transform of a Chirp\n\nThis example demonstrates the use of the Hough transform to extract the\nestimates of a chirp signal from its Wigner Ville distribution.\n\nFigure 5.4 from the tutorial.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import numpy as np\nfrom tftb.generators import noisecg, sigmerge, fmlin\nfrom tftb.processing.cohen import WignerVilleDistribution\nfrom tftb.processing.postprocessing import hough_transform\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\nN = 64\nsig = sigmerge(fmlin(N, 0, 0.3)[0], noisecg(N), 1)\ntfr, _, _ = WignerVilleDistribution(sig).run()\n\nht, rho, theta = hough_transform(tfr, N, N)\ntheta, rho = np.meshgrid(theta, rho)\nfig = plt.figure()\nax = fig.gca(projection='3d')\nax.plot_wireframe(theta, rho, ht)\nax.set_xlabel('Theta')\nax.set_ylabel('Rho')\nplt.show()"
      ]
    }
  ],
  "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
}