{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Linear Frequency Modulation\n\nThis example shows how PyTFTB is used to generate a signal with linear\nfrequency modulation. Such a signal is also called a [chirp](https://en.wikipedia.org/wiki/Chirp).\n\nFigure 1.1 from the tutorial.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from tftb.generators import fmlin\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Generate a chirp signal\n\nn_points = 128\nfmin, fmax = 0.0, 0.5\n\nsignal, _ = fmlin(n_points, fmin, fmax)\nplt.plot(np.real(signal))\nplt.xlim(0, n_points)\nplt.title('Linear Frequency Modulation')\nplt.ylabel('Real Part')\nplt.xlabel('Time')\nplt.grid()\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
}