Wolfram Language

Computational Audio

Voiced vs. Unvoiced Detection

Detect unvoiced segments and attenuate them.

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

Use AudioIntervals to look for segments with low RMS amplitude and high spectral flatness.

In[2]:=
Click for copyable input
nonVoicedIntervals = AudioIntervals[ a, #RMSAmplitude < .02 && #SpectralFlatness > .0001 &, .1, PartitionGranularity -> {.06, .01}]
Out[2]=

Visualize the detected intervals.

In[3]:=
Click for copyable input
AudioPlot[a, Epilog -> {RGBColor[1, 0, 0, .3], Rectangle[{#[[1]], -1}, {#[[2]], 1}] & /@ nonVoicedIntervals}, ImageSize -> Medium]
Out[3]=

Attenuate the detected intervals.

In[4]:=
Click for copyable input
AudioJoin[ Riffle[AudioFade /@ AudioTrim[a, Except@nonVoicedIntervals], 0.3*AudioTrim[a, nonVoicedIntervals]]]
Out[4]=

Related Examples

de es fr ja ko pt-br ru zh