AudioGenerator
✖
AudioGenerator
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)Summary of the most common use cases
Generate one second of sinusoidal audio:

https://wolfram.com/xid/0d6g1v2jsu-nryizk

Generate a signal from an arbitrary function:

https://wolfram.com/xid/0d6g1v2jsu-gevum

Generate two seconds of white noise:

https://wolfram.com/xid/0d6g1v2jsu-h34sdn

Scope (17)Survey of the scope of standard use cases
Basic Uses (2)
By default, 1 second of audio is generated:

https://wolfram.com/xid/0d6g1v2jsu-p7idou


https://wolfram.com/xid/0d6g1v2jsu-oubtgl

Specify the duration as a time quantity:

https://wolfram.com/xid/0d6g1v2jsu-zp1pw1

Specify the number of samples to generate:

https://wolfram.com/xid/0d6g1v2jsu-pffqs5

By default, the generated audio is of "Real32" type:

https://wolfram.com/xid/0d6g1v2jsu-ugemm7

Specify a different data type:

https://wolfram.com/xid/0d6g1v2jsu-9f755c

Model Specifications (15)
Oscillators (5)
Sinusoidal oscillator at 2000 Hz:

https://wolfram.com/xid/0d6g1v2jsu-bvty2t

Control the frequency of the sine wave with a function:

https://wolfram.com/xid/0d6g1v2jsu-60jwfy


https://wolfram.com/xid/0d6g1v2jsu-mqt0d2

Control the frequency of the sine wave with another Audio object:

https://wolfram.com/xid/0d6g1v2jsu-0uk5q5

Visualize a spectrogram of the generated audio:

https://wolfram.com/xid/0d6g1v2jsu-dql5y3

Control the frequency of the sine wave with a TimeSeries:

https://wolfram.com/xid/0d6g1v2jsu-xp8x8h


https://wolfram.com/xid/0d6g1v2jsu-i0e3ks

Generate different oscillators:

https://wolfram.com/xid/0d6g1v2jsu-viyw23

https://wolfram.com/xid/0d6g1v2jsu-sa9zor

Noise Generators (5)

https://wolfram.com/xid/0d6g1v2jsu-ldepvf

The values for the white noise can be sampled from a distribution:

https://wolfram.com/xid/0d6g1v2jsu-urq4x4

Generate different kinds of noises:

https://wolfram.com/xid/0d6g1v2jsu-kcrc5a

https://wolfram.com/xid/0d6g1v2jsu-5bo60w

The spectra of pink, brown, and blue noises follow a distribution of f-α, with α equal to 1, 2, and , respectively:

https://wolfram.com/xid/0d6g1v2jsu-2r2cwe

The spectrum of "PeriodicRandomNoise" is perfectly flat:

https://wolfram.com/xid/0d6g1v2jsu-7hot2x

Using Functions (1)
AudioGenerator supports functions of time:

https://wolfram.com/xid/0d6g1v2jsu-ogcpv9

Using Processes (2)
Generate audio from a noise process:

https://wolfram.com/xid/0d6g1v2jsu-45vg9v

Use an audio object generated from a random process to control the amplitude of a sinusoid:

https://wolfram.com/xid/0d6g1v2jsu-hithn1

https://wolfram.com/xid/0d6g1v2jsu-e6p01c

Using TimeSeries (2)
Generate an audio object from a TimeSeries:

https://wolfram.com/xid/0d6g1v2jsu-9ghcqw

Generate an audio object from an irregular TimeSeries:

https://wolfram.com/xid/0d6g1v2jsu-b2ljxz


https://wolfram.com/xid/0d6g1v2jsu-hbczrn

Options (1)Common values & functionality for each option
SampleRate (1)
By default, SampleRate->44100 is used:

https://wolfram.com/xid/0d6g1v2jsu-gde5vh

Specify a different sample rate:

https://wolfram.com/xid/0d6g1v2jsu-l24l6a

Applications (8)Sample problems that can be solved with this function
Noise Applications (2)
Audio Generation from Temporal Data (2)
Compare the stock price trends of two companies:

https://wolfram.com/xid/0d6g1v2jsu-qqo0jb

https://wolfram.com/xid/0d6g1v2jsu-u8x038


https://wolfram.com/xid/0d6g1v2jsu-1yc4jk
Generate audio controlled by the two time series:

https://wolfram.com/xid/0d6g1v2jsu-0yjigp

Use a list of TimeSeries to control the amplitudes of a list of harmonic sine waves:

https://wolfram.com/xid/0d6g1v2jsu-bpn3wn

https://wolfram.com/xid/0d6g1v2jsu-c6lkp8

https://wolfram.com/xid/0d6g1v2jsu-qmshp4

