{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Narrow Band Ambiguity Function of Chirps with Different Slopes\n\nThis example demonstrates the narrow band ambiguity function (AF) 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.\n\nFigure 4.13 from the tutorial.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from tftb.generators import fmlin, amgauss\nfrom tftb.processing.ambiguity import narrow_band\nimport numpy as np\nimport matplotlib.pyplot as plt\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, x, y = narrow_band(sig)\nplt.contour(2 * x, y, np.abs(tfr) ** 2, 16)\nplt.title('Narrow Band ambiguity function')\nplt.xlabel('Delay')\nplt.ylabel('Doppler')\nplt.grid(True)\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
}