|
|
Wave Distortion: Noise, Clipping, and Nonlinearity |
Wave Distortion Simulator — developed with assistance from ChatGPT (GPT-5), an AI model by OpenAI, October 2025.
Code converted from original MATLAB code wavedistortion.m by Steven Sahyun, University of Wisconsin - Whitewater, Nov. 12, 2021
The following student activity to do was generated by ChatGPT October 2025
This simulator demonstrates how an audio wave (like a simple tone) changes when affected by noise, clipping, and nonlinear distortion. These effects occur in real audio systems, such as microphones, amplifiers, and digital processing. The original signal is a pure sine wave: White noise adds random background sound. Increasing Noise Amplitude adds a random “hiss” to the wave. In the frequency plot, noise raises the overall level across many frequencies rather than just one. Clipping occurs when the wave exceeds the Clipping Amplitude. The peaks are “cut off,” making the waveform flatter at top and bottom. This introduces high-frequency components, making clipped sounds buzzy or harsh. A nonlinear response simulates real devices that distort the wave shape in a curved way. The formula applied is: The lower plot shows the FFT (frequency spectrum) of the waveform: x-axis = frequency (Hz), y-axis = amplitude. A pure sine wave has one strong peak; noise or distortion introduces additional peaks (harmonics). Adjust the sliders to explore:
Wave Distortion Simulator – Explanation
1. Purpose
2. The Clean Wave
y(t) = A sin(2π f t)
where A is amplitude, f is frequency, and t is time.3. White Noise
4. Clipping Distortion
5. Nonlinear Distortion
y_new = y^(1 + 2 * nonlinear)
Positive values exaggerate peaks; negative values compress them.6. Frequency Spectrum
What to Observe
Students should: