Signal Processing Concepts and Engineering Insights. 


Explore signal processing concepts, algorithm comparisons, and practical engineering insights.
Topics include FFT vs STFT, FRF analysis, filtering techniques, and other signal processing methods used in real engineering workflows. 

Signal FundamentalsWhat Is Nonlinear Amplitude Compression? Understanding Signal Shaping Beyond Linear Systems

What Is Nonlinear Amplitude Compression? Understanding Signal Shaping Beyond Linear Systems

In many real-world systems, signals are not processed in a purely linear way.
As amplitudes grow, systems often respond differently — reducing peaks, enhancing weaker signals, or reshaping the signal entirely.

This behavior is known as nonlinear amplitude compression.

Unlike linear systems, where output scales proportionally with input, nonlinear compression introduces amplitude-dependent transformation, fundamentally altering how signals behave in both time and frequency domains.

Comparison of audio waveform before and after dynamic range compression showing reduced peaks and more uniform signal

What Is Nonlinear Amplitude Compression?

Nonlinear amplitude compression refers to a class of transformations where

Output ≠ constant × Input


Instead, the output is defined by a nonlinear function

y = f(x)


where f(x)  compresses large amplitudes more than small ones.


Key Idea: Large Signals Are Reduced More Than Small Signals

The defining characteristic of compression is

  • Small signals remain mostly unchanged
  • Large signals are “compressed” or attenuated
  • Dynamic range is reduced

This is fundamentally different from simple scaling or linear filtering.


Common Nonlinear Compression Functions

Several mathematical functions are commonly used to model nonlinear amplitude compression behavior.
While these functions are often discussed in the context of dynamic range compression (DRC) in audio, it is more accurate to view them as static nonlinear mappings that reshape amplitude distributions.
The reduction of dynamic range is a result of this mapping, not a definition of the application domain.

Importantly, these functions long predate modern audio compressors and are widely used across signal processing, communication systems, imaging, machine learning, and perceptual modeling.



1. Hyperbolic Tangent (tanh)
b2fc59be4557d.png


The hyperbolic tangent is one of the most widely used smooth, saturating nonlinear functions.


Properties

  • Smooth and continuous saturation
  • Symmetric around zero
  • Gradual compression of large amplitudes
  • Differentiable everywhere

Because tanh smoothly transitions into saturation, it behaves similarly to soft clipping. Small input values pass approximately linearly, while larger values are progressively compressed.


Key Insight

Despite being frequently described as a “compressor,” tanh does not perform gain control over time.
It applies an instantaneous, memoryless mapping from input amplitude to output amplitude.


Common Applications

  • Neural network activation functions
  • Analog circuit saturation models
  • Numerical stability in optimization and control systems
  • Audio distortion and waveshaping (not dynamic compression)

In this sense, tanh represents a static nonlinear transfer function, not a dynamic range controller in the traditional audio-engineering sense.

f49b2ddeafea3.png


2. Logarithmic Compression

b7585c14bf335.png

where,

α: controls the input scaling (compression strength) 

k: controls the output gain or normalization 

1 +: prevents singularity at x = 0


Logarithmic compression provides strong attenuation of large amplitudes while preserving sensitivity to small signals.


Properties

  • Strong compression for high-amplitude inputs
  • Naturally matches logarithmic human perception in some domains
  • Large dynamic range mapped into compact output range


Common Applications

  • Audio and acoustics (e.g., decibel scale)
  • Spectral analysis and visualization
  • Information theory
  • Feature scaling in machine learning

It is worth noting that the widespread use of decibels already reflects a logarithmic amplitude compression, even outside audio processing.



3. Power-Law Compression

2cf8a825bd982.png


Power-law compression offers a tunable and mathematically simple way to reshape amplitude distributions.


Properties

  • Adjustable compression strength via γ
  • Preserves monotonicity
  • No explicit saturation point


Common Applications

  • Image processing (gamma correction)
  • HDR(High Dynamic Range) tone mapping
  • Physical sensor calibration
  • Perceptual modeling in vision science

In fact, power-law compression is more central to image processing than audio, highlighting that these methods are not inherently audio-specific.


