So I have a .wav file and I am trying to determine the overall sound energy from the file. The code I have is pretty basic so far and provides an accurate FFT of the sound being produced from the file.
clc
clear all
close all
[data, fs] = audioread('TEST.wav');
data_fft = fft(data);
dB = 10.*log10((10*abs(data_fft)).^2);
frequency(:,1) = ((1:480000)/10); %480,000 48 kHz (divide 10 second audio file)
Weighting = 2+20.*log10((12200^2.*frequency.^4./((frequency.^2+20.6.^2).*(frequency.^2+12200.^2).*((frequency.^2+107.2.^2).*(frequency.^2+737.9.^2)).^0.5))); %Apply A weighting
dBa = dB + Weighting;
Now that I have the dBa values vs frequency, I want to determine the overal sound value from this. The angle I am working towards is determining the 1/3 octave "averaged" values potentially from a filter and then taking the "rms" of those values but I am not sure how to apply this filter or take into account all of the values.