Signal

Signal processing utilities that make complete sense

source

butterworth


def butterworth(
    waveform_array, freq_range, btype, fs:int=125, order:int=2, # Recommend playing around with the order as well
):

source

stft


def stft(
    signal_array, n_fft:int=256, # number of ffts to perform
    win_length:int=250, # window of ffts
    pad_mode:str='reflect',
    pad_win_length_to_nfft:bool=True, # indicator to pad the end of the sequence with 0s for nfft-win_legnth to ensuure correct size output
    center:bool=False, hop_length:int=125, normalized:bool=True, decibel_scale:bool=False, return_complex:bool=True,
    onesided:bool=True, channel_stft_means:NoneType=None, # precalculated stft channel means
    channel_stft_stds:NoneType=None, # precalculated stft channel stds
):

in: [bs x n_vars x max_seq_len] out: [bs x n_vars x n_fft // 2 + 1 x stft_len]