how to get amplitude of mp3 audio file?
11 views (last 30 days)
Show older comments
I need to know the amplitude value of a mp3 file to calculate PSNR. Is there any function in matlab that can show the amplitude value of a mp3 file? May someone help me to answer my question please? thank you.
0 Comments
Accepted Answer
Jan
on 21 May 2017
The command audioread imports an MP3 or WAV file to a matrix, which contains the amplitudes. This is not the amplitude of the original signal, but it is exactly, what you want: The amplitude of the signal stored in the file.
Steganography in an MP3 file requires to de-compress the file at first, embed the secret information, and re-compress the signal to a new MP3 file. Note that the process of un- and re-compressing will degrade the quality of the signal already, even without inserting additional information.
2 Comments
More Answers (1)
Star Strider
on 20 May 2017
The audioread function limits the amplitude of the output to ±1, so the original amplitude information will be lost unless you recorded a scaling value when you recorded it. You have to read the file in order to estimate the amplitude as a function of time.
7 Comments
Walter Roberson
on 21 May 2017
"If I use WAV, is there any function in matlab to know the amplitude of that WAV file?"
No.
Walter Roberson
on 21 May 2017
You write asking about "amplitude", but you do not define what kind of amplitude you are talking about. Are you looking for Sound Pressure Level ?
"I need to compare the mp3 audio quality before and after embedding of steganography process."
Then why do you care about "amplitude" ? How are you measuring "audio quality" ? Is the measurement of audio quality something to do with Sound Pressure Level? Does it matter for your purposes whether the "amplitude" is a number from 0 to 1023, or a number from -512 to +511, or a number between -1 and +1 ? Is your quest for "audio quality" aided by knowing that the recording was a "line-in" level or at "mic level"?

See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!