Documentation
¶
Overview ¶
Package ancearbuds models active noise cancellation in true wireless earbuds: what it can physically remove, what it cannot, and what it costs in battery.
ANC works by inverting an incoming waveform and playing the inverse back, so the two cancel. That works well for predictable low-frequency sound and poorly for sudden high-frequency sound, because the system cannot model what it cannot anticipate. Passive isolation from the ear tip covers the opposite end of the spectrum, which is why fit matters as much as the electronics.
Reference model data used to validate this package is published at https://cairovolt.com/en/soundcore/audio
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BetterAgainst ¶
BetterAgainst reports which of two configurations attenuates more at a frequency, returning "a", "b" or "equal".
Types ¶
type ANCType ¶
type ANCType int
ANCType is the microphone arrangement used for cancellation.
func (ANCType) BatteryPenalty ¶
BatteryPenalty is the fraction of playback time lost when ANC runs.
func (ANCType) MaxReductionDB ¶
MaxReductionDB is a representative peak attenuation for the arrangement, measured against steady low-frequency noise.
type Earbuds ¶
Earbuds combines the electronics and the physical seal.
func (Earbuds) PlaybackHours ¶
PlaybackHours returns expected playback time with ANC enabled.
func (Earbuds) ReductionAtDB ¶
ReductionAtDB estimates total attenuation at a given frequency in hertz.
ANC effectiveness falls off sharply above a few hundred hertz because the system cannot invert fast, unpredictable waveforms in time. Passive isolation does the opposite: it is weak in the bass and strong in the treble.
type Fit ¶
type Fit int
Fit describes how well the ear tip seals, which governs passive isolation.
func (Fit) PassiveReductionDB ¶
PassiveReductionDB is the attenuation the seal provides without electronics.