{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "c45430be",
            "cell_type": "markdown",
            "source": "<div class='alert alert-warning'>\n\nSciPy's interactive examples with Jupyterlite are experimental and may not always work as expected. Execution of cells containing imports may result in large downloads (up to 60MB of content for the first import from SciPy). Load times when importing from SciPy may take roughly 10-20 seconds. If you notice any problems, feel free to open an [issue](https://github.com/scipy/scipy/issues/new/choose).\n\n</div>",
            "metadata": {}
        },
        {
            "id": "72babd62",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "import scipy.fft\nimport numpy as np\nscipy.fft.fft(np.exp(2j * np.pi * np.arange(8) / 8))",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "array([-2.33486982e-16+1.14423775e-17j,  8.00000000e+00-1.25557246e-15j,\n        2.33486982e-16+2.33486982e-16j,  0.00000000e+00+1.22464680e-16j,\n       -1.14423775e-17+2.33486982e-16j,  0.00000000e+00+5.20784380e-16j,\n        1.14423775e-17+1.14423775e-17j,  0.00000000e+00+1.22464680e-16j])"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "f13d9036",
            "cell_type": "markdown",
            "source": "In this example, real input has an FFT which is Hermitian, i.e., symmetric\nin the real part and anti-symmetric in the imaginary part:\n",
            "metadata": {}
        },
        {
            "id": "c1743056",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "from scipy.fft import fft, fftfreq, fftshift\nimport matplotlib.pyplot as plt\nt = np.arange(256)\nsp = fftshift(fft(np.sin(t)))\nfreq = fftshift(fftfreq(t.shape[-1]))\nplt.plot(freq, sp.real, freq, sp.imag)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "[<matplotlib.lines.Line2D object at 0x...>,\n <matplotlib.lines.Line2D object at 0x...>]"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "3c92f904",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "plt.show()",
            "outputs": []
        }
    ]
}