Given an audio file (WAV), I need to find the $\rm L_{A_{eq}}$ (continuous A-weighted equivalent sound pressure level) of the audio file. For this purpose, I am following this workflow:
- Get a frame of audio (say $0.125$ seconds of samples)
- Scale the samples to find the $\rm SPL \ re \ 20 \ \mu Pa$ based on calibration factor obtained from a calibration tone.
- Apply A weighting to the frame of audio data.
- For each frame of audio data, find the SPL (dB) as:
$$ \begin{align} \textrm{pressure}_{\rm Ref} &= 20\times10^{-6};\\ \textrm{amplitude}_{\rm rms} &= \sqrt{\rm mean( audData_1frame.^2 )};\\ \textrm{dBspl}_{\rm perFrame} &= 20\times \log_{10}\left(\frac{\rm amplitude_{rms}}{\rm pressure_{Ref }}\right);\\ \end{align} $$
This gives the $\rm SPL \ re \ 20 \ \mu Pa$ of a frame of data. This would be the Short $\rm L_{eq}$.
How do I proceed further to get these 3 quantities:
$\rm L_{eq}$ = The total continuous equivalent sound pressure level. This wold be a scalar value for the entire audio file. If it has to be updated in a plot, how do we integrate the SPL of each frame with the previous frames?
$\rm L_{eq_{fast}}$ = Sound pressure level with $125\ ms$ time weighting
$\rm L_{eq_{slow}}$ = SPL with $1\ s$ time weighting