Wolfram Language

Computational Audio

Comb Filtering

Define the discrete transfer function for a comb filter.

In[1]:=
Click for copyable input
combFilterModel[f_, \[Alpha]_, sr_: 44100] := TransferFunctionModel[{{1/( 1 - \[Alpha] z^-Round[sr/f])}}, z, SamplingPeriod -> 1/sr]
In[2]:=
Click for copyable input
combFilterModel[300, \[Alpha]]
Out[2]=

Plot the transfer function using BodePlot.

In[3]:=
Click for copyable input
BodePlot[combFilterModel[300, -.9], {0, 20000}, ScalingFunctions -> {"Linear", Automatic}, PlotLayout -> "Magnitude", ImageSize -> Medium]
Out[3]=

Filter an audio object using RecurrenceFilter.

In[4]:=
Click for copyable input
a = AudioNormalize[Import["ExampleData/rule30.wav"]]
Out[4]=
In[5]:=
Click for copyable input
RecurrenceFilter[combFilterModel[300, -.9], a]
Out[5]=

Related Examples

de es fr ja ko pt-br ru zh