how to get amplitude of mp3 audio file?

16 ビュー (過去 30 日間)
Rini Indrayani
Rini Indrayani 2017 年 5 月 20 日
コメント済み: Star Strider 2017 年 5 月 21 日
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.

採用された回答

Jan
Jan 2017 年 5 月 21 日
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 件のコメント
Rini Indrayani
Rini Indrayani 2017 年 5 月 21 日
Actually, i had done steganography using homogenous frame from mp3 file. I had used audioread function to get the amplitude value to compare both of mp3 audio files (before and after steganography process). But i got the same value for all amplitudes from both mp3 audio files. So when i used that amplitudo values to calculate PSNR, the value is infinite. Because the difference value between both audio files is zero.that's why i am not sure about is it the true way to get amplitude or not.
Star Strider
Star Strider 2017 年 5 月 21 日
My point, exactly.

サインインしてコメントする。

その他の回答 (1 件)

Star Strider
Star Strider 2017 年 5 月 20 日
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 件のコメント
Walter Roberson
Walter Roberson 2017 年 5 月 21 日
"If I use WAV, is there any function in matlab to know the amplitude of that WAV file?"
No.
Walter Roberson
Walter Roberson 2017 年 5 月 21 日
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"?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by