May I ask how to get the value of amplitude from one wav. file?

3 ビュー (過去 30 日間)
loong seow li
loong seow li 2016 年 4 月 29 日
コメント済み: loong seow li 2016 年 4 月 30 日
May I ask how to get the value of amplitude from one wav. file? Because I want to do distortion wav. file..

採用された回答

Image Analyst
Image Analyst 2016 年 4 月 29 日
The amplitude is the value of the array at that element. If you want the max value over all elements, use max().
[y,Fs] = audioread('guitartune.wav'); % y can have + and - amplitudes.
amplitudes = abs(y); % abs(y) is the amplitudes in an all-positive sense
maxY = max(abs(y)); % maxY is the highest amplitude.
  7 件のコメント
Image Analyst
Image Analyst 2016 年 4 月 30 日
You can simply use multiplication and division to scale your vector or matrix to anything you want.
desiredMax = 0.1;
yScaled = y * desiredMax / maxY;
loong seow li
loong seow li 2016 年 4 月 30 日
okok....thanks a lot

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMeasurements and Statistics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by