Wolfram 语言

计算音频

基于频谱特性的音频聚类

用频谱特性查找音频对象列表中的聚类.

In[1]:=
Click for copyable input
a = ExampleData[{"Audio", "Drums"}, "Audio"]
Out[1]=

在瞬态处将录音分割.

In[2]:=
Click for copyable input
samples = Select[AudioSplit[a, FindPeaks[AudioLocalMeasurements[a, "Novelty"]]["Times"]], Duration@# > Quantity[50, "ms"] &]; samples = Audio[#, Appearance -> "Minimal"] & /@ samples
Out[2]=

在由其频谱质心和扩频定义的位置处绘制结果采样.

In[3]:=
Click for copyable input
ListPlot[Partition[ AudioMeasurements[#, {"SpectralCentroid", "SpectralSpread"}, "List"] & /@ samples, 1], PlotMarkers -> (Audio[#, Appearance -> "Minimal"] & /@ samples), AxesLabel -> {Style["Centroid", Italic], Style["Spread", Italic]}, ImageSize -> Medium]
Out[3]=

"SpectralCentroid""SpectralSpread" 度量找出相同音频.

In[4]:=
Click for copyable input
FindClusters[ AudioMeasurements[#, {"SpectralCentroid", "SpectralSpread"}, "List"] & /@ samples -> samples]
Out[4]=

相关范例

de en es fr ja ko pt-br ru