https://wolfram.com/xid/0d6g1v2jsu-f34n0e


https://wolfram.com/xid/0d6g1v2jsu-odbtli

Multi-Frequency Generation (3)
Generate a series of DTMF tones to simulate the dialing of a phone number:

https://wolfram.com/xid/0d6g1v2jsu-v2ke8y

https://wolfram.com/xid/0d6g1v2jsu-0hrmdb

https://wolfram.com/xid/0d6g1v2jsu-zu5cxk

https://wolfram.com/xid/0d6g1v2jsu-lbftvg


https://wolfram.com/xid/0d6g1v2jsu-mqpjw2


https://wolfram.com/xid/0d6g1v2jsu-9jbfwp
Generate ramps to control frequencies and amplitudes of the oscillators:

https://wolfram.com/xid/0d6g1v2jsu-jihk8

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:

https://wolfram.com/xid/0d6g1v2jsu-gg073k

Create amplitudes that will control the oscillators. Amplitudes go to 0 when the frequencies drop to the minimum value:

https://wolfram.com/xid/0d6g1v2jsu-qhlvy3

Show the relation between frequency and amplitude of one oscillator:

https://wolfram.com/xid/0d6g1v2jsu-svowlw

Combine a bank of oscillators using the created frequencies and amplitudes:

https://wolfram.com/xid/0d6g1v2jsu-7w44uo


https://wolfram.com/xid/0d6g1v2jsu-c4b5z8

Frequency and Amplitude Modulation (1)
Generation and reconstruction of an AM signal:

https://wolfram.com/xid/0d6g1v2jsu-55w4o2

https://wolfram.com/xid/0d6g1v2jsu-b8gc3w

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:

https://wolfram.com/xid/0d6g1v2jsu-wqfaoz


https://wolfram.com/xid/0d6g1v2jsu-mgk7vl

Demodulate the AM signal by multiplying the result by another sinusoid at 22050 Hz with the same phase:

https://wolfram.com/xid/0d6g1v2jsu-ry8r3b

Possible Issues (2)Common pitfalls and unexpected behavior
With oscillators, the frequency should be less than or equal to half of the sample rate:

https://wolfram.com/xid/0d6g1v2jsu-lmbwfv


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

https://wolfram.com/xid/0d6g1v2jsu-spmwqm


https://wolfram.com/xid/0d6g1v2jsu-x5zqnh


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

https://wolfram.com/xid/0d6g1v2jsu-n08t8z


https://wolfram.com/xid/0d6g1v2jsu-2adcnm


Interactive Examples (3)Examples with interactive outputs
Control frequency and phase of an oscillator:

https://wolfram.com/xid/0d6g1v2jsu-288rwj

The spectrum of AudioGenerator[{"Color",α}] follows a distribution of f-α:

https://wolfram.com/xid/0d6g1v2jsu-zt55yv

Create a complex audio signal using frequency modulation:

https://wolfram.com/xid/0d6g1v2jsu-fwo8zn

Neat Examples (4)Surprising or curious use cases
Sweep the frequency of the modulating signal:

https://wolfram.com/xid/0d6g1v2jsu-oagpoh

Use the digits of Pi in base 24 to generate a sequence of frequencies for a sinusoidal oscillator:

https://wolfram.com/xid/0d6g1v2jsu-366mk6


https://wolfram.com/xid/0d6g1v2jsu-44qpj2

Create a melody using DiscreteMarkovProcess:

https://wolfram.com/xid/0d6g1v2jsu-r7rggw

https://wolfram.com/xid/0d6g1v2jsu-fk7bbr

Generate an audio signal using Morse code:

https://wolfram.com/xid/0d6g1v2jsu-fi5hj1
Create a function to translate a message to an audio signal using the dictionary:

https://wolfram.com/xid/0d6g1v2jsu-6lg6wr
Encode a string into an audio signal:

https://wolfram.com/xid/0d6g1v2jsu-greug6


https://wolfram.com/xid/0d6g1v2jsu-vt5qnw

Wolfram Research (2016), AudioGenerator, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioGenerator.html.
Text
Wolfram Research (2016), AudioGenerator, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioGenerator.html.
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.
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
Wolfram Language. (2016). AudioGenerator. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AudioGenerator.html
BibTeX
@misc{reference.wolfram_2025_audiogenerator, author="Wolfram Research", title="{AudioGenerator}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/AudioGenerator.html}", note=[Accessed: 02-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_audiogenerator, organization={Wolfram Research}, title={AudioGenerator}, year={2016}, url={https://reference.wolfram.com/language/ref/AudioGenerator.html}, note=[Accessed: 02-April-2025
]}