Sign in

username or email:

password:



Not a member?
Forgot your password?

Search code



Search tips

Ads

See Also

Embedded SystemsFPGA

DSP Code Sharing > A-weighting filter

A-weighting filter

Language: Matlab

Processor: Not Relevant

Submitted by on Sep 25 2011

Licensed under a Creative Commons Attribution 3.0 Unported License

A-weighting filter


 

The code below will generate coefficients for a digital A-weighting filter.  What is an A-weighting filter you say?  Perhaps this wikipedia article can help? http://en.wikipedia.org/wiki/A-weighting

Basically, this filter is used to approximate how humans perceive the loudness of a signal by emphasizing/deemphasizing key frequencies on the auditory system.  Generate the coefficients base on your sampling rate and then filter you audio signal to see how the ear percieves the signal.  Something you might think would be lud turn out to be very tiny and other signals may grow in intensity.

A-weighting can be particularly useful if you are trying to gauge the loudness of turn-on transients (pops and clicks).  See wiki article for more details.

 

* I don't have a source for this, but I have heard from colleagues that A-weighting is used when the listening level is 50 - 90dB SPL.  For higher listening levels C-weighting is recommended.

 
%Sampling Rate
Fs = 48000;

%Analog A-weighting filter according to IEC/CD 1672.
f1 = 20.598997;
f2 = 107.65265;
f3 = 737.86223;
f4 = 12194.217;
A1000 = 1.9997;
pi = 3.14159265358979;
NUM = [ (2*pi*f4)^2*(10^(A1000/20)) 0 0 0 0 ];
DEN = conv([1 +4*pi*f4 (2*pi*f4)^2],[1 +4*pi*f1 (2*pi*f1)^2]);
DEN = conv(conv(DEN,[1 2*pi*f3]),[1 2*pi*f2]);

%Bilinear transformation of analog design to get the digital filter.
[b,a] = bilinear(NUM,DEN,Fs);
 
 
Rate this code snippet:
0
Rating: 0 | Votes: 0
 
   
 
posted by



Comments


No comments yet for this code


Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )