You can use the audioread
function in MATLAB to read the mp3 file and get the audio data. Then you can calculate the dynamic range of the audio using the peak2rms
function.
Here's an example code snippet:
main.m234 chars13 lines
In this code, by calculating dynamic_range
, we get the dynamic range of the audio in decibels (dB) which describes the difference between the loudest and quietest parts of the audio signal.
Note that the peak2rms
function can also be used instead of calculating this manually. This function returns the dynamic range in dB directly.
gistlibby LogSnag