transforms audio by applying the function f to its short-time Fourier transform.


applies the function f to the list of short-time Fourier transforms of all audioi.

Details and Options

  • AudioSpectralMap can be used to arbitrarily modify the signal both in the time domain and the frequency domain. Spectral filters can be used to diminish, highlight or modify specific frequencies at specific times, e.g. removing noise.
  • AudioSpectralMap applies the function f to the short-time Fourier transform and computes the inverse using the overlap-add method.
  • Function f takes values of short-time Fourier transform as the first argument. Optionally, frequency and time can be given to f as the second and third arguments:
  • #Value or #1value of the short-time Fourier transform
    #Frequency or #2frequency in Hz
    #Time or #3time in seconds
  • For multichannel audio objects, the transformation is performed separately on each channel.
  • When multiple audio signals are present, #Value is a list of values. Use #Valuei for audioi.
  • AudioSpectralMap accepts a PartitionGranularity option that can specify the duration of each partition and the offset, as well as the smoothing window.


open allclose all

Basic Examples  (1)

Spectral filtering of an audio signal:

Scope  (2)

Multiply each spectral component by its frequency:

Multiply each spectral component by the time:

Mutate between two sounds:

Multiply the two short-time Fourier transforms:

Use the magnitude of the first audio and the phase of the second:

Options  (1)

PartitionGranularity  (1)

By default, automatic partitioning suitable for spectral filtering is used:

Specify the partition size:

Specify the partition size, offset and smoothing window:

Applications  (8)

Denoise an audio signal by eliminating all components with small amplitude:

Create a lowpass filter by removing components smaller than 1000Hz:

Create a highpass filter:

Zero out all the components at times smaller than 0.5 seconds:

Assign a random phase to all the components to achieve a whisper effect:

Assign a phase equal to zero to all the components to achieve a robot-like result:

Lower the amplitude of quiet components, effectively performing a simple denoise:

Completely zero out the quiet components:

Create a time-dependent highpass filter:

Denoise a signal by subtracting a noise profile:

Trim a part of the signal that contains only noise:

Compute the magnitude spectrum of the noise:

Smooth the result:

Create an interpolating function on the frequency domain using the smoothed noise spectrum:

Subtract from each component the corresponding noise spectrum magnitude:

Properties & Relations  (1)

Apply identity to each spectral component:

This operation is not an identity operation, due to the overlap and add during the inverse transform:

However, the result only has small discrepancies compared to the original signal:

Wolfram Research (2017), AudioSpectralMap, Wolfram Language function,


Wolfram Research (2017), AudioSpectralMap, Wolfram Language function,


Wolfram Language. 2017. "AudioSpectralMap." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2017). AudioSpectralMap. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_audiospectralmap, author="Wolfram Research", title="{AudioSpectralMap}", year="2017", howpublished="\url{}", note=[Accessed: 15-July-2024 ]}


@online{reference.wolfram_2024_audiospectralmap, organization={Wolfram Research}, title={AudioSpectralMap}, year={2017}, url={}, note=[Accessed: 15-July-2024 ]}