Digital Signal Processing (DSP) Architecture for Acoustic Noise Removal
Unwanted acoustic contamination compromises speech clarity, professional podcast productions, and forensic audio investigations. Background noise generally falls into two distinct physical categories: wideband stochastic noise (such as thermal preamplifier hiss, air conditioning fan air turbulence, and room reverberation) and narrowband deterministic interference (such as electromagnetic mains hum at 50 Hz or 60 Hz and acoustic ground loops).
Traditional cloud-based "AI noise reduction" platforms upload private recordings to external data centers where neural networks re-synthesize vocal spectra. This process often introduces catastrophic "underwater" phase smearing, metallic chirping artifacts, and exposes sensitive audio to permanent server retention. 2ClickKit takes an analytical acoustic engineering approach, applying surgical Infinite Impulse Response (IIR) Biquad filters running directly in the browser's native Web Audio C++ audio thread.
Biquad Filter Mathematics & Frequency Transformation
At the core of the Web Audio BiquadFilterNode is the second-order digital biquad filter transfer function defined in the Z-domain:
H(z) = (b0 + b1*z^-1 + b2*z^-2) / (a0 + a1*z^-1 + a2*z^-2) By modulating the feedforward coefficients (b0, b1, b2) and feedback coefficients (a0, a1, a2), three specialized filter topologies are cascaded in series:
- Surgical Notch Filter (Mains Hum Elimination): A band-stop filter configured with a high quality factor (Q ≥ 10). The -3 dB attenuation bandwidth is strictly confined to a razor-thin window:
BW = f0 / Q = 60 Hz / 10 = 6.0 Hz
This ensures that while the 60 Hz electrical interference is attenuated by over 40 dB, musical bass frequencies at 50 Hz and 70 Hz pass through with less than 0.5 dB of insertion loss. - Second-Order Butterworth High-Pass (Rumble Filter): Implements a maximally flat passband with a damping ratio of ζ = 1/√2 (Q = 0.707). Attenuates mechanical vibrations and wind blasts at a steep 12 dB per octave slope below the cutoff frequency (40 Hz to 160 Hz).
- High-Frequency Low-Pass De-Hisser: Progressively attenuates wideband thermal Johnson-Nyquist noise generated by microphone preamplifiers and analog cassette tapes above 6 kHz to 12 kHz.
| Noise Type | Physical Origin | Target Frequency Band | Recommended Filter Topology |
|---|---|---|---|
| AC Electrical Hum | Ground loops, unshielded cables, transformers | 50 Hz / 60 Hz (Fundamental) | Narrowband Notch (Q = 10 to 15) |
| Mains 2nd Harmonic | Full-wave rectifier power supplies | 100 Hz / 120 Hz | Secondary Notch (Q = 10) |
| Mechanical Rumble | HVAC blowers, mic stand thuds, traffic | 20 Hz – 80 Hz | Butterworth High-Pass (12 dB/oct) |
| Wind Buffeting | Air velocity slamming capsule diaphragm | 10 Hz – 100 Hz | Steep High-Pass (Cutoff @ 80–120 Hz) |
| Preamp & Tape Hiss | Thermal electron noise, analog bias tape | 7,000 Hz – 20,000 Hz | Low-Pass Roll-off (Cutoff @ 8–10 kHz) |
Instantaneous A/B Auditioning & Psychoacoustics
A common failure mode in audio restoration is "over-filtering," where an audio engineer inadvertently strips away warm vocal fundamentals or crisp consonant sibilance while chasing noise floor reduction. To prevent this, 2ClickKit features seamless Zero-Latency A/B Comparison.
When toggling between "Cleaned" and "Original" during playback, the audio engine maintains continuous clock synchronization via AudioContext.currentTime. The input buffer source is dynamically repatched from the filtered biquad cascade directly to the destination node without stopping playback or resetting the playback cursor. This allows your auditory cortex to immediately isolate and verify that only undesirable noise has been removed.
Programmatic Biquad Notch Filter Implementation
Web developers can implement studio-grade mains hum attenuation in browser environments with this concise JavaScript Web Audio snippet:
// Client-Side 60 Hz Mains Hum Notch Filter with Harmonic Suppression
function createHumNotchFilter(audioContext, utilityFreq = 60) {
// Fundamental 60 Hz Notch
const fundamentalNotch = audioContext.createBiquadFilter();
fundamentalNotch.type = 'notch';
fundamentalNotch.frequency.setValueAtTime(utilityFreq, 0);
fundamentalNotch.Q.setValueAtTime(12, 0); // High Q for surgical cut
// 2nd Harmonic 120 Hz Notch
const harmonicNotch = audioContext.createBiquadFilter();
harmonicNotch.type = 'notch';
harmonicNotch.frequency.setValueAtTime(utilityFreq * 2, 0);
harmonicNotch.Q.setValueAtTime(10, 0);
// High-Pass Filter for handling rumble
const rumbleCut = audioContext.createBiquadFilter();
rumbleCut.type = 'highpass';
rumbleCut.frequency.setValueAtTime(80, 0);
rumbleCut.Q.setValueAtTime(0.707, 0);
// Cascade filter chain
rumbleCut.connect(fundamentalNotch);
fundamentalNotch.connect(harmonicNotch);
return {
input: rumbleCut,
output: harmonicNotch
};
} Tips for Clean Field & Home Studio Recording
While digital filtering cleanly eliminates background noise post-recording, preventing noise at the physical microphone transducer is always ideal:
- Eliminate Ground Loops at the Outlet: If your audio interface or USB microphone produces loud buzz whenever your laptop is connected to wall power, unplug the charger and test on battery power. If the buzz vanishes, your laptop charger is injecting switch-mode power supply noise into your ground plane.
- Physical Shock Mounting: Microphone stands transmit floor footsteps and desktop typing vibrations directly into the capsule housing. Always use an elastic shock mount to mechanically isolate the microphone from physical surfaces.
- Gain Staging vs Digital Boost: Avoid setting hardware preamp gain to 100% on budget USB interfaces, as cheap integrated preamps exhibit severe self-noise above 85% gain. Keep analog gain at around 65% to 75% and apply clean 32-bit digital gain in software.