{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Group Delay Estimation of a Chirp\n\nConstuct a chirp and estimates its [group delay](https://en.wikipedia.org/wiki/Group_delay_and_phase_delay).\n\nFigure 2.4 from the tutorial.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from tftb.generators import fmlin\nfrom tftb.processing import group_delay\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nsignal, _ = fmlin(256)\nfnorm = np.linspace(0, .5, 10)\ngd = group_delay(signal, fnorm)\nplt.plot(gd, fnorm)\nplt.grid(True)\nplt.xlim(0, 256)\nplt.xlabel('Time')\nplt.ylabel('Normalized Frequency')\nplt.title('Group Delay Estimation')\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
}