Clipping
Clipping (Audio Distortion)
A form of audio distortion that occurs when a signal exceeds the maximum level a system can handle, causing the waveform peaks to be cut off flat, producing harsh, unpleasant crackles or buzzing.
技術的詳細
In digital audio, clipping happens when sample values exceed the maximum representable range (1.0 for floating-point, 32,767 for 16-bit integer). The clipped samples are clamped to the maximum value, creating flat-topped waveforms rich in harsh high-frequency harmonics. Digital clipping is more objectionable than analog clipping (which introduces softer saturation). Detection involves scanning for consecutive samples at the maximum value. Prevention strategies include proper gain staging, using headroom (targeting -3 to -6 dBFS peaks), and applying limiters that reduce gain before clipping occurs.
例
```javascript
// Clipping: Web Audio API example
const audioCtx = new AudioContext();
const response = await fetch('audio.mp3');
const buffer = await audioCtx.decodeAudioData(await response.arrayBuffer());
const source = audioCtx.createBufferSource();
source.buffer = buffer;
source.connect(audioCtx.destination);
source.start();
```