用时间序列生成音频信号
用一个规则取样的 TimeSeries 控制正弦波的频率.
In[1]:=
n = 50;
frequencies = RandomReal[{100, 300}, n];
reg = TimeSeries[frequencies, {0, Automatic, .3}];
In[2]:=
AudioGenerator[{"Sin", reg}]
用一个不规则取样的 TimeSeries 控制正弦波的频率.
In[3]:=
times = Accumulate[RandomReal[{0.1, .5}, n]];
irreg = TimeSeries[frequencies, {times}];
In[4]:=
AudioGenerator[{"Sin", irreg}]
用 WhiteNoiseProcess 生成一个白噪声.
In[5]:=
sample = RandomFunction[WhiteNoiseProcess[1/3], {88200}]
Out[5]=
重新缩放样品到 2 秒长,并生成音频信号.
In[6]:=
AudioNormalize@
AudioGenerator[TimeSeriesRescale[sample, {0, 2, 1/44100}]]
In[7]:=
AudioNormalize@
AudioGenerator[TimeSeriesRescale[sample, {0, 2, 1/44100}]];
AudioPlot[%]
Out[7]=
直接用 FractionalGaussianNoiseProcess 产生一个不同类型的噪音.
In[8]:=
AudioNormalize@AudioGenerator[FractionalGaussianNoiseProcess[1/3], 2]
In[9]:=
AudioNormalize@AudioGenerator[FractionalGaussianNoiseProcess[1/3], 2];
AudioPlot[%]
Out[9]=