{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Generating a Noisy Chirp\n\nThis example shows how to generate a chirp signal, with some analytical\ngaussian noise, and the usage of the `sigmerge` function to combine them.\n\nFigure 1.4 from the tutorial.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from tftb.generators import fmlin, sigmerge, noisecg\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)\n\n# Noisy chirp\n\nnoisy_signal = sigmerge(signal, noisecg(128), 0)\nplt.plot(np.real(noisy_signal))\nplt.xlim(0, 128)\nplt.title('Noisy chirp')\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
}