{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The defaults are chosen such that "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "signal.czt(x)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is equivalent to "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "fft.fft(x)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and, if "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "m > len(x)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", that "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "signal.czt(x, m)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is equivalent to "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "fft.fft(x, m)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If the transform needs to be repeated, use "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "CZT",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.signal._czt:CZT"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " to construct a specialized transform function which can be reused without recomputing constants."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "An example application is in system identification, repeatedly evaluating small slices of the z-transform of a system, around where a pole is expected to exist, to refine the estimate of the pole's true location. "
            },
            {
              "__type": "FootnoteReference",
              "__tag": 4066,
              "label": "1"
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "out",
              "annotation": "ndarray",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "An array of the same dimensions as "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", but with the length of the transformed axis set to "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "m"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Compute the frequency response around a spiral in the Z plane."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "x",
              "annotation": "array",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The signal to transform."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "m",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The number of output points desired.  Default is the length of the input data."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "w",
              "annotation": "complex, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The ratio between points in each step.  This must be precise or the accumulated error will degrade the tail of the output sequence. Defaults to equally spaced points around the entire unit circle."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "a",
              "annotation": "complex, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The starting point in the complex plane.  Default is 1+0j."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "axis",
              "annotation": "int, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Axis over which to compute the FFT. If not given, the last axis is used."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "build-install/usr/lib/python3.14/site-packages/scipy/signal/_czt.py",
  "item_line": 376,
  "item_type": "function",
  "aliases": [
    "scipy.signal.czt"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "Generate a sinusoid:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nf1, f2, fs = 8, 10, 200  # Hz\nt = np.linspace(0, 1, fs, endpoint=False)\nx = np.sin(2*np.pi*t*f2)\nimport matplotlib.pyplot as plt\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.plot(t, x)\nplt.axis([0, 1, -1.1, 1.1])\n",
        "execution_status": "failure",
        "out": "(np.float64(0.0), np.float64(1.0), np.float64(-1.1), np.float64(1.1))\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.show()\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Figure",
        "__tag": 4024,
        "value": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "scipy",
          "version": "2.0.0.dev0+git20260907.41eeb59",
          "kind": "assets",
          "path": "fig-4c9803dc92a8ae38.png"
        }
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nIts discrete Fourier transform has all of its energy in a single frequency\nbin:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from scipy.fft import rfft, rfftfreq\nfrom scipy.signal import czt, czt_points\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.plot(rfftfreq(fs, 1/fs), abs(rfft(x)))\n",
        "execution_status": "failure",
        "out": "[<matplotlib.lines.Line2D object at 0x7f3f68637b60>]\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.margins(0, 0.1)\nplt.show()\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Figure",
        "__tag": 4024,
        "value": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "scipy",
          "version": "2.0.0.dev0+git20260907.41eeb59",
          "kind": "assets",
          "path": "fig-13dae93c6b07a836.png"
        }
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nHowever, if the sinusoid is logarithmically-decaying:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "x = np.exp(-t*f1) * np.sin(2*np.pi*t*f2)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.plot(t, x)\nplt.axis([0, 1, -1.1, 1.1])\n",
        "execution_status": "failure",
        "out": "(np.float64(0.0), np.float64(1.0), np.float64(-1.1), np.float64(1.1))\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.show()\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Figure",
        "__tag": 4024,
        "value": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "scipy",
          "version": "2.0.0.dev0+git20260907.41eeb59",
          "kind": "assets",
          "path": "fig-740bc2dba12fecbc.png"
        }
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nthe DFT will have spectral leakage:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.plot(rfftfreq(fs, 1/fs), abs(rfft(x)))\n",
        "execution_status": "failure",
        "out": "[<matplotlib.lines.Line2D object at 0x7f3f68848ad0>]\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.margins(0, 0.1)\nplt.show()\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Figure",
        "__tag": 4024,
        "value": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "scipy",
          "version": "2.0.0.dev0+git20260907.41eeb59",
          "kind": "assets",
          "path": "fig-cb251e338699c25e.png"
        }
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nWhile the DFT always samples the z-transform around the unit circle, the\nchirp z-transform allows us to sample the Z-transform along any\nlogarithmic spiral, such as a circle with radius smaller than unity:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "M = fs // 2  # Just positive frequencies, like rfft\na = np.exp(-f1/fs)  # Starting point of the circle, radius < 1\nw = np.exp(-1j*np.pi/M)  # \"Step size\" of circle\npoints = czt_points(M + 1, w, a)  # M + 1 to include Nyquist\nfrom matplotlib.patches import Arc\nfig, ax = plt.subplots()\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ax.plot(points.real, points.imag, '.')\nax.add_patch(Arc((0, 0), width=2, height=2, theta1=0,\n                 theta2=180, alpha=.3))\n",
        "execution_status": "failure",
        "out": "<matplotlib.patches.Arc object at 0x7f3f68498d70>\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ax.set_aspect('equal')\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "ax.set_xlim(-1.05, 1.05)\n",
        "execution_status": "failure",
        "out": "(-1.05, 1.05)\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.show()\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Figure",
        "__tag": 4024,
        "value": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "scipy",
          "version": "2.0.0.dev0+git20260907.41eeb59",
          "kind": "assets",
          "path": "fig-387ce9cdf5ba4c9b.png"
        }
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nWith the correct radius, this transforms the decaying sinusoid (and others\nwith the same decay rate) without spectral leakage:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "z_vals = czt(x, M + 1, w, a)  # Include Nyquist for comparison to rfft\nfreqs = np.angle(points)*fs/(2*np.pi)  # angle = omega, radius = sigma\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.plot(freqs, abs(z_vals))\n",
        "execution_status": "failure",
        "out": "[<matplotlib.lines.Line2D object at 0x7f3f684ee660>]\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "plt.margins(0, 0.1)\nplt.show()\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Figure",
        "__tag": 4024,
        "value": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "scipy",
          "version": "2.0.0.dev0+git20260907.41eeb59",
          "kind": "assets",
          "path": "fig-13dae93c6b07a836.png"
        }
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "CZT",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.signal._czt:CZT"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Class that creates a callable chirp z-transform function."
            }
          ]
        }
      ],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "zoom_fft",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.signal._czt:zoom_fft"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Convenience function for partial FFT calculations."
            }
          ]
        }
      ],
      "type": "func"
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "x",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "m",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "w",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "a",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "(1+0j)"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "axis",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "-1"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "czt"
  },
  "references": [
    ".. [1] Steve Alan Shilling, \"A study of the chirp z-transform and its",
    "       applications\", pg 20 (1970)",
    "       https://krex.k-state.edu/dspace/bitstream/handle/2097/7844/LD2668R41972S43.pdf"
  ],
  "qa": "scipy.signal._czt:czt",
  "arbitrary": [],
  "local_refs": [
    "a",
    "axis",
    "m",
    "out",
    "w",
    "x"
  ]
}