# vispy.util.fourier module

vispy.util.fourier.fft_freqs(n_fft, fs)

  Return frequencies for DFT

  Parameters:
    n_fft int

      Number of points in the FFT.

    fs float

      The sampling rate.

vispy.util.fourier.stft(x, n_fft=1024, step=512, fs=6.283185307179586, window='hann')

  Compute the STFT

  Parameters:
    x array-like

      1D signal to operate on. `If len(x) < n_fft`, x will be zero-padded to length `n_fft`.

    n_fft int

      Number of FFT points. Much faster for powers of two.

    step int | None

      Step size between calculations. If None, `n_fft // 2` will be used.

    fs float

      The sample rate of the data.

    window str | None

      Window function to use. Can be `'hann'` for Hann window, or None for no windowing.

  Returns:
    stft ndarray

      Spectrogram of the data, shape (n_freqs, n_steps).

  See also

  `fft_freqs`

previous

vispy.util.filter module

next

vispy.util.frozen module