Skip to main content
`Ctrl`+`K`
scipy.signal.ShortTimeFFT.

# t

ShortTimeFFT.t(n, p0=None, p1=None, k_offset=0)

  Times of STFT for an input signal with n samples.

  Returns a 1d array with times of the `stft` values with the same parametrization. Note that the slices are `delta_t = hop * T` time units apart.

  Parameters:
    n int

      Number of sample of the input signal.

    p0 int, optional

      The first element of the range of slices to calculate. If `None` then it is set to `p_min`, which is the smallest possible slice.

    p1 int, optional

      The end of the array. If `None` then p_max(n) is used.

    k_offset int

      Index of first sample (t = 0) in x.

  Returns:
    t ndarray

      1D array of times of the STFT slices from p0 to p1 - 1.

  See also

  `delta_t`

    Time increment of STFT (`hop*T`)

  `hop`

    Time increment in signal samples for sliding window.

  `nearest_k_p`

    Nearest sample index k_p for which t[k_p] == t[p] holds.

  `T`

    Sampling interval of input signal and of the window (`1/fs`).

  `fs`

    Sampling frequency (being `1/T`)

  `ShortTimeFFT`

    Class this method belongs to.

  Notes

  Note that the returned array is cached together with the method’s call parameters to avoid unnecessary recalculations.