jax.scipy.signal.istft

Contents

jax.scipy.signal.istft#

jax.scipy.signal.istft(Zxx, fs=1.0, window='hann', nperseg=None, noverlap=None, nfft=None, input_onesided=True, boundary=True, time_axis=-1, freq_axis=-2)[source]#

Perform the inverse Short Time Fourier transform (iSTFT).

LAX-backend implementation of scipy.signal._spectral_py.istft().

Original docstring below.

Parameters:
  • Zxx (array_like) – STFT of the signal to be reconstructed. If a purely real array is passed, it will be cast to a complex data type.

  • fs (float, optional) – Sampling frequency of the time series. Defaults to 1.0.

  • window (str or tuple or array_like, optional) – Desired window to use. If window is a string or tuple, it is passed to get_window to generate the window values, which are DFT-even by default. See get_window for a list of windows and required parameters. If window is array_like it will be used directly as the window and its length must be nperseg. Defaults to a Hann window. Must match the window used to generate the STFT for faithful inversion.

  • nperseg (int, optional) – Number of data points corresponding to each STFT segment. This parameter must be specified if the number of data points per segment is odd, or if the STFT was padded via nfft > nperseg. If None, the value depends on the shape of Zxx and input_onesided. If input_onesided is True, nperseg=2*(Zxx.shape[freq_axis] - 1). Otherwise, nperseg=Zxx.shape[freq_axis]. Defaults to None.

  • noverlap (int, optional) – Number of points to overlap between segments. If None, half of the segment length. Defaults to None. When specified, the COLA constraint must be met (see Notes below), and should match the parameter used to generate the STFT. Defaults to None.

  • nfft (int, optional) – Number of FFT points corresponding to each STFT segment. This parameter must be specified if the STFT was padded via nfft > nperseg. If None, the default values are the same as for nperseg, detailed above, with one exception: if input_onesided is True and nperseg==2*Zxx.shape[freq_axis] - 1, nfft also takes on that value. This case allows the proper inversion of an odd-length unpadded STFT using nfft=None. Defaults to None.

  • input_onesided (bool, optional) – If True, interpret the input array as one-sided FFTs, such as is returned by stft with return_onesided=True and numpy.fft.rfft. If False, interpret the input as a a two-sided FFT. Defaults to True.

  • boundary (bool, optional) – Specifies whether the input signal was extended at its boundaries by supplying a non-None boundary argument to stft. Defaults to True.

  • time_axis (int, optional) – Where the time segments of the STFT is located; the default is the last axis (i.e. axis=-1).

  • freq_axis (int, optional) – Where the frequency axis of the STFT is located; the default is the penultimate axis (i.e. axis=-2).

Return type:

tuple[Array, Array]

Returns:

  • t (ndarray) – Array of output data times.

  • x (ndarray) – iSTFT of Zxx.

References