基于频谱特性的音频聚类
用频谱特性查找音频对象列表中的聚类.
In[1]:=
a = ExampleData[{"Audio", "Drums"}, "Audio"]
在瞬态处将录音分割.
In[2]:=
samples =
Select[AudioSplit[a,
FindPeaks[AudioLocalMeasurements[a, "Novelty"]]["Times"]],
Duration@# > Quantity[50, "ms"] &];
samples = Audio[#, Appearance -> "Minimal"] & /@ samples
Out[2]=
在由其频谱质心和扩频定义的位置处绘制结果采样.
In[3]:=
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]:=
FindClusters[
AudioMeasurements[#, {"SpectralCentroid", "SpectralSpread"},
"List"] & /@ samples -> samples]
Out[4]=