Wolfram言語

計算音声

双二次フィルタを使ったイコライゼーション

アナログの伝達関数を使って,音声オブジェクトにフィルタを適用する.

In[1]:=
Click for copyable input
a = AudioNormalize[Import["ExampleData/rule30.wav"]]
Out[1]=
In[2]:=
Click for copyable input
filterModel = BiquadraticFilterModel[{\[Omega], q}]
Out[2]=
In[3]:=
Click for copyable input
RecurrenceFilter[ ToDiscreteTimeModel[filterModel, 1/44100, z] /. {\[Omega] -> 1000 2 Pi, q -> 10}, a]
Out[3]=

アナログ伝達関数を使って,イコライザを構築する.

完全なWolfram言語入力を表示する
In[4]:=
Click for copyable input
eq[g1_, g2_, g3_] := SystemsModelSeriesConnect[ SystemsModelSeriesConnect[ ToDiscreteTimeModel[ BiquadraticFilterModel[{"LowShelf", {{Quantity[5000, "Hz"], 2}}, Quantity[g1, "decibel"]}], 1/44100, z, Method -> {"BilinearTransform", "CriticalFrequency" -> 5000 2 Pi}], ToDiscreteTimeModel[ BiquadraticFilterModel[{"Peaking", {{Quantity[10000, "Hz"], 2}}, Quantity[g2, "decibel"]}], 1/44100, z, Method -> {"BilinearTransform", "CriticalFrequency" -> 10000 2 Pi}]], ToDiscreteTimeModel[ BiquadraticFilterModel[{"HighShelf", {{Quantity[15000, "Hz"], 2}}, Quantity[g3, "decibel"]}], 1/44100, z, Method -> {"BilinearTransform", "CriticalFrequency" -> 15000 2 Pi}]]; white = RandomReal[{-1, 1}, 44100]; Manipulate[ Periodogram[ RecurrenceFilter[eq[gainLow, gainPeak, gainHigh], Audio@white], 4000, PlotRange -> {-35, 20}, ImageSize -> 300], {{gainLow, 0}, -20, 20}, {{gainPeak, 0}, -20, 20}, {{gainHigh, 0}, -20, 20}, SaveDefinitions -> True]
Out[4]=
動画を開始
動画を中止

関連する例

de en es fr ko pt-br ru zh