Skip to content

signal.NoiseGen.Function.synthesizeSpectralNoise

Christian d'Heureuse edited this page Jun 7, 2026 · 2 revisions

dsp-collection / signal/NoiseGen / synthesizeSpectralNoise

Function: synthesizeSpectralNoise()

function synthesizeSpectralNoise(
   spectrumCurveFunction, 
   amplitudeCurveFunction, 
   duration, 
   sampleRate, 
   noiseRms): Float64Array;

Defined in: signal/NoiseGen.ts:31

High-level function to synthesize random noise with a specified amplitude spectrum.

Parameters

spectrumCurveFunction

UniFunction

A function that maps a frequency [Hz] to a spectrum amplitude (linear scale).

amplitudeCurveFunction

UniFunction | undefined

An optional envelope function that maps a time [s] to a gain factor (linear scale).

duration

number

The duration [s] of the output signal.

sampleRate

number

The sample rate [Hz] of the output signal.

noiseRms

number | undefined

A target RMS level for the generated noise signal. The peak amplitude of the noise is roughly 3 times this level. The signal is scaled to this RMS before amplitudeCurveFunction is applied. This value is ignored if 0 or undefined.

Returns

Float64Array

The generated noise signal.

Clone this wiki locally