toolbox/nt/transform/module_stft.py
def stft_with_kaldi_dimensions(
        time_signal,
        size: int = 512,
        shift: int = 160,
        *,
        axis=-1,
        window=signal.blackman,
        window_length=400,
        symmetric_window: bool = False
):
    """
    The Kaldi implementation uses another non standard window.
    See:
     - https://github.com/kaldi-asr/kaldi/blob/master/src/feat/feature-window.h#L48
     - https://github.com/kaldi-asr/kaldi/blob/81b7a1947fb8df501a2bbb680b65ce18ce606cff/src/feat/feature-window.h#L48

    ..note::
       Kaldi uses symmetric_window == True
        - https://github.com/kaldi-asr/kaldi/blob/master/src/feat/feature-window.cc#L113

    """
    # ToDo: Write test to force this function to fulfill the old kaldi_dims
    #       argument
    # if kaldi_dims:
    #     nsamp = time_signal.shape[axis]
    #     frames = time_signal_seg.shape[axis]
    #     expected_frames = 1 + ((nsamp - size) // shift)
    #     if frames != expected_frames:
    #         raise ValueError('Expected {} frames, got {}'.format(
    #             expected_frames, frames))
    return stft(
        time_signal,
        size=size,
        shift=shift,
        axis=axis,
        window=window,
        window_length=window_length,
        fading=False,
        pad=False,
        symmetric_window=symmetric_window
    )

    The Kaldi implementation uses another non standard window.
    See:
     - https://github.com/kaldi-asr/kaldi/blob/master/src/feat/feature-window.h#L48
     - https://github.com/kaldi-asr/kaldi/blob/81b7a1947fb8df501a2bbb680b65ce18ce606cff/src/feat/feature-window.h#L48

    ..note::
       Kaldi uses symmetric_window == True
        - https://github.com/kaldi-asr/kaldi/blob/master/src/feat/feature-window.cc#L113

    
The Kaldi implementation uses another non standard window.


The Kaldi implementation uses another non standard window .
def stft_with_kaldi_dimensions(
        time_signal,
        size: int = 512,
        shift: int = 160,
        *,
        axis=-1,
        window=signal.blackman,
        window_length=400,
        symmetric_window: bool = False
):
    return stft(
        time_signal,
        size=size,
        shift=shift,
        axis=axis,
        window=window,
        window_length=window_length,
        fading=False,
        pad=False,
        symmetric_window=symmetric_window
    )
def stft_with_kaldi_dimensions ( time_signal , size : int = 512 , shift : int = 160 , * , axis = - 1 , window = signal . blackman , window_length = 400 , symmetric_window : bool = False ) : return stft ( time_signal , size = size , shift = shift , axis = axis , window = window , window_length = window_length , fading = False , pad = False , symmetric_window = symmetric_window )
The Kaldi implementation uses another non standard window.
The Kaldi implementation uses another non standard window .
"""
    The Kaldi implementation uses another non standard window.
    See:
     - https://github.com/kaldi-asr/kaldi/blob/master/src/feat/feature-window.h#L48
     - https://github.com/kaldi-asr/kaldi/blob/81b7a1947fb8df501a2bbb680b65ce18ce606cff/src/feat/feature-window.h#L48

    ..note::
       Kaldi uses symmetric_window == True
        - https://github.com/kaldi-asr/kaldi/blob/master/src/feat/feature-window.cc#L113

    """ # ToDo: Write test to force this function to fulfill the old kaldi_dims #       argument # if kaldi_dims: #     nsamp = time_signal.shape[axis] #     frames = time_signal_seg.shape[axis] #     expected_frames = 1 + ((nsamp - size) // shift) #     if frames != expected_frames: #         raise ValueError('Expected {} frames, got {}'.format( #             expected_frames, frames))
time_signal
size
int
shift
int
axis
window
window_length
symmetric_window
bool