Editor's Note: This file was a File Exchange Pick of the Week
This series of M-files generates normalized A-weigthing, C-weighting, octave and one-third-octave digital filters. These type of filters are commonly used in acoustical measurements, for example, in noise control. The implementation is based on the IEC standard for A- and C-weighting filters and on the ANSI and IEC standards for octave and one-third-octave filters. A complete one-third-octave analyzer with graphical output is also provided.
Christophe COUVREUR (2021). octave (https://www.mathworks.com/matlabcentral/fileexchange/69-octave), MATLAB Central File Exchange. Retrieved .
Inspired: Fractional Octave Band and A, B, C Weighting Filters DF2T SOS IIR Matlab and limited Labview, Real time octave analysis, Reverberation Time Calculator, Calibrated Spectral Analysis, Nth_Oct_Hand_Arm_&_AC_Filter_Tool_Box, One-third-octave filter bank, including additional inputs and outputs, Impulse response acoustic information calculator, Acoustic Tracker (Updated), Nth Octave Frequency Bands
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Make sure you correct the leq.m Bug
Also, no idea why the FS is fixed in the octave bank tool.
% Leq in decibels is calculated as
% 10*log10(Prms.^2/Pref.^2)
% In the code Prms.^2 is calculated as
% p(i) = sum(x((i-1)*t+1:i*t).^2)/t;
% which is correct, but
% in the next code block Leq is calculated in dB as
% p(idx) = 10*log10(p(idx)/Pref);
% which is correct only for reference Pref=1 (1.^2 = 1)
% For Pref~=1 the code should be
% p(idx) = 10*log10(p(idx)/Pref.^2)
In bankdisp.m modify with a loop to fix x ticks for R2016b:
YTickLabel = get(gca,'YTickLabel'); % MATLAB 5.1
for i=1:length(YTickLabel)
NewYTickLabel(i) = str2double(YTickLabel{i}) + Pmin;
end
I have speech signal (5 sec) with smpling rate 16kHz and I neeed to use this function on it can anyone clear how can I used this function (I need to the 31 octave).... but still some error
will this work on MATLAB r2016a ?
Hi,
It is true how to calculate the dBA value:
1) [B,A] = adsgn(22050);
2) Y = filter(B,A,X);
3) P = leq(Y,t); // t=number of sample
4) The result in dBA??
Thank You
Can someone please explain why % All filters below Fs/20 will be implemented after a decimation ?
Thank you much for this.
CLean accurate and well documented
Thanks for this excellent tool.
I tested the 1/3rd octave algorithm with several sine waves and found it more than accurate anough for analysis. Thank you.
Christophe provides easy to use code of great practical value. Anyone working in acoustics should be aware of this work.
Fantastic...i can't stop using it, and Boyco...you couldn't be more right...thanks
Great! Saved a lot of coding and reading in standards. Why not include these in the signal processing toolbox?
Excellent... save me many hours of coding
Bravo
These routines helped make wind tunnel test successful.
good work man.... thanks
hey too good...solved a major problem for us...thanks a ton
Note: if you're trying to run adsgn.m or cdsgn.m under GNU Octave (with Matcompat or Octave-forge), the line
[B,A] = bilinear(NUMs,DENs,Fs);
Should be changed to
[B,A] = bilinear(NUMs,DENs,1/Fs);
to account for Octave's syntax.
Perfect for acoustics. I use it every day!
excellent for learning DSP
BUG Warning!!
It seems this submission is growing in popularity with about 2000 downloads now, and is being used by other subimissions too (Scott Hirsch's 'Real time octave analysis'). Some time ago I found a bug in the 'Leq.m' function which is also used by 'filtbank.m'. Here are the comments from my m-file:
% Leq in decibels is calculated as
% 10*log10(Prms.^2/Pref.^2)
% In the code Prms.^2 is calculated as
% p(i) = sum(x((i-1)*t+1:i*t).^2)/t;
% which is correct, but
% in the next code block Leq is calculated in dB as
% p(idx) = 10*log10(p(idx)/Pref);
% which is correct only for reference Pref=1 (1.^2 = 1)
% For Pref~=1 the code should be
% p(idx) = 10*log10(p(idx)/Pref.^2)
An excellent tool for doing octave and third octave band analysis. We are using it for analyzing different types of noise recordings that are collected in field studies. It provides a means to tranlate FFT transfer functions to more comprehensible data for the layperson.
An excellent tool for doing octave and third octave band analysis. We are using it for analyzing different types of noise recordings that are collected in field studies. It provides a means to tranlate FFT transfer functions to more comprehensible data for the layperson.
This is a great toolbox - I really like that it cites the ANSII standards. I tell all of my acoustics friends about it!
Great tool! I use it everyday in my research. Thanks.