Waveshaper

In electronic music, waveshaping is a type of distortion synthesis in which complex spectra are produced from simple tones by altering the shape of the waveforms.

This effect is most used to enhance the sound of a music synthesizer by altering the waveform or vowel.

Rock musicians may also use a waveshaper for heavy distortion of a guitar or bass.

In digital modeling of analog audio equipment such as tube amplifiers, waveshaping is used to introduce a static, or memoryless, nonlinearity to approximate the transfer characteristic of a vacuum tube or diode limiter.

[4] This parameter a is often used as a constant gain factor called the distortion index.

[5] In practice, the input to the waveshaper, x, is considered on [-1,1] for digitally sampled signals, and f will be designed such that y is also on [-1,1] to prevent unwanted clipping in software.

It is also possible to use table-driven functions, consisting of discrete points with some degree of interpolation or linear segments.

Polynomial functions are convenient as shaping functions because, when given a single sinusoid as input, a polynomial of degree N will only introduce up to the Nth harmonic of the sinusoid.

Finally, use the binomial formula to transform back to trigonometric form and find coefficients for each harmonic.

From the above equation, several observations can be made about the effect of a polynomial shaping function on a single sinusoid: The sound produced by digital waveshapers tends to be harsh and unattractive, because of problems with aliasing.

The mathematics of non-linear operations on audio signals is difficult, and not well understood.

But generally, waveshapers—particularly those with sharp corners (e.g., some derivatives are discontinuous) -- tend to introduce large numbers of high frequency harmonics.

If these introduced harmonics exceed the Nyquist limit, then they will be heard as harsh inharmonic content with a distinctly metallic sound in the output signal.

Oversampling can somewhat but not completely alleviate this problem, depending on how fast the introduced harmonics fall off[citation needed].

With relatively simple, and relatively smooth waveshaping functions (sin(a*x), atan(a*x), polynomial functions, for example), this procedure may reduce aliased content in the harmonic signal to the point that it is musically acceptable[citation needed].

But waveshaping functions other than polynomial waveshaping functions will introduce an infinite number of harmonics into the signal, some which may audibly alias even at the supersampled frequency[citation needed].