a-weighting
Status calibrated
npm2.0.1licenseMIT
A/B/C/D/Z/M frequency weighting functions for audio
Overview
- Install
- Updated
- Category
- dsp, 5 libraries
- Tags
- measure, primitives
- Standards
- ITU-R 468, IEC 61672
A/B/C-weighting and ITU-R 468 have moved to
@audio/weighting—@audio/weighting-{a,b,c,itu468}are actual audio-processing filters (not just magnitude curves) and also expose.response(f)for the same magnitude query this package provides. D-weighting and flat Z-weighting have no@audio/weightingequivalent yet — this package remains the reference for those two.
Standard frequency weighting curves (IEC 61672, ITU-R 468) for approximating equal-loudness contours of human ear.
Usage
import { a } from 'a-weighting'
// apply a-weighting to frequency spectrum
let weighted = frequencies.map((magnitude, i, data) => {
let frequency = 22050 * i / data.length
return a(frequency) * magnitude
})
Returns normalized 0..1 weight values, not decibels. To convert: 20 * Math.log10(weight).
Weights
| Export | Standard | Description |
|---|---|---|
a |
A-weighting | General noise measurement |
b |
B-weighting | Moderate loudness |
c |
C-weighting | High loudness |
d |
D-weighting | Aircraft noise |
m |
ITU-R 468 | Telecommunications |
z |
Z-weighting | Flat (unity gain) |
See also
- @audio/weighting - IIR A/B/C/K/ITU-468/RIAA weighting filters for sample processing (
.response(f)for the magnitude curve). - Equal-loudness contours