AudioGenerator
AudioGenerator[model]
generates one second of audio of a given model.
AudioGenerator[model,t]
generates t seconds of audio.
AudioGenerator[model,t,"type"]
generates audio samples of the specified "type".
Details and Options



- AudioGenerator can generate different types of audio, including oscillators or noises.
- Possible settings for model include:
-
f sample an arbitrary function f of time (in seconds) proc generate samples from a random process proc tseries generate samples from a TimeSeries tseries "model" generate sample from a named function "model" - Silence:
-
"Silence" silence (zero) signal - Oscillators:
-
{"Sin",freq,phase} sine wave {"Triangle",freq,phase} triangle wave {"Sawtooth",freq,phase} sawtooth wave {"Square",freq,phase} square wave {"Pulse",freq,phase,width} rectangular wave using the duty cycle width {"Impulse",freq,phase} impulse signal - By default,
,
, and
are used.
- The parameters freq, phase, and width can be a scalar value, a Quantity, an Audio object, a TimeSeries, or a pure function.
- Noise:
-
"White" constant power spectral density "Pink" power spectral density that follows "Brown" power spectral density that follows "Blue" power spectral density that follows {"Color",α} power spectral density that follows with
{"White",dist} random noise with values sampled from dist "PeriodicRandomNoise" sum of sinusoidal components with constant amplitude and random phase - Other:
- AudioGenerator generates an audio object of "Real32" type. See the reference page for Audio for possible settings of "type".
- AudioGenerator has the same options as Audio.
List of all options

Examples
open allclose allBasic Examples (3)
Scope (17)
Basic Uses (2)
By default, 1 second of audio is generated:
Specify the duration as a time quantity:
Specify the number of samples to generate:
By default, the generated audio is of "Real32" type:
Model Specifications (15)
Oscillators (5)
Sinusoidal oscillator at 2000 Hz:
Control the frequency of the sine wave with a function:
Control the frequency of the sine wave with another Audio object:
Visualize a spectrogram of the generated audio:
Control the frequency of the sine wave with a TimeSeries:
Noise Generators (5)
Using Functions (1)
AudioGenerator supports functions of time:
Using Processes (2)
Using TimeSeries (2)
Options (1)
SampleRate (1)
By default, SampleRate->44100 is used:
Applications (8)
Noise Applications (2)
Audio Generation from Temporal Data (2)
Compare the stock price trends of two companies:
Generate audio controlled by the two time series:
Use a list of TimeSeries to control the amplitudes of a list of harmonic sine waves:
Multi-Frequency Generation (3)
Generate a series of DTMF tones to simulate the dialing of a phone number:
Generate ramps to control frequencies and amplitudes of the oscillators:
Create frequencies that will control the oscillators. The frequencies are exactly one octave apart from each other and increase exponentially, so that pitch increases linearly:
Create amplitudes that will control the oscillators. Amplitudes go to 0 when the frequencies drop to the minimum value:
Show the relation between frequency and amplitude of one oscillator:
Combine a bank of oscillators using the created frequencies and amplitudes:
Frequency and Amplitude Modulation (1)
Generation and reconstruction of an AM signal:
Modulate the amplitude with a 22050 Hz sinusoid to shift the content at the high end of the spectrum. The result should be already inaudible for most people:
Demodulate the AM signal by multiplying the result by another sinusoid at 22050 Hz with the same phase:
Possible Issues (2)
With oscillators, the frequency should be less than or equal to half of the sample rate:

If a TimeSeries is used as an input, it needs to have numeric non-negative time stamps:

The TimeSeries needs to have a single scalar-valued path:

Interactive Examples (3)
Control frequency and phase of an oscillator:
The spectrum of AudioGenerator[{"Color",α}] follows a distribution of f-α:
Neat Examples (4)
Sweep the frequency of the modulating signal:
Use the digits of Pi in base 24 to generate a sequence of frequencies for a sinusoidal oscillator:
Create a melody using DiscreteMarkovProcess:
Generate an audio signal using Morse code:
Create a function to translate a message to an audio signal using the dictionary:
Text
Wolfram Research (2016), AudioGenerator, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioGenerator.html.
CMS
Wolfram Language. 2016. "AudioGenerator." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AudioGenerator.html.
APA
Wolfram Language. (2016). AudioGenerator. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AudioGenerator.html