필터 지우기
필터 지우기

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

조회 수: 7 (최근 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 CenterFile Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by