Created
December 16, 2020 05:34
-
-
Save RicherMans/5b5784db8a5aee6d23e0bc22e6146d57 to your computer and use it in GitHub Desktop.
Torchlibrosa default to Librosa LMS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import librosa | |
import numpy as np | |
import torchlibrosa as tl | |
import torch | |
import soundfile as sf | |
y, sr = sf.read('.Y0Am7X758-Ek_30.000_40.000.wav') | |
# Channels normalization (if neceesary | |
y = y.mean(-1) | |
spec_extractor = tl.stft.Spectrogram(n_fft=1024, hop_length=400, win_length=160) | |
lms_extractor = tl.stft.LogmelFilterBank(sr=sr, n_fft=1024, n_mels=64, is_log=False, fmin=0.0, fmax=sr//2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment