{
    "nbformat": 4,
    "nbformat_minor": 5,
    "metadata": {
        "kernelspec": {
            "display_name": "Python",
            "language": "python",
            "name": "python"
        },
        "language_info": {
            "name": "python"
        }
    },
    "cells": [
        {
            "id": "37b039a3",
            "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": "2a112cd4",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "from scipy import signal",
            "outputs": []
        },
        {
            "id": "4ca8b325",
            "cell_type": "markdown",
            "source": "Confirm COLA condition for rectangular window of 75% (3/4) overlap:\n",
            "metadata": {}
        },
        {
            "id": "a0cbe3e7",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "signal.check_COLA(signal.windows.boxcar(100), 100, 75)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "True"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "fe3eb02b",
            "cell_type": "markdown",
            "source": "COLA is not true for 25% (1/4) overlap, though:\n",
            "metadata": {}
        },
        {
            "id": "571021b4",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "signal.check_COLA(signal.windows.boxcar(100), 100, 25)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "False"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "8f96d6a2",
            "cell_type": "markdown",
            "source": "\"Symmetrical\" Hann window (for filter design) is not COLA:\n",
            "metadata": {}
        },
        {
            "id": "44077192",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "signal.check_COLA(signal.windows.hann(120, sym=True), 120, 60)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "False"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "de27733c",
            "cell_type": "markdown",
            "source": "\"Periodic\" or \"DFT-even\" Hann window (for FFT analysis) is COLA for\noverlap of 1/2, 2/3, 3/4, etc.:\n",
            "metadata": {}
        },
        {
            "id": "3ab607b6",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "signal.check_COLA(signal.windows.hann(120, sym=False), 120, 60)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "True"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "0be102da",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "signal.check_COLA(signal.windows.hann(120, sym=False), 120, 80)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "True"
                    },
                    "execution_count": null
                }
            ]
        },
        {
            "id": "8d3d60e3",
            "cell_type": "code",
            "metadata": {},
            "execution_count": null,
            "source": "signal.check_COLA(signal.windows.hann(120, sym=False), 120, 90)",
            "outputs": [
                {
                    "output_type": "execute_result",
                    "metadata": {},
                    "data": {
                        "text/plain": "True"
                    },
                    "execution_count": null
                }
            ]
        }
    ]
}