how to calculate sound level (spL) audio file (*.wav) ?

87 views (last 30 days)
ngoc quy hoang ngoc quy
ngoc quy hoang ngoc quy on 27 Feb 2021
Commented: ZHU z on 10 Apr 2022
calculate sound level

Answers (1)

jibrahim on 4 Mar 2021
Hi ngoc,
You can use splMeter from Audio Toolbox.
% EXAMPLE: Calculate sound pressure level of signal
audFileName = 'FunkyDrums-44p1-stereo-25secs.mp3';
scope = timescope('SampleRate',Fs,...
'YLimits',[20 110], 'AxesScaling','auto',...
{'LAF', 'LAeq', 'LApeak', 'LAmax'});
sm = splMeter('TimeWeighting', 'Fast',...
'FrequencyWeighting', 'A-weighting',...
'SampleRate', Fs, ...
x = audioread(audFileName);
[LAF,LAeq,LApeak,LAmax] = sm(x(:,1));

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!