Wolfram Language

Time Series Processing

Use Time Series to Generate Audio

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

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

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

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

Generate a white noise with WhiteNoiseProcess.

Copy to clipboard.
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.

Copy to clipboard.
In[6]:=
Click for copyable input
AudioNormalize@ AudioGenerator[TimeSeriesRescale[sample, {0, 2, 1/44100}]]
Out[6]=
Copy to clipboard.
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.

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

Related Examples

Find out if you already have access to Wolfram tech through your organization
×