Wolfram Language

Computational Audio

Fundamental Frequency Detection

Compute the fundamental frequency of a recording.

In[1]:=
Click for copyable input
a = ExampleData[{"Audio", "PianoScale"}, "Audio"]
Out[1]=
In[2]:=
Click for copyable input
f0 = AudioLocalMeasurements[a, "FundamentalFrequency"]; ListLinePlot[f0, ImageSize -> Medium]
Out[2]=

Use the result as a ColorFunction for AudioPlot.

In[3]:=
Click for copyable input
f0 = Rescale[TimeSeries[DeleteMissing[f0 // Normal, 1, 2]]]; Quiet@ AudioPlot[a, ColorFunction -> Function[{x, y}, ColorData["SolarColors"][f0[x]]], ImageSize -> Medium]
Out[3]=

Related Examples

de es fr ja ko pt-br ru zh