- librosa.core.load
librosa.core.load(path, sr=22050, mono=True, offset=0.0, duration=None)
返回值:
y:np.ndarray [shape =(n,)或(2,n)] 音频时间序列
sr:number> 0 [标量] y的采样率
y, sr = librosa(filename, sr)
- librosa.effects.split
librosa.effects.split(y, top_db=60, ref=<function amax at 0x7fcba2eb3d90>, frame_length=2048, hop_length=512)
将音频信号分成非静音间隔。
参数:
y:np.ndarray,shape =(n,)或(2,n)音频信号
top_db:数字> 0 低于参考值的阈值(以分贝为单位)被视为静音
ref:参考功率。 默认情况下,它使用np.max并与信号中的峰值功率进行比较。
frame_length:int> 0 每帧的样本数
hop_length:int> 0 帧之间的样本数
返回值:
间隔:np.ndarray,shape =(m,2)
interval [i] ==(start_i,end_i)是非静音间隔i的开始和结束时间(以样本为单位)。
intervals = librosa.effects.split(utter, top_db=20)
- librosa.core.stft
librosa.core.stft(y, n_fft=2048, hop_length=None, win_length=None, window=‘hann’, center=True, pad_mode=‘reflect’)
y:np.ndarray [shape =(n,)],实值. 输入信号
n_fft:int> 0 [标量] 用零填充后窗口信号的长度。默认值n_fft = 2048
在语音处理中,推荐值为512
hop_length:int> 0 [标量] 相邻STFT列之间的音频样本数。默认为win_length / 4。
win_length:int <= n_fft [标量] 音频的每个帧都由长度为win_length的window()进行窗口化,然后用零填充以匹配n_fft。默认为win_length = n_fft。
window:窗口函数长度为n_fft的向量或数组, 默认 hann窗
返回值:
D:np.ndarray [shape =(1 + n_fft / 2,n_frames),dtype = dtype]
短期傅立叶变换系数的复值矩阵。