作为“世界之都”,夏威夷损失了68%的鸟类,后果可能会损害整个食物链。研究人员使用人口监测来了解当地鸟类对环境变化和保护措施的反应。该岛是在难以接近的高海拔栖息地中孤立的。要解决身体监测的困难,科学家转向了声音记录。这种称为生物声学监测的方法可以提供一种被动的,低成本的经济策略,用于研究濒临灭绝的危险策略在目前,处理大型生物声学数据集的方法涉及每个记录的手工注释。这需要特殊的培训和很多时间。因此,使用机器学习技能并通过声音识别鸟类的类型可以节省很多特定的成本。特别是,开发模型可以处理连续的音频数据,然后从声音中识别物种。最佳条目将能够训练可靠培训数据有限的分类器。
数据集来源:https://www.kaggle.com/competitions/birdclef-2022/data
下载方法:https://github.com/kaggle/kaggle-di
我们讨论``````````````````````````````''的三种主要音频功能了。
[]()
频谱图是信号频率随时间频率的直观表示,它们是信号的时间频率图。使用频谱,我们可以看到能量水平(db)如何随时间变化。这是直观的方式表明信号强度或“响度”在特定波形中以多种频率随时间变化。频谱图通常被描述为热图,即通过更改颜色或亮度来显示强度的图像。
信号的能量对应于其总范围,其音频信号大致表示信号的响度。RMSE是一种表征信号能量的方法,计算平均正方形的平方根(音频尺度的平均值)框架)。
梅尔的频谱图是一个频谱图,可将频率转换为Mel的标准
音频信号的ZCR定义为信号更改符号的速率。ZCR是一种检测语音帧,沉默或无声的有效且简单的方法。期望清除部分会产生比语音段更高的ZCR,静音段的理想情况等于0
声音可以大致分为两类。一方面,谐波是我们的感知声音,是什么,让我们听到旋律和和弦。audio_casvir))
plt.figure(figsize =(16,6))plt.title(“全功率谱图:谐波 +打击乐”)
plt.subplot(3,1,2)librosa.display.specshow(librosa.amplitude_to_db(np.abs(h),ref = np.max),y_axis ='log')2.0f db')plt.title('谐波功率谱图')plt.subplot(3,1,3)
libreosa.display.specshow(libreosa.amplitude_to_db(np.abs(p),ref = np.max),y_axis ='log')plt.colorbar(格式='%+2.0f db'plt.tight_layout()plt.show()
= np.ediff1d(beat_times)beat_nums = np.Arange(1,np.size(beat_times))fic,ax = plt.subplots()fic.set_size_inches(5)ax.set.set_ylabel(time dra))ax.set_xlabel(“ beats”)g = sns.barplot(beat_nums,beat_time_diff,palette =“ rocket”,ax = ax)g = g.set(xticklabels = [])
plt.figure(figsize =(16,6))ax = sns.barplot(y = data [“ bpm”],x = data [type“ type”],palette =“ rocket”)plt.ylabel(“ bpm”,“ bpm”,fontsize = 14)plt.yticks(fontsize = 13)plt.xticks(fontsize = 13)plt.xlabel(“”)plt.title(“ 6种不同的鸟类的bpm”,fontsize = 16);
x_axis ='time',ax = ax)图。Colorbar(img,ax = ax)ax.set(title ='Chromagram')
5))img = librosa.display.specshow(Chroma,y_axis ='Chroma',x_axis ='time',ax = ax = ax)图.colorbar(img,ax = ax = ax)ax.set.set(title ='Chromagram')
是的,无花果=(10,9))librosa.display.specshow(chroma_stft,y_axis ='chroma',x_axis ='time',ax = ax = ax [0] .set(title ='chroma_stft')ax [0]。Label_outer()
图。Colorbar(IMG,AX = AX)
chroma_stft = libreosa.feature.chroma_stft(y = audio_casvir,sr = sr_casvir)chroma_cens = librosa.feature.chroma_cens(y = audio_casvir,sr = sr = sr_casvir)
图,ax = plt.subplots(nrows = 2,sharex = true,sharey = true,figsize =(10,9))librosa.display.specshow(chroma_stft,y__axis,y_axis ='chroma',x_axis ='timax [0])ax [0] .set(title ='chroma_stft')ax [0] .label_outer()
img = librosa.display.specshow(chroma_cesss,y_axis ='chroma',x_axis ='time',ax = ax [1]).set(title ='chroma_cens')fig.colorbarax)
spectral_centroids = libreosa.feature.spectral_centroid(audio_casvir,sr = sr_casvir)[0]
打印('Centroids:',Spectral_Centroids,'
')print(“光谱质心的形状:',spectral_centroids.shape'
')
帧=范围(len(Spectral_centroids))
t = librosa.frames_to_time(帧)
打印('帧:',框架,'
')打印('t:',t)
def归一化(x,axis = 0):返回sklearn.preprocessing.minmax_scale(x,axis = axis)
color ='#ffb100',lw = 2)
('频段')plt.title(“光谱对比”)
spectral_rolloff = libreosa.feature.spectral_rolloff(audio_astfly,sr = sr_astfly)[0]
框架= range(len(Spectral_rolloff))
t = librosa.frames_to_time(帧)
plt.figure(figsize =(16,6))librosa.display.display.waveplot(audio_astfly,sr = sr_astfly,alpha = 0.4,color ='#a300f9',lw = 3)(Speccccelelelele(Speccccilelele(Specccct(Speccccelit)(Speccccelit(SpecccceleLit(Speccccelele(of)color ='#ffb100',lw = 3)”,fontsize = 16);
mfcc = librosa.feature.mfcc(y = audio_astfly,sr = sr_astfly)fig,ax = plt.subplots(1,figsize =(12,6))mfcc.shape)图。Colorbar(img,ax = ax)ax.set(title ='mfcc')
原始:https://juejin.cn/post/7097230551785930766