audioJS

@audio/filter-preemphasis

Status calibrated

npm1.1.3licenseMIT

Pre-emphasis / de-emphasis filter

Overview

Install
Updated
Family
filter, 16 packages under it
Tags
shape
import { emphasis, deemphasis } from '@audio/filter-preemphasis'

First-order highpass (emphasis) and its inverse (de-emphasis) — used before and after coding or transmission.

H(z)=1−αz−1H(z) = 1 - \alpha z^{-1} (emphasis)  /  H(z)=11−αz−1H(z) = \dfrac{1}{1 - \alpha z^{-1}} (de-emphasis)

Rolloff: emphasis boosts above fc=(1−α)fs2πf_c = \frac{(1-\alpha) f_s}{2\pi} — α=0.97\alpha = 0.97 gives ~210 Hz at 44.1 kHz
Inverse pair: deemphasis exactly cancels emphasis — He(z)⋅Hd(z)=1H_e(z) \cdot H_d(z) = 1 (round-trip error ~5.5e-17)

emphasis(buffer, { alpha: 0.97 })    // before encoding
deemphasis(buffer, { alpha: 0.97 })  // after decoding — exact inverse
Function Param Default
emphasis alpha 0.97 GSM/AMR speech coding convention
deemphasis alpha 0.97 must match the emphasis call it inverts

Pass the same params object on every call to persist the one-pole state across blocks.

Use when: speech coding (GSM, AMR uses α=0.97\alpha = 0.97), tape recording, FM broadcasting.


Part of @audio/filter — the filter family umbrella. This README is generated from the umbrella docs.

MIT © audiojs