Build an Audio Compressor
Build an audio compressor.
In[1]:=
a = Import["ExampleData/rule30.wav"]
In[2]:=
AudioPlot[a, ImageSize -> Medium]
Out[2]=
Compute the RMS amplitude of the signal with a threshold of 0.02.
In[3]:=
amplitude = AudioBlockMap[Max[.02, Sqrt@Mean[#^2]] &, a, {.01, .005}]
Out[3]=
Compress the dynamic range of the signal.
In[4]:=
AudioNormalize[a/AudioGenerator[amplitude]]
In[5]:=
AudioNormalize[a/AudioGenerator[amplitude]];
AudioPlot[%, ImageSize -> Medium]
Out[5]=