4. μ-law Companding

Used in digital communication systems

4c95070bcfe9e.png

where,

x: normalized input signal

y: compressed output

μ: compression parameter

sgn(x): sign function

μ-law is a specialized form of logarithmic compression designed for digital communication efficiency.


Properties

  • Expands small signals
  • Compresses large signals
  • Optimizes quantization resolution


Common Applications

  • Digital telephony
  • Speech coding systems
  • Low-bitrate communication channels


Although frequently associated with audio, μ-law was developed primarily to improve signal-to-noise ratio under limited bit depth, not as a creative audio processor.


Visualization: How Compression Changes a Signal


Before nonlinear amplitude compression

Before nonlinear amplitude compression: signal has a wide dynamic range

Click the ▶ button in MALMIJAL to play the sound


152a8518704cc.png

After tanh-based compression: reduces dynamic range and redistributes signal amplitude

Click the ▶ button in MALMIJAL to play the sound


Time-Domain Perspective

In the time domain, nonlinear compression results in

  • Reduced peaks
  • Smoother waveform shape
  • Limited amplitude growth

Large peaks are “flattened,” while smaller fluctuations remain visible.


Before nonlinear amplitude compression

FFT before static nonlinear amplitude compression(mapping)


40132e8550454.png

FFT after static nonlinear amplitude compression(mapping) 

spectral distortion and dynamic range reduction as a result of amplitude remapping


Frequency-Domain Perspective

Unlike linear systems, nonlinear compression introduces new frequency components.

This happens because nonlinear operations generate

  • Harmonics
  • Intermodulation products

As a result

  • The spectrum becomes richer
  • Distortion may appear


Key Insight

Nonlinear compression is not merely about reducing amplitude or making signals louder or quieter.
At a deeper level, it reshapes how values are distributed across their range.

In practice, nonlinear amplitude compression fundamentally alters

  • Signal shape through instantaneous amplitude remapping
  • Spectral components via nonlinear distortion and harmonic generation
  • Perceptual characteristics, often aligning signals more closely with human sensory response

While these effects are commonly discussed under the umbrella of dynamic range compression in audio, the presence of nonlinear compression does not automatically imply a dynamic or time-dependent process.


Engineering Perspective

A useful and general way to think about many nonlinear compression functions is

y[n] = f(x[n])


This expression describes a static nonlinear mapping. Each input sample is transformed independently, without reference to past or future values.

Despite its apparent simplicity, this formulation captures rich and complex behavior, including

  • Nonlinear distortion
  • Energy redistribution across frequencies
  • Harmonic and intermodulation generation

Crucially, this class of compression operates without envelope detection, attack, or release.
There is no time-varying gain control—only an instantaneous reshaping of amplitude.

Functions such as tanh, logarithmic compression, power-law scaling, and μ-law companding all fall into this category.
They have been used for decades across signal processing, communication systems, imaging, machine learning, and perceptual modeling—often long before modern audio compressors existed.


Static Compression vs. Dynamic Range Compression

This distinction helps clarify a common source of confusion.

Static nonlinear compression

  • Instantaneous amplitude mapping
  • No memory, no temporal behavior
  • Examples: tanh, log, power-law, μ-law


Dynamic range compression (in the practical audio sense)

  • Time-dependent level detection
  • Attack and release dynamics
  • Explicit, time-varying gain control

Dynamic range reduction, therefore, is best understood as a resulting effect, not a definition of the processing method or its application domain.


Conclusions

Nonlinear amplitude compression is a fundamental and broadly applicable concept in signal processing.

Several mathematical functions are commonly used to model nonlinear compression behavior.
Although they are frequently discussed in the context of audio dynamic range compression, it is more accurate to view them as static nonlinear mappings that reshape amplitude distributions.

From this perspective,

  • Dynamic range reduction is an outcome, not a limitation to audio
  • The same mathematical tools apply across many disciplines
  • Time-dependent compressors represent a specialized extension, not the general case

Understanding this distinction is essential for analyzing real-world signals, designing nonlinear systems, and moving beyond idealized linear models.


Suggested Further Reading

You may also find these topics helpful: