{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "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": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Instantiate "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "ShortTimeFFT",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.signal._short_time_fft:ShortTimeFFT"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " by using "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "get_window",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.signal.windows._windows:get_window"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        }
      ],
      "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": "win_param: Union[str, tuple, float],",
              "annotation": "",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Parameters passed to "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "get_window",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "scipy.signal.windows._windows:get_window"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". For windows with no parameters, it may be a string (e.g., "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "'hann'"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "), for parametrized windows a tuple, (e.g., "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "('gaussian', 2.)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ") or a single float specifying the shape parameter of a kaiser window (i.e. "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "4."
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "  and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "('kaiser', 4.)"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " are equal. See "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "get_window",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "scipy.signal.windows._windows:get_window"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for more details."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "fs",
              "annotation": "float",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Sampling frequency of input signal. Its relation to the sampling interval "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "T",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "T = 1 / fs"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "nperseg: int",
              "annotation": "",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Window length in samples, which corresponds to the "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "m_num",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "noverlap: int",
              "annotation": "",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Window overlap in samples. It relates to the "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "hop",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " increment by "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "hop = npsereg - noverlap"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "symmetric_win: bool",
              "annotation": "",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "True"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " then a symmetric window is generated, else a periodic window is generated (default). Though symmetric windows seem for most applications to be more sensible, the default of a periodic windows was chosen to correspond to the default of "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "get_window",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "module",
                        "path": "scipy.signal.windows._windows:get_window"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". This parameter is ignored, if the window name in the "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "window",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " parameter has a suffix "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "'_periodic'"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " or "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "'_symmetric'"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " appended to it (e.g., "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "'hann_symmetric'"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ")."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "fft_mode",
              "annotation": "'twosided', 'centered', 'onesided', 'onesided2X'",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Mode of FFT to be used (default 'onesided'). See property "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "fft_mode",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "fft_mode"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for details."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "mfft: int | None",
              "annotation": "",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Length of the FFT used, if a zero padded FFT is desired. If "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "None"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (default), the length of the window "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "win",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is used."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "scale_to",
              "annotation": "'magnitude', 'psd' | None",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If not "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "None"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " (default) the window function is scaled, so each STFT column represents  either a 'magnitude' or a power spectral density ('psd') spectrum. This parameter sets the property "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "scaling",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " to the same value. See method "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "scale_to",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "scale_to"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for details."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "phase_shift",
              "annotation": "int | None",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If set, add a linear phase "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "phase_shift",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "phase_shift"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " / "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "mfft",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " * "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "f",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " to each frequency "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "f",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". The default value 0 ensures that there is no phase shift on the zeroth slice (in which t=0 is centered). See property "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "phase_shift",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": null,
                        "version": null,
                        "kind": "local",
                        "path": "phase_shift"
                      },
                      "kind": "local"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for more details."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The method "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "get_window",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.signal.windows._windows:get_window"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is used to create a window of length "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "nperseg",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". The parameter names "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "noverlap",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", and "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "nperseg",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are used here, since they more inline with other classical STFT libraries."
            }
          ]
        }
      ],
      "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": "/scipy/signal/_short_time_fft.py",
  "item_line": 543,
  "item_type": "classmethod",
  "aliases": [
    "scipy.signal.ShortTimeFFT.from_window"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "The following instances ``SFT0`` and ``SFT1`` are equivalent:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from scipy.signal import ShortTimeFFT, get_window\nnperseg = 9  # window length\nw = get_window(('gaussian_periodic', 2.), nperseg)\nfs = 128  # sampling frequency\nhop = 3  # increment of STFT time slice\nSFT0 = ShortTimeFFT(w, hop, fs=fs)\nSFT1 = ShortTimeFFT.from_window(('gaussian', 2.), fs, nperseg,\n                                noverlap=nperseg-hop)\n",
        "execution_status": "success"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "ShortTimeFFT",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.signal._short_time_fft:ShortTimeFFT"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Create instance using standard initializer."
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "from_dual",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.signal._short_time_fft:ShortTimeFFT.from_dual"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Create instance using dual window."
            }
          ]
        }
      ],
      "type": null
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "scipy.signal.get_window",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.signal.windows._windows:get_window"
        },
        "kind": "module"
      },
      "descriptions": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Return a window of a given length and type."
            }
          ]
        }
      ],
      "type": null
    }
  ],
  "signature": null,
  "references": null,
  "qa": "scipy.signal._short_time_fft:ShortTimeFFT.from_window",
  "arbitrary": [],
  "local_refs": [
    "fft_mode",
    "float]",
    "fs",
    "mfft: int | None",
    "noverlap: int",
    "nperseg: int",
    "phase_shift",
    "scale_to",
    "symmetric_win: bool",
    "tuple",
    "win_param: Union[str"
  ]
}