Определение основного тона звука
Определим основной тон звукозаписи.
In[1]:=
![Click for copyable input](assets.ru/fundamental-frequency-detection/In_31.png)
a = ExampleData[{"Audio", "PianoScale"}, "Audio"]
In[2]:=
![Click for copyable input](assets.ru/fundamental-frequency-detection/In_32.png)
f0 = AudioLocalMeasurements[a, "FundamentalFrequency"];
ListLinePlot[f0, ImageSize -> Medium]
Out[2]=
![](assets.ru/fundamental-frequency-detection/O_13.png)
Отобразим результат с помощью функции ColorFunction для AudioPlot.
In[3]:=
![Click for copyable input](assets.ru/fundamental-frequency-detection/In_33.png)
f0 = Rescale[TimeSeries[DeleteMissing[f0 // Normal, 1, 2]]]; Quiet@
AudioPlot[a,
ColorFunction -> Function[{x, y}, ColorData["SolarColors"][f0[x]]],
ImageSize -> Medium]
Out[3]=
![](assets.ru/fundamental-frequency-detection/O_14.png)