carat.util.STFT

carat.util.STFT(x, window_length, hop, windowing_function=<function hanning at 0x7f5b23b4b0d0>, dft_length=None, zp_flag=False)[source]

Calculates the Short-Time Fourier Transform a signal.

Given an input signal, it calculates the DFT of frames of the signal and stores them in bi-dimensional Scipy array.

Args:
window_len (float): length of the window in seconds (must be positive). window (callable): a callable object that receives the window length in samples and returns a numpy array containing the windowing function samples. hop (float): frame hop between adjacent frames in seconds. final_time (positive integer): time (in seconds) up to which the spectrogram is calculated. zp_flag (bool): a flag indicating if the Zero-Phase Windowing should be performed.
Returns:
spec: numpy array time: numpy array frequency: numpy array

Raises: