Wolfram Language

Time Series Processing

Use Time Series to Generate Audio

Control the frequency of the sine wave with a regularly sampled TimeSeries.

In[1]:=
Click for copyable input
n = 50; frequencies = RandomReal[{100, 300}, n]; reg = TimeSeries[frequencies, {0, Automatic, .3}];
In[2]:=
Click for copyable input
AudioGenerator[{"Sin", reg}]
Out[2]=

Control the frequency of the sine wave with an irregularly sampled TimeSeries.

In[3]:=
Click for copyable input
times = Accumulate[RandomReal[{0.1, .5}, n]]; irreg = TimeSeries[frequencies, {times}];
In[4]:=
Click for copyable input
AudioGenerator[{"Sin", irreg}]
Out[4]=

Generate a white noise with WhiteNoiseProcess.

In[5]:=
Click for copyable input
sample = RandomFunction[WhiteNoiseProcess[1/3], {88200}]
Out[5]=

Rescale the sample to the length of 2 seconds and generate audio.

In[6]:=
Click for copyable input
AudioNormalize@ AudioGenerator[TimeSeriesRescale[sample, {0, 2, 1/44100}]]
Out[6]=
In[7]:=
Click for copyable input
AudioNormalize@ AudioGenerator[TimeSeriesRescale[sample, {0, 2, 1/44100}]]; AudioPlot[%]
Out[7]=

Generate a different type of noise directly with FractionalGaussianNoiseProcess.

In[8]:=
Click for copyable input
AudioNormalize@AudioGenerator[FractionalGaussianNoiseProcess[1/3], 2]
Out[8]=
In[9]:=
Click for copyable input
AudioNormalize@AudioGenerator[FractionalGaussianNoiseProcess[1/3], 2]; AudioPlot[%]
Out[9]=

Related Examples

de es fr ja ko pt-br ru zh