Skip to content

audiojs/a-weighting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

a-weighting Build Status unstable Greenkeeper badge

Perform A-weighting (and others) for a frequency. Useful for creating believable spectrum images and audio measurements.

A-weighting

Usage

npm install a-weighting

var aWeight = require('a-weighting/a');
var ft = require('fourier-transform');

//get a-weighted frequencies
var frequencies = ft(waveform).map(function (magnitude, i, data) {
	var frequency = 22050 * i / data;

	return aWeight(frequency) * magnitude;
});

Note that weight function returns normalized 0..1 weight values, it does not do decibels calculation. If you need to convert weight to decibels, do 20 * Math.log(weight) / Math.log(10).

Implemented weights:

Credits

Thanks to all the specialists who researched and described these curves (years of work I guess) and wikipedia for detailed articles on this.

Related

About

👂 A-weighting and other noise weighting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published