This document is written for readers who have basic signal-processing background but have not worked deeply on hearing-aid DSP.
It has three goals:
- Explain why HearAdjust currently caps manual gain at
+40 dB, and why that is an implementation constraint rather than a medical threshold. - Explain the common hearing-aid algorithms and technical terms in a coherent DSP framework.
- Explain how those algorithms are typically implemented, and how that differs from the current project.
dB HLis an audiometric hearing-threshold scale.dB gainis signal gain applied inside an audio processing chain.
They are not related by a direct one-to-one mapping.
Reasons include:
- target compensation depends on frequency
- target compensation depends on input level
- a hearing aid must balance audibility, comfort, and maximum output
So a 40 dB HL loss at one frequency does not imply that +40 dB fixed playback gain is the correct engineering choice.
EQ, short for equalization, is a system that imposes a frequency response
In simple terms:
- low frequencies may be amplified
- mids may remain flat
- highs may be attenuated
That is EQ.
But real hearing-aid DSP typically includes more than static equalization:
- dynamic compression
- output limiting
- feedback cancellation
- noise reduction
- directionality
- frequency lowering
So EQ should be thought of as one foundational block in a hearing-aid chain, not as the complete device logic.
Static compensation:
- a given band receives the same gain regardless of input level
Dynamic compensation:
- soft input receives more gain
- loud input receives less gain
Modern hearing-aid processing is usually built around the latter.
The current Hearing Aid Mode in this project is fundamentally an 8-band cascaded peaking EQ.
Current characteristics:
- each band is a
BiquadFilterNode - filter type is
peaking - center frequencies are fixed at 250, 500, 750, 1000, 2000, 4000, 6000, and 8000 Hz
Q = 1.5is fixed- only the band gain changes
- the overall graph is approximately
source -> 8-band EQ -> destination
So the current system is:
- a parametric equalizer
- with fixed center frequencies and fixed Q
- with variable per-band gain
- whose overall response is approximately the product of the cascaded band responses
It does not currently include:
- per-band envelope detection
- wide dynamic range compression
- a dedicated output limiter
- adaptive feedback cancellation
- high-frequency lowering
For that reason, the current implementation is closer to a personal compensation EQ than to a full hearing-aid processing chain.
Peaking EQ, also called a peaking filter or bell EQ, has a bell-shaped magnitude response.
- with positive gain, it creates a peak around a center frequency
- with negative gain, it creates a dip around that center frequency
Its main parameters are:
Determines where the peak or dip is centered.
Determines whether that band is boosted or cut.
+6 dBincreases magnitude around the band-6 dBdecreases magnitude around the band
Determines how wide the affected band is.
- larger
Qmeans narrower bandwidth - smaller
Qmeans wider bandwidth
For the current project:
Q = 1.5is moderately broad- each control point affects a neighborhood of frequencies rather than an infinitesimal single tone
The current implementation is static EQ without dedicated output protection. Under that design, high positive gain quickly causes practical problems.
If several bands are boosted simultaneously, time-domain peaks can increase significantly.
Even when each band looks acceptable in isolation, the recombined output can still create:
- clipping
- inter-sample peak risk
- harsh distortion
Compensation gain boosts not only useful speech content but also:
- background noise
- codec artifacts
- reverberant tails
- sibilance and hiss
Sensorineural hearing loss often behaves less like a rigid shift and more like:
- soft sounds are inaudible
- loud sounds quickly become uncomfortable
That is one reason why real hearing aids rely on WDRC rather than just large fixed gains.
If the UI ceiling is pushed to +50 dB or +60 dB without limiter or MPO control, the system becomes easier to overload and harder to use comfortably.
It is easiest to understand them in the order they appear in a more typical processing chain.
input
-> preprocessing / conditioning / calibration
-> crossover or filter bank
-> per-band envelope detection
-> per-band WDRC
-> optional noise reduction / speech enhancement / directionality control
-> optional frequency lowering
-> recombination
-> output limiter / MPO
-> receiver
Common examples include:
NAL-NL2DSL v5
These are not the audio processors themselves. They are target-generation methods.
Their inputs often include:
- the audiogram
- user category or age
- binaural context
- audibility and intelligibility goals
Their outputs are typically:
- target gain by frequency and input level
So they serve more as parameter generators for dynamic hearing-aid processing than as direct filter implementations.
This is the front end of a multichannel hearing aid.
Purpose:
- split broadband input into subbands
- allow each subband to be processed independently
Common implementation choices:
- IIR crossovers
- FIR analysis filter banks
- FFT or STFT subband processing
- gammatone or auditory-inspired filter banks
Tradeoffs:
- IIR: cheap and low-latency, but phase and crossover interaction require care
- FIR: easier phase control, but higher order and latency
- STFT: convenient for noise reduction and speech enhancement, but block latency and windowing become important
WDRC usually does not react to the raw waveform directly. It first estimates subband level or envelope.
Common methods:
- full-wave rectification followed by low-pass filtering
- RMS detector
- Hilbert envelope
- peak detector
Key design questions:
- time constants
- peak sensing versus RMS sensing
- attack and release smoothing
Peak detectors:
- respond more strongly to transients
- are often useful for protection
RMS detectors:
- track average energy more closely
- usually yield smoother subjective behavior
This is one of the central dynamic processing blocks in hearing aids.
Goal:
- make soft sounds audible
- keep medium sounds natural
- keep loud sounds tolerable
From an input-output curve perspective:
- below a kneepoint, gain is relatively high
- above it, output grows more slowly than input
Common parameters:
TK, compression threshold or kneepointCR, compression ratioattackreleasemake-up gainor insertion gain
In a piecewise-linear view, a common interpretation is:
- when input level
L_inis belowTK, apply a higher effective gain - when
L_inexceedsTK, reduce gain according to the compression ratio
The compressed segment slope is often written as:
1 - 1/CR
When CR > 1, each additional 1 dB at the input produces less than 1 dB increase at the output.
In the broad literature, AGC can refer to many kinds of dynamic gain adjustment.
In hearing-aid discussions it is useful to distinguish:
- slow AGC for overall loudness adaptation
- faster WDRC for audibility and comfort shaping
- output AGC or limiting for overload protection
So AGC is better viewed as a broad family, with WDRC as one important subtype.
MPO is about keeping the output from becoming too intense.
It is generally implemented near the end of the chain.
Purpose:
- limit strong peaks
- prevent output overload
- preserve subjective comfort
It is primarily a protection and comfort mechanism, not a speech-enhancement algorithm.
Both are dynamic range processors.
The practical difference is in degree and purpose:
- a compressor changes dynamic range more gradually
- a limiter uses high ratio and fast response to stop peaks
A common architecture is:
- per-band WDRC first
- then a fast broadband limiter at the output
Hearing-aid noise reduction is usually not trying to remove noise completely. It aims to:
- improve comfort
- reduce sustained background load
- preserve speech while suppressing less useful energy
Common methods include:
- spectral subtraction
- Wiener filtering
- MMSE-style estimators
- modulation-domain filtering
- DNN-based speech enhancement
Engineering constraints are usually:
- low latency
- stable behavior
- minimal musical noise
That is why commercial systems are often conservative.
With multiple microphones, a device can exploit spatial information to improve SNR.
Common approaches:
- fixed beamformers
- adaptive beamformers
- binaural beamforming
This matters because improving input SNR often helps more than adding another +6 dB of gain later.
But a browser extension that captures tab audio does not generally have access to a real microphone array or acoustic scene, so this part does not map directly to the current project.
At high gain, an important problem is acoustic feedback:
- the receiver emits sound
- the microphone picks it back up
- a loop is formed
- whistling appears
Common solutions:
- adaptive estimation of the feedback path
- LMS, NLMS, or related adaptive filters
- subtraction of the estimated feedback component from the microphone signal
Engineering difficulty:
- the real feedback path changes with fit and positioning
- correlation between feedback and desired input can cause misadjustment
When high-frequency hearing loss is severe, more treble gain may no longer be useful and may instead increase:
- noise
- feedback risk
- harshness
That is when frequency lowering becomes attractive.
Common families:
- frequency compression
- frequency transposition
- frequency translation
Typical steps:
- detect high-frequency content or features
- shift or compress it into a lower target region
- blend it with the original or adjacent bands
Main difficulties:
- metallic artifacts
- altered speech spectral cues
- high parameter sensitivity
Here is the same idea from a more engineering-oriented view.
Split input into subbands:
x[n] -> x1[n], x2[n], ..., xM[n]
For example:
- rectification followed by low-pass filtering
- or short-window RMS
This yields a level estimate L_i[n] for each band.
For band i, define a level-to-gain mapping:
G_target_i = f_i(L_i)
The function f_i usually comes from:
- the audiogram
- the fitting rule
- fitted target points across different input levels
Direct instantaneous gain jumps would create:
- pumping
- zipper noise
- modulation distortion
So a first-order smoother or separate attack and release constants are typically used.
y_i[n] = g_i[n] * x_i[n]
y[n] = sum_i y_i[n]
Common final stages are:
- broadband limiter
- output AGC
- MPO control
IIR advantages:
- low computation
- low latency
- good fit for real-time devices
IIR disadvantages:
- nonlinear phase
- crossover interaction must be designed carefully
FIR advantages:
- linear phase is possible
- magnitude shaping is intuitive
FIR disadvantages:
- longer filters can mean larger latency
- hearing-aid pipelines are very latency-sensitive
Time-domain filter banks:
- easier latency control
- historically common in low-latency hearing-aid systems
STFT:
- more flexible frequency-domain processing
- convenient for denoising and speech enhancement
- but block processing usually increases delay
Hearing-aid systems are extremely sensitive to delay.
Excess delay can create:
- echo-like sensation
- unnatural self-voice perception
- poor wear comfort
That is why long windows, deep buffers, and heavy iterative processing are often avoided in real-time assistive pipelines.
The current Hearing Aid Mode does provide:
- fixed-frequency EQ control
- manual per-band gain
- basic audibility compensation
But it is missing several core hearing-aid capabilities.
Band gain does not depend on the input level.
That means:
- soft and loud sounds are amplified similarly
- loudness recruitment is not handled well
There is no independent MPO or final limiter.
So under high gain the most immediate engineering risks are:
- clipping
- reduced comfort
Real hearing aids often vary by:
- left versus right ear
- quiet versus speech versus noise environments
- soft versus medium versus loud inputs
The current project does not yet include those axes of adaptation.
Recommended additions:
- pre-gain headroom control
- post-EQ limiter or compressor
- peak monitoring
Meaning:
- first solve the engineering problem of overload under high gain
Recommended additions:
- stop treating gain as fixed per band
- add envelope detection and dynamic gain per band
- derive target curves from audiograms and fitting rules
Meaning:
- move from graphic compensation EQ toward a dynamic hearing compensation processor
For example:
- frequency lowering
- adaptive noise reduction
- separate left/right fitting
- context-aware presets
The current +40 dB ceiling is primarily an implementation safety limit, not a medical boundary.
Without limiter, MPO control, and WDRC, simply extending the slider range tends to make the system noisier, more distortion-prone, and less stable.
If stronger compensation is needed, the next step should not be “more static EQ”. It should be “level-dependent multiband processing”.
EQ: a system that changes gain as a function of frequencypeaking EQ: a bell-shaped boost or cut around a center frequencyQ: quality factor controlling bandwidthfilter bank: a set of filters that splits the signal into subbandsWDRC: wide dynamic range compression; more gain for soft sounds, less for loud soundsAGC: automatic gain control; a broad family of level-dependent gain controlMPO: maximum power output controllimiter: a high-ratio, fast-acting peak restrainerbeamforming: spatial filtering using multiple microphonesfeedback cancellation: estimation and subtraction of the feedback pathfrequency lowering: moving high-frequency information into a lower audible region
- MDN Web Docs:
DynamicsCompressorNode - Wikipedia:
Hearing aid - Wikipedia:
Dynamic range compression
These notes are intended as technical guidance for engineering understanding and implementation, not as medical fitting advice.