File Exchange

image thumbnail

A-weighting Filter with Matlab

version 1.5.0.0 (2 KB) by Hristo Zhivomirov
A-weighting of a signal via spectral processing in the frequency domain.

28 Downloads

Updated 17 Dec 2018

View License

The present code is a Matlab function that provides an A-weighting of a given signal via spectral processing.

An example is given in order to clarify the usage of the function. For convenience, the input and output arguments are given in the beginning of the function.

The code is based on the theory described in:

[1] Design Response of Weighting Networks for Acoustical Measurements ANSI S1.42-2001. Washington, American National Standards Institute, 2001.

[2] Electroacoustics Sound Level Meters Part 1: Specifications IEC 61672-1:2002. Geneva, International Electrotechnical Commission, 2002.

Cite As

Hristo Zhivomirov (2019). A-weighting Filter with Matlab (https://www.mathworks.com/matlabcentral/fileexchange/46819-a-weighting-filter-with-matlab), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (8)

Hi, Ifigenia!
In order to resolve the issue you can filter the signal (time series) x[n] as y = filterA(x, fs); and then you can find the dB(A) values as Y = 20*log10(y/2e-5);. If you need some additional help, do not hesitate to contact me.

All best,
Hristo

Hello!Can anyone help me calculating the SPL in Db(A)?
I have the Sound Pressure signal in Pa and I need it dB(a).
Using this function, and using for x the Sound pressure Level I computed , I get a result of NaN.
I appreciate any help :)

Hi Jonas! Thank you for your comment! Everything is alright with the function now! You may test and share your opinion about it!

Best regards,
Hristo

Hi. I think this implementation is wrong. When plotting 20*log10(A) over frequency, this does not at all match the blue curve in https://upload.wikimedia.org/wikipedia/en/c/c2/Lindos3.svg.
I think you are off by a square, i.e., a factor 2 in logarithmic domain. If you'd take the square root of the weighting curve before multiplying with the signal spectrum, you'd be more or less correct.

Very helpful! Thank you!

micpro

Hi,
Does anyone help me related with dbA filter please?

Hi Steve! I can't resolve the problem at this stage, since I haven't enough information. Please, send me the figure, it will be a good starting point.

Steve

I made a comparison of the resulting spectrum using this time domain filter and the resulting spectrum using a direct implementation of the frequency domain definition of A-weighting as per the ANSI Standard S1.42-2001. Agreement was less than satisfactory.

My sampling rate was 25.6 kHz. Maybe this is too low. Let me know if you have any suggestions. I can send a figure showing the comparison if you'd like.

Updates

1.5.0.0

Change of the title of the submission.

1.4.0.0

A new version of the code has been uploaded.

1.3.0.0

A new version of the code has been uploaded.

1.2.0.0

A new version of the code has been uploaded.

1.1.0.0

Typos correction has been made.

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux